|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.xml.schematic.SchemaReferences
public final class SchemaReferences
Manages list of ISchema
s, one for each namespace URI, for a single
document. Thread-safe. Allows you to instantiate and use custom schemas or
schemas not registered in the SchemaPool
.
Ensures that schema objects will not get garbage-collected while document has reference to this object.
Field Summary | |
---|---|
SchemaPool |
pool
The validation context instance. |
Constructor Summary | |
---|---|
SchemaReferences(SchemaPool pool)
Constructs new instance of schema references. |
Method Summary | |
---|---|
ISchema |
getSchema(String namespaceURI)
For given namespace URI returns appropriate Schema object,
that validates elements with this namespace URI. |
SchemaAvailabilityEnum |
getSchemaAvailability(String namespaceURI)
Determines availability of schema for the namespace. |
ISchema |
getSchemaNull(String namespaceURI)
For given namespace URI returns appropriate Schema object,
that validates elements with this namespace URI. |
void |
loadSchema(String namespaceURI)
Loads schema for given namespace. |
void |
loadSchemas(Collection<? extends String> namespaces)
Loads schemas for all given namespaces. |
void |
preserve(Set<? extends String> namespaces)
Preserves only the schemas contained in the given set, but unregisters all other schemas. |
void |
unregisterSchema(String namespaceURI)
Removes the schema from the reference. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final SchemaPool pool
Constructor Detail |
---|
public SchemaReferences(SchemaPool pool)
pool
- the validation context instanceMethod Detail |
---|
public ISchema getSchema(String namespaceURI)
For given namespace URI returns appropriate Schema
object,
that validates elements with this namespace URI.
If no local Schema for given URI exists for given document, then try to get appropriate global Schema (it won't attempt to load the schema if not present).
namespaceURI
- namespace URI.
IllegalStateException
- if Schema with given URI cannot be found.public ISchema getSchemaNull(String namespaceURI)
For given namespace URI returns appropriate Schema
object,
that validates elements with this namespace URI.
If no local Schema for given URI exists for given document, then try to get appropriate global Schema (it won't attempt to load the schema if not present).
namespaceURI
- namespace URI.
null
if no such schema has been loaded.public void loadSchemas(Collection<? extends String> namespaces) throws SchemaException, IOException
namespaces
- collection of String
namespaces.
SchemaException
- if error happens during loading of schemas.
IOException
- if i/o error occurs during the schema files
deserialization.public void unregisterSchema(String namespaceURI)
namespaceURI
- the namespace.public void loadSchema(String namespaceURI) throws SchemaException, IOException
namespaceURI
- the namespace
SchemaException
- if error happens during loading of schemas.
IOException
- if i/o error occurs during the schema files
deserialization.public SchemaAvailabilityEnum getSchemaAvailability(String namespaceURI)
namespaceURI
- the namespace to check
public void preserve(Set<? extends String> namespaces)
namespaces
- set of namespaces that shall be preserved.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |