Interface SchemaDocument
- All Known Implementing Classes:
SchemaDocumentImpl
Unlike schema components defined in XS****
interfaces,
which are inherently de-coupled from where it was loaded from,
SchemaDocument
represents a single XML infoset that
is a schema document.
This concept is often useful in tracking down the reference relationship among schema documents.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetImportedDocuments
(String targetNamespace) Gets theSchemaDocument
s that are imported from this document.Gets theSchemaDocument
s that are included from this document.Set ofSchemaDocument
s that are included/imported from this document.Set ofSchemaDocument
s that include/import this document.GetsXSSchema
component that contains all the schema components defined in this namespace.Gets the system ID of the schema document.The namespace that this schema defines.boolean
imports
(SchemaDocument doc) Returns true if this document imports the given document.boolean
includes
(SchemaDocument doc) Returns true if this document includes the given document.
-
Method Details
-
getSystemId
String getSystemId()Gets the system ID of the schema document.- Returns:
- null if
XSOMParser
was not given the system Id.
-
getTargetNamespace
String getTargetNamespace()The namespace that this schema defines.More precisely, this method simply returns the
targetNamespace
attribute of the schema document. When schemas are referenced in certain ways (AKA chameleon schema), schema components in this schema document may end up defining components in other namespaces.- Returns:
- can be "" but never null.
-
getSchema
XSSchema getSchema()GetsXSSchema
component that contains all the schema components defined in this namespace.The returned
XSSchema
contains not just components defined in thisSchemaDocument
but all the other components defined in all the schemas that collectively define this namespace.- Returns:
- never null.
-
getReferencedDocuments
Set<SchemaDocument> getReferencedDocuments()Set ofSchemaDocument
s that are included/imported from this document.- Returns:
- can be empty but never null. read-only.
-
getIncludedDocuments
Set<SchemaDocument> getIncludedDocuments()Gets theSchemaDocument
s that are included from this document.- Returns:
- can be empty but never null. read-only.
this set is always a subset of
getReferencedDocuments()
.
-
getImportedDocuments
Gets theSchemaDocument
s that are imported from this document.- Parameters:
targetNamespace
- The namespace URI of the import that you want to getSchemaDocument
s for.- Returns:
- can be empty but never null. read-only.
this set is always a subset of
getReferencedDocuments()
.
-
includes
Returns true if this document includes the given document.Note that this method returns false if this document imports the given document.
-
imports
Returns true if this document imports the given document.Note that this method returns false if this document includes the given document.
-
getReferers
Set<SchemaDocument> getReferers()Set ofSchemaDocument
s that include/import this document.This works as the opposite of
getReferencedDocuments()
.- Returns:
- can be empty but never null. read-only.
-