Class SegmentConfig

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<ComponentConfig>, Replicateable
    Direct Known Subclasses:
    RecordConfig

    public class SegmentConfig
    extends PropertyConfig
    A segment is used to combine fields, constants and other segments. Wrapper component may also be added to segment.

    A segment can be bound to a bean object by calling PropertyConfig.setType(String). (The bound attribute is ignored for segments- setting type to null has the same effect as setting bound to false.)

    A segment may repeat if its maximum occurrences is greater than one, and be bound to a collection or array by calling PropertyConfig.setCollection(String).

    Segments will have their position calculated automatically during compilation.

    The constant attribute is set during compilation, and is meant for internal use only.

    Since:
    2.0
    • Constructor Detail

      • SegmentConfig

        public SegmentConfig()
    • Method Detail

      • getPropertyList

        public java.util.List<PropertyConfig> getPropertyList()
        Returns a list of all immediate children including segments, fields and constants and the immediate children of any wrapper child.
        Returns:
        list of children
      • isConstant

        public boolean isConstant()
        Returns whether this segment is used to define a bean constant.
        Returns:
        true if there is no field descendant of this segment
      • setConstant

        public void setConstant​(boolean constant)
        Sets whether this segment is used to define a bean constant.
        Parameters:
        constant - true if there is no field descendant of this segment
      • getDefaultExistence

        public boolean getDefaultExistence()
        Returns the default existence setting for this segment as calculated during pre-processing.
        Returns:
        the default existence
      • setDefaultExistence

        public void setDefaultExistence​(boolean defaultExistence)
        Sets the default existence for this segment, which is calculated during pre-processing.
        Parameters:
        defaultExistence - the default existence
      • getKey

        public java.lang.String getKey()
        Returns the name of the property descendant to use for the Map key when collection is set to map.
        Overrides:
        getKey in class PropertyConfig
        Returns:
        the key property name
      • setKey

        public void setKey​(java.lang.String key)
        Sets the name of the property descendant to use for the Map key when collection is set to map.
        Parameters:
        key - the key property name
      • getTarget

        public java.lang.String getTarget()
        Returns the name of the target property for this segment.
        Returns:
        the target property name
      • setTarget

        public void setTarget​(java.lang.String target)
        Sets the name of the target property for this segment, which can be used in lieu of class to return simple field types contained within the segment.
        Parameters:
        target - the target property name