public class SegmentConfig extends PropertyConfig
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.
JSON_TYPE_ARRAY, JSON_TYPE_BOOLEAN, JSON_TYPE_NONE, JSON_TYPE_NUMBER, JSON_TYPE_OBJECT, JSON_TYPE_STRING
Constructor and Description |
---|
SegmentConfig()
Constructs a new SegmentConfig.
|
Modifier and Type | Method and Description |
---|---|
char |
getComponentType()
Returns the component type.
|
boolean |
getDefaultExistence()
Returns the default existence setting for this segment as calculated
during pre-processing.
|
String |
getKey()
Returns the name of the property descendant to use for the
Map key when collection is set to map.
|
List<PropertyConfig> |
getPropertyList()
Returns a list of all immediate children including segments, fields and
constants and the immediate children of any wrapper child.
|
String |
getTarget()
Returns the name of the target property for this segment.
|
boolean |
isConstant()
Returns whether this segment is used to define a bean constant.
|
protected boolean |
isSupportedChild(ComponentConfig child)
Returns whether a node is a supported child of this node.
|
void |
setConstant(boolean constant)
Sets whether this segment is used to define a bean constant.
|
void |
setDefaultExistence(boolean defaultExistence)
Sets the default existence for this segment, which is calculated
during pre-processing.
|
void |
setKey(String key)
Sets the name of the property descendant to use for the
Map key when collection is set to map.
|
void |
setTarget(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.
|
getCollection, getGetter, getJsonArrayIndex, getJsonName, getJsonType, getLabel, getMaxOccurs, getMaxOccursRef, getMaxSize, getMinOccurs, getMinOccursRef, getMinSize, getOccursRef, getPosition, getSetter, getType, getUntil, getXmlType, isBound, isCollection, isIdentifier, isJsonArray, isLazy, isNillable, isRepeating, setBound, setCollection, setGetter, setIdentifier, setJsonArray, setJsonArrayIndex, setJsonName, setJsonType, setLabel, setLazy, setMaxOccurs, setMaxOccursRef, setMaxSize, setMinOccurs, setMinOccursRef, setMinSize, setNillable, setOccursRef, setPosition, setSetter, setType, setUntil, setXmlType
getOrdinal, getXmlName, getXmlNamespace, getXmlPrefix, isXmlNamespaceAware, setOrdinal, setXmlName, setXmlNamespace, setXmlNamespaceAware, setXmlPrefix
add, clone, find, getChildren, getFirst, getName, isDescendant, iterator, print, print, setName, size, sort, toParamString, toString, updateReferences
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public char getComponentType()
ComponentConfig
getComponentType
in class ComponentConfig
ComponentConfig.GROUP
, ComponentConfig.RECORD
, ComponentConfig.SEGMENT
, ComponentConfig.FIELD
,
ComponentConfig.CONSTANT
or ComponentConfig.WRAPPER
public List<PropertyConfig> getPropertyList()
public boolean isConstant()
public void setConstant(boolean constant)
constant
- true if there is no field descendant of this segmentprotected boolean isSupportedChild(ComponentConfig child)
TreeNode
TreeNode.add(TreeNode)
.isSupportedChild
in class PropertyConfig
child
- the node to testpublic boolean getDefaultExistence()
public void setDefaultExistence(boolean defaultExistence)
defaultExistence
- the default existencepublic String getKey()
getKey
in class PropertyConfig
public void setKey(String key)
key
- the key property namepublic String getTarget()
public void setTarget(String target)
target
- the target property name