Class DefinitionItem


  • public class DefinitionItem
    extends GroupItem
    Information for a global definition.
    • Field Detail

      • s_logger

        private static final Logger s_logger
        Logger for class.
      • m_referenceCount

        private int m_referenceCount
        Number of references to this definition.
      • m_inlineBlocked

        private boolean m_inlineBlocked
        Inlining not allowed flag.
      • m_checked

        private boolean m_checked
        Checked flag used by the code generation handling to track which definitions have already been processed.
      • m_referenced

        private boolean m_referenced
        Tracking flag for reference seen, used during checking for inline to detect circular definitions.
      • m_classified

        private boolean m_classified
        Flag for definition structure classified.
      • m_typeIsomorphic

        private boolean m_typeIsomorphic
        Type-isomorphic element flag.
      • m_qname

        private QName m_qname
        Qualified name for definition in binding (lazy create, null if not yet set).
    • Constructor Detail

      • DefinitionItem

        public DefinitionItem​(AnnotatedBase comp)
        Constructor for new top-level structure. Child structures should always be created using the containing structure's GroupItem.addGroup(AnnotatedBase) method.
        Parameters:
        comp - schema component
      • DefinitionItem

        DefinitionItem​(GroupItem group)
        Constructor from group. This supports replacing an embedded group with a definition, as needed when an embedded group is used in multiple locations and cannot be inlined.
        Parameters:
        group -
    • Method Detail

      • getReferenceCount

        public int getReferenceCount()
        Get the number of references to this definition.
        Returns:
        count
      • countReference

        public void countReference()
        Count a reference to this definition.
      • isInlineBlocked

        public boolean isInlineBlocked()
        Check if inlining is blocked (due to non-singleton references).
        Returns:
        blocked
      • setInlineBlocked

        public void setInlineBlocked​(boolean blocked)
        Set inlining blocked flag.
        Parameters:
        blocked -
      • isChecked

        public boolean isChecked()
        Check if definition has been processed.
        Returns:
        checked
      • setChecked

        public void setChecked​(boolean checked)
        Set definition has been processed flag.
        Parameters:
        checked -
      • isReferenced

        public boolean isReferenced()
        Check if definition has been referenced during inline checking.
        Returns:
        referenced
      • setReferenced

        public void setReferenced​(boolean refed)
        Set definition has been referenced during inline checking flag.
        Parameters:
        refed -
      • isTypeIsomorphic

        public boolean isTypeIsomorphic()
        Check if this is a type-isomorphic element definition. Type-isomorphic elements use the same generation class as the referenced type, but with a separate mapping definition.
        Returns:
        type-isomorphic
      • setTypeIsomorphic

        public void setTypeIsomorphic​(boolean iso)
        Set the type-isomorphic element definition flag.
        Parameters:
        iso - type-isomorphic flag
      • isPregenerated

        public boolean isPregenerated()
        Check if definition has been pregenerated.
        Returns:
        pregenerated
      • hasDirectGenerateClass

        public boolean hasDirectGenerateClass()
        Check if this definition has a class directly assigned for code generation.
        Returns:
        true if class directly assigned, false if not
      • getGenerateClass

        public TypeData getGenerateClass()
        Get information for class to be generated. This override of the base class implementation checks for the case of a definition which has been inlined, as occurs when a global element definition is the only use of a global type definition. If no generate class is available, this throws an exception.
        Overrides:
        getGenerateClass in class GroupItem
        Returns:
        class
      • getQName

        public QName getQName()
        Get qualified name for definition in binding.
        Returns:
        qname
      • classifyContent

        public void classifyContent()
        Classify the content of this item as attribute, element, and/or character data content. For a definition item, this checks if the classification has already been done, and if not flags it done and invokes the superclass handling.
        Overrides:
        classifyContent in class GroupItem
      • describe

        protected java.lang.String describe​(int depth,
                                            boolean classified)
        Build a description of the item, including all nested items.
        Overrides:
        describe in class GroupItem
        Parameters:
        depth - current nesting depth
        classified - include classification details flag
        Returns:
        description
      • describe

        protected java.lang.String describe()
        Build a description of the definition, including all nested items.
        Returns:
        description