Package org.jibx.schema.codegen
Class ClassHolder.ParentNode
- java.lang.Object
-
- org.jibx.schema.codegen.ClassHolder.DataNode
-
- org.jibx.schema.codegen.ClassHolder.ParentNode
-
- Enclosing class:
- ClassHolder
protected static class ClassHolder.ParentNode extends ClassHolder.DataNode
Information for an interior node of the data structure tree. Depending on the type of the associated schema component a selector field may be used to track which of a set of alternatives is actually present.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
m_complexCollection
Flag for a collection node that wraps some other structure (rather than a simple leaf node).private java.lang.String
m_prefix
Prefix for all contained value names (null
if none used).private boolean
m_selectChecked
Flag for selection requirement checked.private java.lang.String
m_selectCheckMethod
Method name for selection check method.private java.lang.String
m_selectField
Field name for selectorprivate boolean
m_selectNeeded
Flag for selection needed.private boolean
m_selectorExposed
Selection state exposed to user flag.private int
m_selectorType
Type of selector handling needed for group.private java.lang.String
m_selectSetMethod
Method name for selection set method.private java.util.ArrayList
m_values
Values in this group.
-
Constructor Summary
Constructors Constructor Description ParentNode(GroupItem group, ClassHolder.ParentNode parent)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addChild(ClassHolder.DataNode value)
Add a child node (which may be another parent) to this parent.void
adjustName()
Adjust name based on group nesting.java.lang.String
describe(int depth)
Generate the subtree description.java.util.ArrayList
getChildren()
Get child nodes of this parent.java.lang.String
getPrefix()
Get prefix for value names in group.java.lang.String
getSelectCheckMethod()
Get selector check method name.java.lang.String
getSelectField()
Get selector field name.int
getSelectorType()
Get the selector type.java.lang.String
getSelectSetMethod()
Get selector set method name.boolean
isComplexCollection()
Check if this is a collection that wraps some other structure (rather than a simple leaf node).boolean
isInterior()
Check if this is an interior node (alwaystrue
).boolean
isSelectorExposed()
Check if selector state should be exposed to user.boolean
isSelectorNeeded()
Check if a selector field is required for this group.boolean
isSelectorType()
Check if a selector field may be required for this group.void
setSelectCheckMethod(java.lang.String name)
Set selector check method name.void
setSelectField(java.lang.String name)
Set selector field name.void
setSelectSetMethod(java.lang.String name)
Set selector set method name.-
Methods inherited from class org.jibx.schema.codegen.ClassHolder.DataNode
appendDocText, appendSelectConstText, getBindingType, getDocumentation, getFieldName, getFlagMethodName, getGetMethodName, getItem, getParent, getPropName, getQName, getReferenceQName, getSchemaComponent, getSelectConstName, getSelectPropName, getSetMethodName, getTestMethodName, getType, isAny, isCollection, isIgnored, isList, isNamed, isOptional, isReference, setDocumentation, setFieldName, setFlagMethodName, setGetMethodName, setPropName, setSelectConstName, setSelectPropName, setSetMethodName, setTestMethodName
-
-
-
-
Field Detail
-
m_selectorType
private final int m_selectorType
Type of selector handling needed for group. Selector fields are used with mutually exclusive alternatives. The values are based onNestingCustomBase.SELECTION_UNCHECKED
and alternatives.
-
m_selectorExposed
private final boolean m_selectorExposed
Selection state exposed to user flag.
-
m_prefix
private final java.lang.String m_prefix
Prefix for all contained value names (null
if none used).
-
m_values
private final java.util.ArrayList m_values
Values in this group.
-
m_complexCollection
private boolean m_complexCollection
Flag for a collection node that wraps some other structure (rather than a simple leaf node).
-
m_selectField
private java.lang.String m_selectField
Field name for selector
-
m_selectCheckMethod
private java.lang.String m_selectCheckMethod
Method name for selection check method.
-
m_selectSetMethod
private java.lang.String m_selectSetMethod
Method name for selection set method.
-
m_selectChecked
private boolean m_selectChecked
Flag for selection requirement checked.
-
m_selectNeeded
private boolean m_selectNeeded
Flag for selection needed.
-
-
Constructor Detail
-
ParentNode
public ParentNode(GroupItem group, ClassHolder.ParentNode parent)
Constructor. This derives the prefix used for all contained value names by appending the class name set for this group to the prefix used for the containing group.- Parameters:
group
- associated item groupparent
- containing node
-
-
Method Detail
-
isInterior
public boolean isInterior()
Check if this is an interior node (alwaystrue
).- Specified by:
isInterior
in classClassHolder.DataNode
- Returns:
true
for structure component
-
isSelectorNeeded
public boolean isSelectorNeeded()
Check if a selector field is required for this group.- Returns:
- selector
-
isSelectorType
public boolean isSelectorType()
Check if a selector field may be required for this group.- Returns:
- selector
-
getSelectorType
public int getSelectorType()
Get the selector type.- Returns:
- type
-
isSelectorExposed
public boolean isSelectorExposed()
Check if selector state should be exposed to user.- Returns:
- selector
-
adjustName
public void adjustName()
Adjust name based on group nesting. This has special handling for the case of <sequence> compositors, substituting the name of the first value in the sequence for the value name if a fixed name has not been assigned to the sequence.
-
getPrefix
public java.lang.String getPrefix()
Get prefix for value names in group.- Returns:
- prefix (
null
if none used)
-
addChild
protected void addChild(ClassHolder.DataNode value)
Add a child node (which may be another parent) to this parent. This method is normally only used by the superclass, when creating a new instance. The instance must be fully initialized before it is added.- Parameters:
value
-
-
getChildren
public java.util.ArrayList getChildren()
Get child nodes of this parent. The returned list is "live", but should never be modified.- Returns:
- values
-
isComplexCollection
public boolean isComplexCollection()
Check if this is a collection that wraps some other structure (rather than a simple leaf node).- Returns:
true
if wrapper collection
-
getSelectField
public java.lang.String getSelectField()
Get selector field name.- Returns:
- name (
null
if no selector for group)
-
setSelectField
public void setSelectField(java.lang.String name)
Set selector field name.- Parameters:
name
- (null
if no selector for group)
-
getSelectSetMethod
public java.lang.String getSelectSetMethod()
Get selector set method name.- Returns:
- name (
null
if no selector set method for group)
-
setSelectSetMethod
public void setSelectSetMethod(java.lang.String name)
Set selector set method name.- Parameters:
name
- (null
if no selector set method for group)
-
getSelectCheckMethod
public java.lang.String getSelectCheckMethod()
Get selector check method name.- Returns:
- name (
null
if no selector check method for group)
-
setSelectCheckMethod
public void setSelectCheckMethod(java.lang.String name)
Set selector check method name.- Parameters:
name
- (null
if no selector check method for group)
-
describe
public java.lang.String describe(int depth)
Generate the subtree description.- Specified by:
describe
in classClassHolder.DataNode
- Parameters:
depth
- current nesting depth- Returns:
- description
-
-