public class GroupItem extends Item
Modifier and Type | Field and Description |
---|---|
private boolean |
m_allOptional
Flag for all child nodes are optional.
|
private boolean |
m_attributePresent
Attribute data present flag.
|
private java.lang.String |
m_className
Name to be used for generated class (
null if inherited). |
private boolean |
m_contentPresent
Character data content data present flag.
|
private boolean |
m_elementPresent
Element data present flag.
|
private boolean |
m_enumeration
Flag for enumeration value.
|
private TypeData |
m_generateClass
Generated class information (
null if inlined). |
private Item |
m_head
First child (
null if none). |
private boolean |
m_inline
Inline references to this structure.
|
private int |
m_size
Number of child items in group.
|
private Item |
m_tail
Last child (
null if none). |
private static org.apache.log4j.Logger |
s_logger
Logger for class.
|
Modifier | Constructor and Description |
---|---|
protected |
GroupItem(AnnotatedBase comp,
GroupItem parent)
Internal constructor.
|
(package private) |
GroupItem(GroupItem original,
Item ref,
GroupItem parent)
Copy constructor.
|
(package private) |
GroupItem(ReferenceItem reference,
ComponentExtension ext)
Constructor from a reference.
|
Modifier and Type | Method and Description |
---|---|
AnyItem |
addAny(AnnotatedBase comp)
Add a child any.
|
GroupItem |
addGroup(AnnotatedBase comp)
Add a child grouping structure.
|
ReferenceItem |
addReference(AnnotatedBase comp,
DefinitionItem ref)
Add a child reference structure.
|
ValueItem |
addValue(AnnotatedBase comp,
QName type,
JavaType ref)
Add a child value.
|
(package private) void |
adoptChildren(GroupItem group)
Adopt the child items from another group as the child items of this group.
|
private void |
appendChild(Item item)
Append an item to the list of children.
|
protected void |
classifyContent()
Classify the content of this item as attribute, element, and/or character data content.
|
DefinitionItem |
convertToDefinition()
Convert an embedded group to a freestanding definition.
|
void |
convertTypeReference()
Handle groups which consist of a single type reference, or of an extension type reference, by subclassing the
class generated for the reference.
|
protected Item |
copy(Item ref,
GroupItem parent)
Copy the item under a different parent.
|
protected java.lang.String |
describe(int depth,
boolean classified)
Generate a description of the item, including all nested items.
|
protected void |
forceAttributePresent()
Set attribute present in group.
|
protected void |
forceContentPresent()
Set character data content present in group.
|
protected void |
forceElementPresent()
Set element present in group.
|
protected void |
forceRequiredPresent()
Set required item present in group.
|
int |
getChildCount()
Get the number of items present in the group.
|
java.lang.String |
getClassName()
Get class name set directly for this group.
|
java.lang.String |
getEffectiveClassName()
Get effective item name, applying inheritance if necessary.
|
Item |
getFirstChild()
Get head item in list grouped by this structure.
|
TypeData |
getGenerateClass()
Get information for class to be generated.
|
boolean |
isAllOptional()
Check if all immediate child nodes are optional.
|
boolean |
isAttributePresent()
Check if an attribute is part of this item.
|
boolean |
isContentPresent()
Check if character data content is part of this item.
|
boolean |
isElementPresent()
Check if a child elements is part of this item.
|
boolean |
isEnumeration()
Check if this value represents an enumeration.
|
boolean |
isExtensionReference()
Check if this group represents an extension reference.
|
boolean |
isFixedClassName()
Check if the class name is fixed by configuration.
|
boolean |
isInline()
Check if structure to be inlined.
|
java.lang.String |
nestedString(int depth,
boolean classified)
Build description of nested items.
|
(package private) void |
replaceChild(Item current,
Item replace)
Replace an item in this group with another item.
|
void |
setClassName(java.lang.String name)
Set class name directly for this group.
|
void |
setEnumeration(boolean enumeration)
Set value represents an enumeration flag.
|
void |
setGenerateClass(TypeData clas)
Set information for class to be generated.
|
void |
setInline(boolean inline)
Set structure to be inlined flag.
|
findDisjointParent, getComponentExtension, getEffectiveName, getName, getNext, getParent, getSchemaComponent, getTopmost, isCollection, isFixedName, isIgnored, isImplicit, isOptional, isTopmost, leadString, reparent, setImplicit, setName
private static final org.apache.log4j.Logger s_logger
private boolean m_enumeration
private boolean m_inline
private java.lang.String m_className
null
if inherited).private int m_size
private Item m_head
null
if none).private Item m_tail
null
if none).private TypeData m_generateClass
null
if inlined).private boolean m_allOptional
private boolean m_attributePresent
private boolean m_elementPresent
private boolean m_contentPresent
protected GroupItem(AnnotatedBase comp, GroupItem parent)
DefinitionItem
subclass.comp
- schema component (should be the simpleType component in the case of an enumeration)parent
- (null
if none)GroupItem(GroupItem original, Item ref, GroupItem parent)
original
- ref
- reference (for overrides to copy; null
if none)parent
- (non-null
)GroupItem(ReferenceItem reference, ComponentExtension ext)
reference
- ext
- component extension to be linked with inlined definitionpublic boolean isEnumeration()
public void setEnumeration(boolean enumeration)
enumeration
- private void appendChild(Item item)
item
- public GroupItem addGroup(AnnotatedBase comp)
comp
- schema componentpublic ReferenceItem addReference(AnnotatedBase comp, DefinitionItem ref)
comp
- schema componentref
- referenced definition itempublic ValueItem addValue(AnnotatedBase comp, QName type, JavaType ref)
comp
- schema component extensiontype
- schema type nameref
- schema type equivalent (null
if not appropriate)public AnyItem addAny(AnnotatedBase comp)
comp
- schema componentvoid replaceChild(Item current, Item replace)
current
- replace
- void adoptChildren(GroupItem group)
group
- public boolean isInline()
public void setInline(boolean inline)
inline
- public java.lang.String getEffectiveClassName()
public java.lang.String getClassName()
null
if to be inherited)public boolean isFixedClassName()
true
if fixed, false
if notpublic void setClassName(java.lang.String name)
name
- (null
if to be inherited)public int getChildCount()
public Item getFirstChild()
null
if none)public TypeData getGenerateClass()
public void setGenerateClass(TypeData clas)
clas
- public boolean isExtensionReference()
true
if extension reference, false
if notpublic void convertTypeReference()
protected void forceAttributePresent()
protected void forceElementPresent()
protected void forceContentPresent()
protected void forceRequiredPresent()
protected void classifyContent()
classifyContent
in class Item
public DefinitionItem convertToDefinition()
public java.lang.String nestedString(int depth, boolean classified)
depth
- current nesting depthclassified
- include classification details flagpublic boolean isAllOptional()
Item.isTopmost()
returns true
).true
if all child nodes optional, false
if notpublic boolean isAttributePresent()
true
for items corresponding to attribute
definitions, and groupings including these items which do not define an element name. This method is only
meaningful for the topmost item associated with a particular schema component (those for which Item.isTopmost()
returns true
).true
if attributepublic boolean isElementPresent()
true
for all items corresponding to element
definitions, and all groupings which include such an item. This method is only meaningful for the topmost item
associated with a particular schema component (those for which Item.isTopmost()
returns
true
).true
if contentpublic boolean isContentPresent()
true
for all items corresponding to
simpleContent definitions, and all groupings which include such an item. This method is only meaningful for the
topmost item associated with a particular schema component (those for which Item.isTopmost()
returns
true
).true
if content