| java.lang.Object com.sun.tools.xjc.reader.internalizer.DOMForest
DOMForest | final public class DOMForest (Code) | | Builds a DOM forest and maintains association from
system IDs to DOM trees.
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.)
author: Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) |
locatorTable | final public LocatorTable locatorTable(Code) | | Stores location information for all the trees in this forest.
|
outerMostBindings | final public Set<Element> outerMostBindings(Code) | | Stores all the outer-most <jaxb:bindings> customizations.
|
checkSchemaCorrectness | public boolean checkSchemaCorrectness(ErrorReceiver errorHandler)(Code) | | 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
SchemaConstraintChecker .
See Also: SchemaConstraintChecker |
createParser | public XMLParser createParser()(Code) | | Creates
XMLParser for XSOM which reads documents from
this DOMForest rather than doing a fresh parse.
The net effect is that XSOM will read transformed XML Schemas
instead of the original documents.
|
createSAXSource | public SAXSource createSAXSource(String systemId)(Code) | | Creates a
SAXSource that, when parsed, reads from this
DOMForest (instead of parsing the original source identified by the system ID.)
|
dump | public void dump(OutputStream out) throws IOException(Code) | | Dumps the contents of the forest to the specified stream.
This is a debug method. As such, error handling is sloppy.
|
get | public Document get(String systemId)(Code) | | Gets the DOM tree associated with the specified system ID,
or null if none is found.
|
getOneDocument | public Document getOneDocument()(Code) | | Picks one document at random and returns it.
|
getParserHandler | public Handler getParserHandler(String systemId, boolean root)(Code) | | Returns a
ContentHandler to feed SAX events into.
The client of this class can feed SAX events into the handler
to parse a document into this DOM forest.
|
getRootDocuments | public Set<String> getRootDocuments()(Code) | | Returns a read-only set of root document system IDs.
|
getSystemId | public String getSystemId(Document dom)(Code) | | Gets the system ID from which the given DOM is parsed.
Poor-man's base URI.
|
listDocuments | public Document[] listDocuments()(Code) | | Gets all the parsed documents.
|
listSystemIDs | public String[] listSystemIDs()(Code) | | Gets all the system IDs of the documents.
|
parse | public Document parse(String systemId, boolean root) throws SAXException, IOException(Code) | | Parses an XML at the given location (
and XMLs referenced by it) into DOM trees
and stores them to this forest.
the parsed DOM document object. |
parse | public Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException(Code) | | Parses the given document and add it to the DOM forest.
null if there was a parse error. otherwise non-null. |
transform | public SCDBasedBindingSet transform(boolean enableSCD)(Code) | | Performs internalization.
This method should be called only once, only after all the
schemas are parsed.
the returned bindings need to be applied after schemacomponents are built. |
weakSchemaCorrectnessCheck | public void weakSchemaCorrectnessCheck(SchemaFactory sf)(Code) | | Performs the schema correctness check by using JAXP 1.3.
This is "weak", because
SchemaFactory.newSchema(Source[]) doesn't handle inclusions very correctly (it ends up parsing it
from its original source, not in this tree), and because
it doesn't handle two documents for the same namespace very
well.
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
SchemaFactory.setErrorHandler(ErrorHandler) .
|
|
|