Package org.jibx.schema.codegen
Class ReferenceItem
- java.lang.Object
-
- org.jibx.schema.codegen.Item
-
- org.jibx.schema.codegen.ReferenceItem
-
public class ReferenceItem extends Item
Information for a reference to a global definition. The reference may be replaced with an inlined copy of the definition during code generation.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description private DefinitionItem
m_definition
Referenced type structure definition.private static Logger
s_logger
Logger for class.
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
ReferenceItem(GroupItem group, DefinitionItem def)
Internal constructor for converting group to reference.private
ReferenceItem(ReferenceItem original, Item ref, GroupItem parent)
Copy constructor.(package private)
ReferenceItem(AnnotatedBase comp, GroupItem parent, DefinitionItem def)
Internal constructor for direct reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 Item
copy(Item ref, GroupItem parent)
Copy the item under a different parent.protected java.lang.String
describe(int depth, boolean classified)
Build a description of the reference.DefinitionItem
getDefinition()
Get the referenced structure.Item
inlineReference()
Inline the referenced structure.-
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
-
-
-
-
Field Detail
-
s_logger
private static final Logger s_logger
Logger for class.
-
m_definition
private final DefinitionItem m_definition
Referenced type structure definition.
-
-
Constructor Detail
-
ReferenceItem
private ReferenceItem(ReferenceItem original, Item ref, GroupItem parent)
Copy constructor.- Parameters:
original
-ref
- reference (for overrides to copy;null
if none)parent
-
-
ReferenceItem
ReferenceItem(AnnotatedBase comp, GroupItem parent, DefinitionItem def)
Internal constructor for direct reference.- Parameters:
comp
- schema componentparent
- containing structure (null
if a top-level structure)def
- referenced definition
-
ReferenceItem
ReferenceItem(GroupItem group, DefinitionItem def)
Internal constructor for converting group to reference. This is used when an embedded group is converted to a separate definition, as needed for class reuse.- Parameters:
group
-def
-
-
-
Method Detail
-
getDefinition
public DefinitionItem getDefinition()
Get the referenced structure.- Returns:
- reference
-
inlineReference
public Item inlineReference()
Inline the referenced structure. This replaces the reference with a deep copy of the definition, copying the reference name and optional/repeated information over to the definition.- Returns:
- replacement group
-
classifyContent
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. If this is an element or attribute reference the actual referencing component is used for classification purposes, since that will determine the classification. Otherwise, the actual definition is used as the source of the information.- Overrides:
classifyContent
in classItem
-
-