Package org.jibx.schema.codegen
Class ReferenceItem
java.lang.Object
org.jibx.schema.codegen.Item
org.jibx.schema.codegen.ReferenceItem
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
FieldsModifier and TypeFieldDescriptionprivate final DefinitionItem
Referenced type structure definition.private static final Logger
Logger for class. -
Constructor Summary
ConstructorsModifierConstructorDescription(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
Modifier and TypeMethodDescriptionprotected void
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 the item under a different parent.protected String
describe
(int depth, boolean classified) Build a description of the reference.Get the referenced structure.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 Details
-
s_logger
private static final Logger s_loggerLogger for class. -
m_definition
Referenced type structure definition.
-
-
Constructor Details
-
ReferenceItem
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 Details
-
getDefinition
Get the referenced structure.- Returns:
- reference
-
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
-
copy
Copy the item under a different parent. -
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
-
describe
Build a description of the reference.
-