Class SchemasetCustom

  • All Implemented Interfaces:
    TypeReplacer

    public class SchemasetCustom
    extends SchemaRootBase
    Customization information for a set of schemas.
    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_names

        private java.lang.String[] m_names
        Schema name patterns.
      • m_namespaces

        private java.lang.String[] m_namespaces
        Schema namespace patterns.
      • m_schemaMap

        private final java.util.Map m_schemaMap
        Map from schema identifier to customization.
    • Constructor Detail

      • SchemasetCustom

        public SchemasetCustom​(SchemasetCustom parent)
        Normal constructor.
        Parameters:
        parent -
      • SchemasetCustom

        public SchemasetCustom​(SchemaCustom child)
        Constructor with single schema customization as content.
        Parameters:
        child -
    • Method Detail

      • getNames

        public java.lang.String[] getNames()
        Get schema name match patterns.
        Returns:
        names (null if not set)
      • preSet

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

        public boolean isInSet​(java.lang.String name,
                               SchemaElement schema)
        Check if a schema is included in this set.
        Parameters:
        name - schema file name
        schema - actual schema
        Returns:
        true if in set, false if not
      • getCustomization

        public SchemaCustom getCustomization​(java.lang.String id)
        Get existing schema customization information.
        Parameters:
        id - schema identifier
        Returns:
        customization
      • forceCustomization

        public SchemaCustom forceCustomization​(java.lang.String name,
                                               java.lang.String id,
                                               SchemaElement schema,
                                               ValidationContext vctx)
        Get schema customization information, creating it if it doesn't already exist.
        Parameters:
        name - schema file name
        id - unique identifier for schema
        schema - actual schema
        vctx - validation context for reporting errors
        Returns:
        customization
      • checkSchemas

        public void checkSchemas​(ValidationContext vctx)
        Recursively check that each schema customization has been matched to a schema. A warning is generated for any customization without a matching schema.
        Parameters:
        vctx -
      • validate

        public boolean validate​(ValidationContext vctx)
        Validate and finalize customization information. This override of the base class implementation also invokes the same method on any nested schemasets in order to make sure that the type substitution map and active facets mask will be available for use by nested schemas.
        Overrides:
        validate in class NestingCustomBase
        Parameters:
        vctx - validation context
        Returns:
        true if valid, false if not
      • loadCustomizations

        public static SchemasetCustom loadCustomizations​(java.lang.String path,
                                                         ProblemHandler handler)
                                                  throws JiBXException,
                                                         java.io.IOException
        Load a customizations file. The specified file must exist and have as root element either a <schema-set> or <schema> element.
        Parameters:
        path - customization file path (null if none)
        handler - validation problem handler
        Returns:
        unmarshalled customizations, or null if errors
        Throws:
        JiBXException
        java.io.IOException