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 theSchemaDocuments that are imported from this document.Gets theSchemaDocuments that are included from this document.Set ofSchemaDocuments that are included/imported from this document.Set ofSchemaDocuments that include/import this document.GetsXSSchemacomponent that contains all the schema components defined in this namespace.Gets the system ID of the schema document.The namespace that this schema defines.booleanimports(SchemaDocument doc) Returns true if this document imports the given document.booleanincludes(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
XSOMParserwas not given the system Id.
-
getTargetNamespace
String getTargetNamespace()The namespace that this schema defines.More precisely, this method simply returns the
targetNamespaceattribute 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()GetsXSSchemacomponent that contains all the schema components defined in this namespace.The returned
XSSchemacontains not just components defined in thisSchemaDocumentbut all the other components defined in all the schemas that collectively define this namespace.- Returns:
- never null.
-
getReferencedDocuments
Set<SchemaDocument> getReferencedDocuments()Set ofSchemaDocuments that are included/imported from this document.- Returns:
- can be empty but never null. read-only.
-
getIncludedDocuments
Set<SchemaDocument> getIncludedDocuments()Gets theSchemaDocuments 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 theSchemaDocuments that are imported from this document.- Parameters:
targetNamespace- The namespace URI of the import that you want to getSchemaDocuments 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 ofSchemaDocuments that include/import this document.This works as the opposite of
getReferencedDocuments().- Returns:
- can be empty but never null. read-only.
-