|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.schema.codegen.Item
public abstract class Item
Base class for code generation items. Each instance corresponds to a particular schema component, and this base class tracks that schema component (by way of the extension information), along with related details and linkage information. The linkage uses embedded list links, which allows replacing one instance with another with minimal overhead.
Field Summary | |
---|---|
private boolean |
m_collection
Flag for a collection item. |
private ComponentExtension |
m_componentExtension
Corresponding schema component extension. |
private boolean |
m_implicit
Item is handled by subclassing flag. |
protected Item |
m_last
Preceding item in list ( null if none). |
private java.lang.String |
m_name
Actual name to be used for item ( null if to be inherited). |
protected Item |
m_next
Next item in list ( null if none). |
private boolean |
m_nillable
Flag for a nillable item. |
private boolean |
m_optional
Flag for an optional item. |
private GroupItem |
m_parent
Containing group item. |
private boolean |
m_topmost
Flag for topmost item associated with a particular schema component. |
Constructor Summary | |
---|---|
protected |
Item(AnnotatedBase comp,
GroupItem parent)
Basic constructor. |
protected |
Item(Item original,
Item ref,
ComponentExtension ext,
GroupItem parent)
Copy constructor. |
Method Summary | |
---|---|
protected void |
classifyContent()
Classify the content of this item as attribute, element, and/or character data content, and as requiring content of some form if appropriate. |
protected abstract Item |
copy(Item ref,
GroupItem parent)
Copy the item under a different parent. |
protected abstract java.lang.String |
describe(int depth,
boolean classified)
Generate a description of the item. |
protected GroupItem |
findDisjointParent()
Find the nearest ancestor group which relates to a different schema component. |
ComponentExtension |
getComponentExtension()
Get schema component annotation corresponding to this item. |
java.lang.String |
getEffectiveName()
Get effective item name, applying inheritance if necessary. |
java.lang.String |
getName()
Get name set directly for this item. |
Item |
getNext()
Get next item in list. |
GroupItem |
getParent()
Get containing group item. |
AnnotatedBase |
getSchemaComponent()
Get schema component corresponding to this item. |
Item |
getTopmost()
Get the topmost item associated with the same schema component as this item. |
boolean |
isCollection()
Check if a collection item. |
boolean |
isFixedName()
Check if the name is fixed by configuration. |
boolean |
isIgnored()
Check if item is ignored. |
boolean |
isImplicit()
Check if the item is represented implicitly by subclassing. |
boolean |
isOptional()
Check if item is optional. |
boolean |
isTopmost()
Check if topmost item for a particular schema component. |
protected java.lang.String |
leadString(int depth)
Generate the standard leading text for description of the item. |
protected void |
reparent(GroupItem parent)
Replace the parent for this item. |
void |
setImplicit(boolean implicit)
Set item represented implicitly by subclassing flag. |
void |
setName(java.lang.String name)
Set name directly for this item. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ComponentExtension m_componentExtension
private final boolean m_topmost
private final boolean m_optional
private final boolean m_collection
private final boolean m_nillable
private boolean m_implicit
private GroupItem m_parent
protected Item m_next
null
if none).
protected Item m_last
null
if none).
private java.lang.String m_name
null
if to be inherited).
Constructor Detail |
---|
protected Item(AnnotatedBase comp, GroupItem parent)
false
to avoid redundant handling.
comp
- schema componentparent
- containing group (null
if a top-level group)protected Item(Item original, Item ref, ComponentExtension ext, GroupItem parent)
original
- ref
- reference (for name override; null
if none)ext
- component extension to be linked with copyparent
- (non-null
)Method Detail |
---|
protected void reparent(GroupItem parent)
parent
- public AnnotatedBase getSchemaComponent()
public ComponentExtension getComponentExtension()
public GroupItem getParent()
null
if a top-level group)public boolean isFixedName()
true
if fixed, false
if notpublic java.lang.String getEffectiveName()
public java.lang.String getName()
null
if to be inherited)public void setName(java.lang.String name)
name
- (null
if to be inherited)public Item getNext()
public boolean isTopmost()
isCollection()
,
isOptional()
, GroupItem.isAllOptional()
, GroupItem.isAttributePresent()
,
GroupItem.isContentPresent()
, and GroupItem.isElementPresent()
are all only meaningful for the
topmost item associated with a schema component.
public Item getTopmost()
isCollection()
, isOptional()
, GroupItem.isAllOptional()
, GroupItem.isAttributePresent()
, GroupItem.isContentPresent()
, and GroupItem.isElementPresent()
are all only meaningful for the topmost item associated with a schema component.
public boolean isOptional()
isTopmost()
returns true
).
public boolean isIgnored()
isTopmost()
returns true
).
public boolean isCollection()
isTopmost()
returns true
).
true
if collectionpublic boolean isImplicit()
public void setImplicit(boolean implicit)
implicit
- protected abstract Item copy(Item ref, GroupItem parent)
ref
- reference (for overrides to copy; null
if none)parent
-
protected GroupItem findDisjointParent()
null
if noneprotected void classifyContent()
protected abstract java.lang.String describe(int depth, boolean classified)
depth
- current nesting depthclassified
- include classification details flag
protected java.lang.String leadString(int depth)
depth
- current nesting depth
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |