org.jibx.schema.codegen
Class ReferenceItem

java.lang.Object
  extended by org.jibx.schema.codegen.Item
      extended by 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
private  DefinitionItem m_definition
          Referenced type structure definition.
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
(package private) ReferenceItem(AnnotatedBase comp, GroupItem parent, DefinitionItem def)
          Internal constructor for direct reference.
(package private) ReferenceItem(GroupItem group, DefinitionItem def)
          Internal constructor for converting group to reference.
private ReferenceItem(ReferenceItem original, Item ref, 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  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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_logger

private static final org.apache.log4j.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 component
parent - 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

copy

protected Item copy(Item ref,
                    GroupItem parent)
Copy the item under a different parent.

Specified by:
copy in class Item
Parameters:
ref - reference (for overrides to copy; null if none)
parent -
Returns:
copy

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. the reference is used directly; for anything else other than an element, the actual definition is used as the source of the information.

Overrides:
classifyContent in class Item

describe

protected java.lang.String describe(int depth,
                                    boolean classified)
Build a description of the reference.

Specified by:
describe in class Item
Parameters:
depth - current nesting depth
classified - include classification details flag
Returns:
description


Project Web Site