A forest is a transitive reflexive closure of referenced documents.
IOW, if a document is in a forest, all the documents referenced from
it is in a forest, too. To support this semantics, DOMForest
uses InternalizationLogic to find referenced documents.
Some documents are marked as "root"s, meaning those documents were put into a forest explicitly, not because it is referenced from another document. (However, a root document can be referenced from other documents, too.)
| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| private abstract static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | core
actual data storage |
| private final DocumentBuilder | |
| private EntityResolver | entityResolver
Used to resolve references to other schema documents. |
| private ErrorReceiver | errorReceiver
Errors encountered during the parsing will be sent to this object. |
| public final LocatorTable | locatorTable
Stores location information for all the trees in this forest. |
| protected final InternalizationLogic | logic
Schema language dependent part of the processing. |
| private final Options | |
| public final Set | outerMostBindings
Stores all the outer-most |
| private final SAXParserFactory | |
| private final Set | rootDocuments
To correctly feed documents to a schema parser, we need to remember which documents (of the forest) were given as the root documents, and which of them are read as included/imported documents. |
| Access | Constructor and Description |
|---|---|
| public | DOMForest(SAXParserFactory parserFactory, DocumentBuilder documentBuilder, InternalizationLogic logic)
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | checkSchemaCorrectness(ErrorReceiver errorHandler)
Checks the correctness of the XML Schema documents and return true if it's OK. |
| public XMLParser | createParser()
Creates |
| public SAXSource | createSAXSource(String systemId)
Creates a |
| public void | |
| public Document | |
| public EntityResolver | |
| public ErrorReceiver | |
| public Document | |
| private ContentHandler | |
| public DOMForest. | |
| private String | |
| public Set | |
| public String | |
| public Document[] | |
| public String[] | |
| public Document | |
| public Document | |
| public Document | Returns: null if there was a parse error. otherwise non-null.Parses the given document and add it to the DOM forest. |
| public Document | |
| public void | |
| public void | |
| public SCDBasedBindingSet | Returns: the returned bindings need to be applied after schema components are built.Performs internalization. |
| public void | weakSchemaCorrectnessCheck(SchemaFactory sf)
Performs the schema correctness check by using JAXP 1.3. |
| core | back to summary |
|---|---|
| private final Map<String, Document> core actual data storage | |
| documentBuilder | back to summary |
|---|---|
| private final DocumentBuilder documentBuilder | |
| entityResolver | back to summary |
|---|---|
| private EntityResolver entityResolver Used to resolve references to other schema documents. | |
| errorReceiver | back to summary |
|---|---|
| private ErrorReceiver errorReceiver Errors encountered during the parsing will be sent to this object. | |
| locatorTable | back to summary |
|---|---|
| public final LocatorTable locatorTable Stores location information for all the trees in this forest. | |
| logic | back to summary |
|---|---|
| protected final InternalizationLogic logic Schema language dependent part of the processing. | |
| options | back to summary |
|---|---|
| private final Options options | |
| outerMostBindings | back to summary |
|---|---|
| public final Set<Element> outerMostBindings Stores all the outer-most | |
| parserFactory | back to summary |
|---|---|
| private final SAXParserFactory parserFactory | |
| rootDocuments | back to summary |
|---|---|
| private final Set<String> rootDocuments To correctly feed documents to a schema parser, we need to remember which documents (of the forest) were given as the root documents, and which of them are read as included/imported documents. Set of system ids as strings. | |
| DOMForest | back to summary |
|---|---|
| public DOMForest(SAXParserFactory parserFactory, DocumentBuilder documentBuilder, InternalizationLogic logic) | |
| DOMForest | back to summary |
|---|---|
| public DOMForest(InternalizationLogic logic, Options opt) | |
| checkSchemaCorrectness | back to summary |
|---|---|
| public boolean checkSchemaCorrectness(ErrorReceiver errorHandler) Checks the correctness of the XML Schema documents and return true if it's OK.
This method performs a weaker version of the tests where error messages
are provided without line number information. So whenever possible
use
| |
| createParser | back to summary |
|---|---|
| public XMLParser createParser() Creates | |
| createSAXSource | back to summary |
|---|---|
| public SAXSource createSAXSource(String systemId) Creates a
| |
| dump | back to summary |
|---|---|
| public void dump(OutputStream out) throws IOException Dumps the contents of the forest to the specified stream. This is a debug method. As such, error handling is sloppy. | |
| get | back to summary |
|---|---|
| public Document get(String systemId) Gets the DOM tree associated with the specified system ID, or null if none is found. | |
| getEntityResolver | back to summary |
|---|---|
| public EntityResolver getEntityResolver() | |
| getErrorHandler | back to summary |
|---|---|
| public ErrorReceiver getErrorHandler() | |
| getOneDocument | back to summary |
|---|---|
| public Document getOneDocument() Picks one document at random and returns it. | |
| getParserHandler | back to summary |
|---|---|
| private ContentHandler getParserHandler(Document dom) Returns a The client of this class can feed SAX events into the handler to parse a document into this DOM forest. This version requires that the DOM object to be created and registered to the map beforehand. | |
| getParserHandler | back to summary |
|---|---|
| public DOMForest. Returns a The client of this class can feed SAX events into the handler to parse a document into this DOM forest. | |
| getPath | back to summary |
|---|---|
| private String getPath(String key) Strips off the leading 'file:///' portion from an URL. | |
| getRootDocuments | back to summary |
|---|---|
| public Set Returns a read-only set of root document system IDs. | |
| getSystemId | back to summary |
|---|---|
| public String getSystemId(Document dom) Gets the system ID from which the given DOM is parsed. Poor-man's base URI. | |
| listDocuments | back to summary |
|---|---|
| public Document[] listDocuments() Gets all the parsed documents. | |
| listSystemIDs | back to summary |
|---|---|
| public String[] listSystemIDs() Gets all the system IDs of the documents. | |
| parse | back to summary |
|---|---|
| public Document parse(InputSource source, boolean root) throws SAXException | |
| parse | back to summary |
|---|---|
| public Document parse(String systemId, boolean root) throws SAXException, IOException Parses an XML at the given location ( and XMLs referenced by it) into DOM trees and stores them to this forest.
| |
| parse | back to summary |
|---|---|
| public Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException Parses the given document and add it to the DOM forest.
| |
| parse | back to summary |
|---|---|
| public Document parse(String systemId, XMLStreamReader parser, boolean root) throws XMLStreamException | |
| setEntityResolver | back to summary |
|---|---|
| public void setEntityResolver(EntityResolver entityResolver) | |
| setErrorHandler | back to summary |
|---|---|
| public void setErrorHandler(ErrorReceiver errorHandler) | |
| transform | back to summary |
|---|---|
| public SCDBasedBindingSet transform(boolean enableSCD) Performs internalization. This method should be called only once, only after all the schemas are parsed.
| |
| weakSchemaCorrectnessCheck | back to summary |
|---|---|
| public void weakSchemaCorrectnessCheck(SchemaFactory sf) Performs the schema correctness check by using JAXP 1.3.
This is "weak", because We should eventually fix JAXP (and Xerces), but meanwhile this weaker and potentially wrong correctness check is still better than nothing when used inside JAX-WS (JAXB CLI and Ant does a better job of checking this.)
To receive errors, use | |
| Modifier and Type | Method and Description |
|---|---|
| public Document |
| getDocument | back to summary |
|---|---|
| public Document getDocument() Gets the DOM that was built. | |
| Access | Constructor and Description |
|---|---|
| private |
| HandlerImpl | back to summary |
|---|---|
| private HandlerImpl() | |