Class GlobalExtension


  • public class GlobalExtension
    extends ComponentExtension
    Extension information for a schema global definition component. This adds reference tracking to the basic extension information, along with a map for child components of the definition.
    Author:
    Dennis M. Sosnoski
    • Field Detail

      • s_logger

        static final Logger s_logger
        Logger for class.
      • m_schemaExtension

        private final SchemaExtension m_schemaExtension
        Containing schema extension.
      • m_included

        private boolean m_included
        Component to be specifically included in code generation (requiring a separate class).
      • m_referenceCount

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

        private java.util.ArrayList m_references
        List of extensions for components referencing this definition.
      • m_dependencies

        private java.util.ArrayList m_dependencies
        List of global definitions used by this definition (one entry per reference, may contain duplicates).
      • m_definition

        private DefinitionItem m_definition
        Definition item for this global definition.
    • Constructor Detail

      • GlobalExtension

        public GlobalExtension​(SchemaExtension schemext,
                               OpenAttrBase comp)
        Constructor.
        Parameters:
        schemext - extension for containing schema
        comp - actual component
    • Method Detail

      • getSchemaTypes

        public java.util.Map getSchemaTypes()
        Get map from schema type local name to type information.
        Returns:
        map
      • getNameConverter

        public NameConverter getNameConverter()
        Get name converter used for this component.
        Returns:
        converter
      • getClassDecorators

        public ClassDecorator[] getClassDecorators()
        Get code generation decorators used for this component.
        Returns:
        converter
      • getPackage

        public PackageHolder getPackage()
        Get package for class generation.
        Returns:
        package
      • isPushInline

        public boolean isPushInline()
        Check if inlining of definition is pushed (even when multiple values are involved).
        Returns:
        inline
      • isPreferInline

        public boolean isPreferInline()
        Check if inlining of definition preferred. Inlining of xs:attributeGroup and xs:group definitions is always preferred.
        Returns:
        inline
      • isUseInnerClasses

        public boolean isUseInnerClasses()
        Check if inner classes should be used for substructures.
        Returns:
        inner
      • isIncluded

        public boolean isIncluded()
        Check if component specifically included in code generation (requiring a separate class).
        Returns:
        included
      • setIncluded

        public void setIncluded​(boolean included)
        Set flag for component specifically included in code generation (requiring a separate class).
        Parameters:
        included -
      • addReference

        public void addReference​(ComponentExtension anno)
        Add reference extension.
        Parameters:
        anno -
      • getReference

        public ComponentExtension getReference​(int index)
        Get referencing extension by index position.
        Parameters:
        index -
        Returns:
        reference
      • addDependency

        public void addDependency​(ComponentExtension anno)
        Add dependency extension.
        Parameters:
        anno -
      • getDependencyCount

        public int getDependencyCount()
        Get the number of dependencies for this component.
        Returns:
        count
      • getDependency

        public GlobalExtension getDependency​(int index)
        Get dependency extension by index position.
        Parameters:
        index -
        Returns:
        reference
      • resetDependencies

        public void resetDependencies()
        Reset the dependencies and references of this component. This must be called before beginning a reference tracking pass, to clear any information from prior passes.
      • checkRemovable

        public void checkRemovable()
        Check if the global definition can be removed from the schema. If it can, this adjusts the usage counts for all dependencies of the definition, forcing a check of each dependency as the counts are adjusted.
      • getDefinition

        public DefinitionItem getDefinition()
        Get definition item.
        Returns:
        item
      • setDefinition

        public void setDefinition​(DefinitionItem item)
        Set definition item.
        Parameters:
        item -
      • normalize

        public void normalize()
        Normalize the schema definition component. This recursively traverses the schema model tree rooted in the global component, normalizing each child component.