Class TemplateParameter

java.lang.Object
org.simpleframework.xml.core.TemplateParameter
All Implemented Interfaces:
Parameter
Direct Known Subclasses:
AttributeParameter, ElementArrayParameter, ElementListParameter, ElementListUnionParameter, ElementMapParameter, ElementMapUnionParameter, ElementParameter, ElementUnionParameter, TextParameter

abstract class TemplateParameter extends Object implements Parameter
The TemplateParameter object is used to provide stock functions that can be used by all implementations. This ensures there is a consistent set of behaviours for each parameter. It also reduces the number of methods that need to be maintained for each Parameter implementation.
  • Constructor Details

    • TemplateParameter

      protected TemplateParameter()
      Constructor for the TemplateParameter is used to create a template for other parameters. If any of the method implementations are not as required they should be overridden by the subclass.
  • Method Details

    • isAttribute

      public boolean isAttribute()
      This method is used to determine if the parameter represents an attribute. This is used to style the name so that elements are styled as elements and attributes are styled as required.
      Specified by:
      isAttribute in interface Parameter
      Returns:
      this is used to determine if this is an attribute
    • isText

      public boolean isText()
      This is used to determine if the parameter represents text. If this represents text it typically does not have a name, instead the empty string represents the name. Also text parameters can not exist with other text parameters.
      Specified by:
      isText in interface Parameter
      Returns:
      returns true if this parameter represents text