Class SchemaCustom

  • All Implemented Interfaces:
    TypeReplacer

    public class SchemaCustom
    extends SchemaRootBase
    Individual schema customization information.
    Author:
    Dennis M. Sosnoski
    • Field Detail

      • s_logger

        private static final Logger s_logger
        Logger for class.
      • s_allowedAttributes

        public static final StringArray s_allowedAttributes
        Enumeration of allowed attribute names
      • m_name

        private java.lang.String m_name
        Schema name.
      • m_namespace

        private java.lang.String m_namespace
        Schema namespace.
      • m_forceTypes

        private boolean m_forceTypes
        Always specify property types flag.
      • m_includes

        private java.lang.String[] m_includes
        Global names included in code generation.
      • m_excludes

        private java.lang.String[] m_excludes
        Global names excluded from code generation.
      • m_extension

        private SchemaExtension m_extension
        Extension attached to actual schema element (only used for children).
    • Constructor Detail

      • SchemaCustom

        public SchemaCustom​(SchemasetCustom parent)
        Constructor.
        Parameters:
        parent -
      • SchemaCustom

        public SchemaCustom​(SchemasetCustom parent,
                            java.lang.String name,
                            java.lang.String namespace,
                            java.lang.String[] includes,
                            java.lang.String[] excludes)
        Constructor for constructing instance directly.
        Parameters:
        parent -
        name - schema name
        namespace - target namespace URI
        includes - definition names to be included in generation
        excludes - definition names to be excluded from generation
    • Method Detail

      • preSet

        private void preSet​(IUnmarshallingContext uctx)
        Make sure all attributes are defined.
        Parameters:
        uctx - unmarshalling context
      • getIncludes

        public java.lang.String[] getIncludes()
        Get the names of definitions to be included in generation.
        Returns:
        names
      • setIncludes

        public void setIncludes​(java.lang.String[] includes)
        Set the names of definitions to be included in generation. This only has any effect on the code generation if called before extend(PackageHolder, ValidationContext) is called.
        Parameters:
        includes -
      • getExcludes

        public java.lang.String[] getExcludes()
        Get the names of definitions to be excluded from generation.
        Returns:
        names
      • setExcludes

        public void setExcludes​(java.lang.String[] excludes)
        Set the names of definitions to be excluded from generation. This only has any effect on the code generation if called before extend(PackageHolder, ValidationContext) is called.
        Parameters:
        excludes -
      • getName

        public java.lang.String getName()
        Get schema name.
        Returns:
        name
      • setName

        public void setName​(java.lang.String name)
        Set schema name.
        Parameters:
        name -
      • getNamespace

        public java.lang.String getNamespace()
        Get schema namespace.
        Returns:
        namespace
      • setNamespace

        public void setNamespace​(java.lang.String namespace)
        Set schema namespace.
        Parameters:
        namespace -
      • isForceTypes

        public boolean isForceTypes()
        Check if type specifications forced for schema.
        Returns:
        true if types forced, false if not
      • setForceTypes

        public void setForceTypes​(java.lang.Boolean force)
        Set type specifications forced for schema.
        Parameters:
        force - true if types forced, false if not
      • getSchema

        public SchemaElement getSchema()
        Get schema definition.
        Returns:
        schema
      • setSchema

        public void setSchema​(java.lang.String name,
                              SchemaElement schema)
        Set schema definition.
        Parameters:
        name -
        schema -
      • checkMatch

        public boolean checkMatch​(java.lang.String name,
                                  SchemaElement schema)
        Check if this customization matches a particular schema.
        Parameters:
        name -
        schema -
        Returns:
        true if a match, false if not
      • stripAnnotations

        public void stripAnnotations()
        Strip the annotation components (at any level) from a schema definitions.
      • applyRemainingCustomizationPath

        private static void applyRemainingCustomizationPath​(SchemaPath path,
                                                            OpenAttrBase match,
                                                            ComponentCustom custom,
                                                            ValidationContext vctx)
        Evaluate the remaining path for a customization after the first step, and apply it to the extension for each matching schema component. If no matches are found or multiple matches are found this generates a warning.
        Parameters:
        path - customization path
        match - starting point for path
        custom - customization information
        vctx - validation context
      • extend

        public void extend​(PackageHolder pack,
                           ValidationContext vctx)
        Build the schema extension structure. This first builds extensions for all the global definitions in the schema, marking the ones specified to be included or excluded from the schema, and for all the child components of the non-excluded globals. It then applies the customizations to the extensions.
        Parameters:
        pack - package for generated classes (null if no code generation)
        vctx - validation context