|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.schema.codegen.Item
org.jibx.schema.codegen.GroupItem
public class GroupItem
Information for a grouping of components (attributes, elements, compositors, and/or wildcards). This is used both
directly for local groupings, and by way of the DefinitionItem
subclass for global definitions.
Field Summary | |
---|---|
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 ClassHolder |
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. |
Fields inherited from class org.jibx.schema.codegen.Item |
---|
m_last, m_next |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
ClassHolder |
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(ClassHolder clas)
Set information for class to be generated. |
void |
setInline(boolean inline)
Set structure to be inlined flag. |
Methods inherited from class org.jibx.schema.codegen.Item |
---|
findDisjointParent, getComponentExtension, getEffectiveName, getName, getNext, getParent, getSchemaComponent, getTopmost, isCollection, isFixedName, isIgnored, isImplicit, isOptional, isTopmost, leadString, reparent, setImplicit, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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 ClassHolder m_generateClass
null
if inlined).
private boolean m_allOptional
private boolean m_attributePresent
private boolean m_elementPresent
private boolean m_contentPresent
Constructor Detail |
---|
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 definitionMethod Detail |
---|
public boolean isEnumeration()
public void setEnumeration(boolean enumeration)
enumeration
- private void appendChild(Item item)
item
- public GroupItem addGroup(AnnotatedBase comp)
comp
- schema component
public ReferenceItem addReference(AnnotatedBase comp, DefinitionItem ref)
comp
- schema componentref
- referenced definition item
public 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 component
void 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 ClassHolder getGenerateClass()
public void setGenerateClass(ClassHolder clas)
clas
- public boolean isExtensionReference()
true
if extension reference, false
if notpublic void convertTypeReference()
protected Item copy(Item ref, GroupItem parent)
copy
in class Item
ref
- reference (for overrides to copy; null
if none)parent
-
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 flag
public 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 contentprotected java.lang.String describe(int depth, boolean classified)
describe
in class Item
depth
- current nesting depthclassified
- include classification details flag
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |