com.sun.tools.ws.wsdl.parser
Class DOMForest

java.lang.Object
  extended by com.sun.tools.ws.wsdl.parser.DOMForest
Direct Known Subclasses:
MetadataFinder

public class DOMForest
extends java.lang.Object

Author:
Vivek Pandey

Nested Class Summary
static interface DOMForest.Handler
           
 
Field Summary
protected  java.util.Map<java.lang.String,org.w3c.dom.Document> core
          actual data storage map<SystemId,Document>.
protected  org.xml.sax.EntityResolver entityResolver
           
protected  ErrorReceiver errorReceiver
           
protected  java.util.Set<java.lang.String> externalReferences
          Contains wsdl:import(s)
protected  java.util.List<org.w3c.dom.Element> inlinedSchemaElements
          inlined schema elements inside wsdl:type section
 LocatorTable locatorTable
          Stores location information for all the trees in this forest.
protected  InternalizationLogic logic
          Schema language dependent part of the processing.
protected  WsimportOptions options
           
 java.util.Set<org.w3c.dom.Element> outerMostBindings
          Stores all the outer-most <jaxb:bindings> customizations.
protected  java.util.Map<java.lang.String,java.lang.String> resolvedCache
           
protected  java.util.Set<java.lang.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.
 
Constructor Summary
DOMForest(InternalizationLogic logic, org.xml.sax.EntityResolver entityResolver, WsimportOptions options, ErrorReceiver errReceiver)
           
 
Method Summary
 void addExternalReferences(java.lang.String ref)
           
 void dump(java.io.OutputStream out)
          Dumps the contents of the forest to the specified stream.
 org.w3c.dom.Document get(java.lang.String systemId)
          Gets the DOM tree associated with the specified system ID, or null if none is found.
 java.util.Set<java.lang.String> getExternalReferences()
           
 java.lang.String getFirstRootDocument()
          Gets the first one (which is more or less random) in rootDocuments.
 java.util.List<org.w3c.dom.Element> getInlinedSchemaElement()
           
 java.util.Map<java.lang.String,java.lang.String> getReferencedEntityMap()
           
 java.util.Set<java.lang.String> getRootDocuments()
           
 java.lang.String getSystemId(org.w3c.dom.Document dom)
          Gets the system ID from which the given DOM is parsed.
 java.lang.String[] listSystemIDs()
          Gets all the system IDs of the documents.
 org.w3c.dom.Document parse(org.xml.sax.InputSource source, boolean root)
           
 org.w3c.dom.Document parse(java.lang.String systemId, boolean root)
          Parses an XML at the given location ( and XMLs referenced by it) into DOM trees and stores them to this forest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootDocuments

protected final java.util.Set<java.lang.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.


externalReferences

protected final java.util.Set<java.lang.String> externalReferences
Contains wsdl:import(s)


core

protected final java.util.Map<java.lang.String,org.w3c.dom.Document> core
actual data storage map<SystemId,Document>.


errorReceiver

protected final ErrorReceiver errorReceiver

inlinedSchemaElements

protected final java.util.List<org.w3c.dom.Element> inlinedSchemaElements
inlined schema elements inside wsdl:type section


locatorTable

public final LocatorTable locatorTable
Stores location information for all the trees in this forest.


entityResolver

protected final org.xml.sax.EntityResolver entityResolver

outerMostBindings

public final java.util.Set<org.w3c.dom.Element> outerMostBindings
Stores all the outer-most <jaxb:bindings> customizations.


logic

protected final InternalizationLogic logic
Schema language dependent part of the processing.


options

protected final WsimportOptions options

resolvedCache

protected java.util.Map<java.lang.String,java.lang.String> resolvedCache
Constructor Detail

DOMForest

public DOMForest(InternalizationLogic logic,
                 @NotNull
                 org.xml.sax.EntityResolver entityResolver,
                 WsimportOptions options,
                 ErrorReceiver errReceiver)
Method Detail

getInlinedSchemaElement

public java.util.List<org.w3c.dom.Element> getInlinedSchemaElement()

parse

@NotNull
public org.w3c.dom.Document parse(org.xml.sax.InputSource source,
                                          boolean root)
                           throws org.xml.sax.SAXException,
                                  java.io.IOException
Throws:
org.xml.sax.SAXException
java.io.IOException

parse

public org.w3c.dom.Document parse(java.lang.String systemId,
                                  boolean root)
                           throws org.xml.sax.SAXException,
                                  java.io.IOException
Parses an XML at the given location ( and XMLs referenced by it) into DOM trees and stores them to this forest.

Returns:
the parsed DOM document object.
Throws:
org.xml.sax.SAXException
java.io.IOException

getReferencedEntityMap

public java.util.Map<java.lang.String,java.lang.String> getReferencedEntityMap()

addExternalReferences

public void addExternalReferences(java.lang.String ref)

getExternalReferences

public java.util.Set<java.lang.String> getExternalReferences()

get

public org.w3c.dom.Document get(java.lang.String systemId)
Gets the DOM tree associated with the specified system ID, or null if none is found.


listSystemIDs

public java.lang.String[] listSystemIDs()
Gets all the system IDs of the documents.


getSystemId

public java.lang.String getSystemId(org.w3c.dom.Document dom)
Gets the system ID from which the given DOM is parsed.

Poor-man's base URI.


getFirstRootDocument

public java.lang.String getFirstRootDocument()
Gets the first one (which is more or less random) in rootDocuments.


getRootDocuments

public java.util.Set<java.lang.String> getRootDocuments()

dump

public void dump(java.io.OutputStream out)
          throws java.io.IOException
Dumps the contents of the forest to the specified stream.

This is a debug method. As such, error handling is sloppy.

Throws:
java.io.IOException


Copyright © 2005-2013 Oracle Corporation. All Rights Reserved.