Package org.jibx.schema.elements
Class SchemaLocationBase
- java.lang.Object
-
- org.jibx.schema.elements.SchemaBase
-
- org.jibx.schema.elements.OpenAttrBase
-
- org.jibx.schema.elements.AnnotatedBase
-
- org.jibx.schema.elements.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 Summary
Fields Modifier and Type Field Description static org.jibx.util.StringArrays_allowedAttributesList of allowed attribute names.-
Fields inherited from class org.jibx.schema.elements.SchemaBase
ALL_TYPE, ANNOTATION_TYPE, ANY_TYPE, ANYATTRIBUTE_TYPE, APPINFO_TYPE, ATTRIBUTE_TYPE, ATTRIBUTEGROUP_TYPE, CHOICE_TYPE, COMPLEXCONTENT_TYPE, COMPLEXTYPE_TYPE, DOCUMENTATION_TYPE, ELEMENT_MASKS, ELEMENT_NAMES, ELEMENT_TYPE, ENUMERATION_TYPE, EXTENSION_TYPE, FIELD_TYPE, FRACTIONDIGITS_TYPE, GROUP_TYPE, IMPORT_TYPE, INCLUDE_TYPE, KEY_TYPE, KEYREF_TYPE, LENGTH_TYPE, LIST_TYPE, MAXEXCLUSIVE_TYPE, MAXINCLUSIVE_TYPE, MAXLENGTH_TYPE, MINEXCLUSIVE_TYPE, MININCLUSIVE_TYPE, MINLENGTH_TYPE, NOTATION_TYPE, PATTERN_TYPE, REDEFINE_TYPE, RESTRICTION_TYPE, SCHEMA_TYPE, SELECTOR_TYPE, SEQUENCE_TYPE, SIMPLECONTENT_TYPE, SIMPLETYPE_TYPE, TOTALDIGITS_TYPE, UNION_TYPE, UNIQUE_TYPE, WHITESPACE_TYPE
-
Fields inherited from interface org.jibx.schema.IComponent
SCHEMA_NAMESPACE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSchemaLocationBase(int type)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract StringgetEffectiveNamespace()Get the effective namespace to be applied to the referenced schema.StringgetLocation()Get 'schemaLocation' attribute value.SchemaElementgetReferencedSchema()Get referenced schema.protected SchemaElementreadSchema(ValidationContext vctx, ISchemaResolver resolver)Load a schema from a resolver.voidsetLocation(String location)Set 'schemaLocation' attribute value.protected voidsetReferencedSchema(SchemaElement schema)Set referenced schema.-
Methods inherited from class org.jibx.schema.elements.AnnotatedBase
getAnnotation, getId, prevalidate, setAnnotation, setId
-
Methods inherited from class org.jibx.schema.elements.OpenAttrBase
addExtraAttribute, clearExtraAttributes, compactChildren, detachChild, getChild, getChildCount, getChildIterator, getChildrenWritable, getExtraAttributes, preget, replaceChild, validateAttributes
-
Methods inherited from class org.jibx.schema.elements.SchemaBase
addNamespaceDeclaration, bit, clearNamespaceDeclarations, getExtension, getNamespaceDeclarations, getParent, getSchema, isGlobal, name, preset, readNamespaces, setExtension, setParent, type, validate, validateAttributes, writeNamespaces
-
-
-
-
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 contextresolver- Schema Resolver- Returns:
- loaded schema
- Throws:
org.jibx.runtime.JiBXException- errorIOException- 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 (
nullif loading failed)
-
-