Class SchemaLocationBase

  • All Implemented Interfaces:
    IComponent
    Direct Known Subclasses:
    ImportElement, SchemaLocationRequiredBase

    public abstract class SchemaLocationBase
    extends AnnotatedBase
    Base class for elements referencing an external schema. Subclasses need to set the referenced schema during the prevalidation pass, so that the referenced schema will be included in the prevalidation processing.
    Author:
    Dennis M. Sosnoski
    • Field Detail

      • s_allowedAttributes

        public static final org.jibx.util.StringArray s_allowedAttributes
        List of allowed attribute names.
    • Constructor Detail

      • SchemaLocationBase

        protected SchemaLocationBase​(int type)
        Constructor.
        Parameters:
        type - element type
    • Method Detail

      • getEffectiveNamespace

        protected abstract String getEffectiveNamespace()
        Get the effective namespace to be applied to the referenced schema. This must be implemented by subclasses to return the namespace to be applied to the schema, if that namespace is different from what is specified in the schema itself.
        Returns:
        namespace
      • readSchema

        protected SchemaElement readSchema​(ValidationContext vctx,
                                           ISchemaResolver resolver)
                                    throws org.jibx.runtime.JiBXException,
                                           IOException
        Load a schema from a resolver.
        Parameters:
        vctx - validation context
        resolver - Schema Resolver
        Returns:
        loaded schema
        Throws:
        org.jibx.runtime.JiBXException - error
        IOException - error
      • getLocation

        public String getLocation()
        Get 'schemaLocation' attribute value.
        Returns:
        'schemaLocation' value
      • setLocation

        public void setLocation​(String location)
        Set 'schemaLocation' attribute value.
        Parameters:
        location - 'schemaLocation' value
      • setReferencedSchema

        protected void setReferencedSchema​(SchemaElement schema)
        Set referenced schema. This method is supplied for the use of subclasses which load the schema through some means other than the 'schemaLocation' attribute value.
        Parameters:
        schema - schema element
      • getReferencedSchema

        public SchemaElement getReferencedSchema()
        Get referenced schema. This method is only usable after prevalidation.
        Returns:
        schema (null if loading failed)