站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jaxrpc API Documentation 英文版文档

SymbolTable (JAXRPC API) - JBoss 4.0.1 sp1 jaxrpc API Documentation 英文版文档


org.apache.axis.wsdl.symbolTable
Class SymbolTable

java.lang.Object
  extended byorg.apache.axis.wsdl.symbolTable.SymbolTable

public class SymbolTable
extends Object

This class represents a table of all of the top-level symbols from a set of WSDL Definitions and DOM Documents: XML types; WSDL messages, portTypes, bindings, and services.

This symbolTable contains entries of the form where key is of type QName and value is of type Vector. The Vector's elements are all of the objects that have the given QName. This is necessary since names aren't unique among the WSDL types. message, portType, binding, service, could all have the same QName and are differentiated merely by type. SymbolTable contains type-specific getters to bypass the Vector layer: public PortTypeEntry getPortTypeEntry(QName name), etc.


Field Summary
static String ANON_TOKEN
           
protected  Map node2ExtensionBase
          cache of nodes -> base types for complexTypes.
 
Constructor Summary
SymbolTable(BaseTypeMapping btm, boolean addImports, boolean verbose, boolean nowrap)
          Construct a symbol table with the given Namespaces.
 
Method Summary
protected  void add(String context, javax.wsdl.Definition def, Document doc)
          Add the given Definition and Document information to the symbol table (including imported symbols), populating it with SymTabEntries for each of the top-level symbols.
 void dump(PrintStream out)
          Dump the contents of the symbol table.
protected  void ensureOperationMessageValid(javax.wsdl.Message message)
          ensures that a message in a <input>, <output>, or <fault> element in an <operation> element is valid.
protected  void ensureOperationsOfPortTypeValid(javax.wsdl.PortType portType)
          ensures that an an element <portType> is valid.
protected  void ensureOperationValid(javax.wsdl.Operation operation)
          ensures that an an element <operation> within an element <portType> is valid.
protected  boolean existsPortWithName(javax.xml.namespace.QName name)
          checks whether there exists a WSDL port with a given name in the current symbol table
 SymTabEntry get(javax.xml.namespace.QName qname, Class cls)
          Get the entry with the given QName of the given class.
 BindingEntry getBindingEntry(javax.xml.namespace.QName qname)
          Get the BindingEntry with the given QName.
 javax.wsdl.Definition getDefinition()
          Get the Definition.
 Element getElement(javax.xml.namespace.QName qname)
          Get the Element TypeEntry with the given QName.
 Map getElementIndex()
          Return an unmodifiable map of qnames -> Elements in the symbol table.
 HashMap getHashMap()
          Get the raw symbol table HashMap.
 MessageEntry getMessageEntry(javax.xml.namespace.QName qname)
          Get the MessageEntry with the given QName.
 Parameters getOperationParameters(javax.wsdl.Operation operation, String namespace, BindingEntry bindingEntry)
          For the given operation, this method returns the parameter info conveniently collated.
 void getParametersFromParts(Vector v, Collection parts, boolean literal, String opName, BindingEntry bindingEntry)
          This method returns a vector containing Parameters which represent each Part (shouldn't we call these "Parts" or something?)
 PortTypeEntry getPortTypeEntry(javax.xml.namespace.QName qname)
          Get the PortTypeEntry with the given QName.
 ServiceEntry getServiceEntry(javax.xml.namespace.QName qname)
          Get the ServiceEntry with the given QName.
 Vector getSymbols(javax.xml.namespace.QName qname)
          Get the list of entries with the given QName.
 Type getType(javax.xml.namespace.QName qname)
          Get the Type TypeEntry with the given QName.
 TypeEntry getTypeEntry(javax.xml.namespace.QName qname, boolean wantElementType)
          Get the type entry for the given qname.
 int getTypeEntryCount()
          Return the count of TypeEntries in the symbol table.
 Map getTypeIndex()
          Return an unmodifiable map of qnames -> Elements in the symbol table.
 Vector getTypes()
          Deprecated. use specialized get{Element,Type}Index() methods instead
 String getWSDLURI()
          Get the WSDL URI.
 boolean isKnownNamespace(String namespace)
          Check if this is a known namespace (soap-enc or schema xsd or schema xsi or xml)
 boolean isWrapped()
          Are we wrapping literal soap body elements.
 void populate(String uri)
          Call this method if you have a uri for the WSDL document
 void populate(String context, Document doc)
          Call this method if your WSDL document has already been parsed as an XML DOM document.
 void populate(String uri, String username, String password)
           
 void populateTypes(URL context, Document doc)
          Populate the symbol table with all of the Types from the Document.
 void setWrapped(boolean wrapped)
          Turn on/off element wrapping for literal soap body's.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node2ExtensionBase

protected final Map node2ExtensionBase
cache of nodes -> base types for complexTypes. The cache is built on nodes because multiple TypeEntry objects may use the same node.


ANON_TOKEN

public static final String ANON_TOKEN
See Also:
Constant Field Values
Constructor Detail

SymbolTable

public SymbolTable(BaseTypeMapping btm,
                   boolean addImports,
                   boolean verbose,
                   boolean nowrap)
Construct a symbol table with the given Namespaces.

Method Detail

getHashMap

public HashMap getHashMap()
Get the raw symbol table HashMap.


getSymbols

public Vector getSymbols(javax.xml.namespace.QName qname)
Get the list of entries with the given QName. Since symbols can share QNames, this list is necessary. This list will not contain any more than one element of any given SymTabEntry.


get

public SymTabEntry get(javax.xml.namespace.QName qname,
                       Class cls)
Get the entry with the given QName of the given class. If it does not exist, return null.


getTypeEntry

public TypeEntry getTypeEntry(javax.xml.namespace.QName qname,
                              boolean wantElementType)
Get the type entry for the given qname.

Parameters:
qname -
wantElementType - boolean that indicates type or element (for type= or ref=)

getType

public Type getType(javax.xml.namespace.QName qname)
Get the Type TypeEntry with the given QName. If it doesn't exist, return null.


getElement

public Element getElement(javax.xml.namespace.QName qname)
Get the Element TypeEntry with the given QName. If it doesn't exist, return null.


getMessageEntry

public MessageEntry getMessageEntry(javax.xml.namespace.QName qname)
Get the MessageEntry with the given QName. If it doesn't exist, return null.


getPortTypeEntry

public PortTypeEntry getPortTypeEntry(javax.xml.namespace.QName qname)
Get the PortTypeEntry with the given QName. If it doesn't exist, return null.


getBindingEntry

public BindingEntry getBindingEntry(javax.xml.namespace.QName qname)
Get the BindingEntry with the given QName. If it doesn't exist, return null.


getServiceEntry

public ServiceEntry getServiceEntry(javax.xml.namespace.QName qname)
Get the ServiceEntry with the given QName. If it doesn't exist, return null.


getTypes

public Vector getTypes()
Deprecated. use specialized get{Element,Type}Index() methods instead

Get the list of all the XML schema types in the symbol table. In other words, all entries that are instances of TypeEntry.


getElementIndex

public Map getElementIndex()
Return an unmodifiable map of qnames -> Elements in the symbol table.

Returns:
an unmodifiable Map value

getTypeIndex

public Map getTypeIndex()
Return an unmodifiable map of qnames -> Elements in the symbol table.

Returns:
an unmodifiable Map value

getTypeEntryCount

public int getTypeEntryCount()
Return the count of TypeEntries in the symbol table.

Returns:
an int value

getDefinition

public javax.wsdl.Definition getDefinition()
Get the Definition. The definition is null until populate is called.


getWSDLURI

public String getWSDLURI()
Get the WSDL URI. The WSDL URI is null until populate is called, and ONLY if a WSDL URI is provided.


isWrapped

public boolean isWrapped()
Are we wrapping literal soap body elements.


setWrapped

public void setWrapped(boolean wrapped)
Turn on/off element wrapping for literal soap body's.


dump

public void dump(PrintStream out)
Dump the contents of the symbol table. For debugging purposes only.


populate

public void populate(String uri)
              throws IOException,
                     javax.wsdl.WSDLException,
                     SAXException,
                     ParserConfigurationException
Call this method if you have a uri for the WSDL document

Parameters:
uri - wsdlURI the location of the WSDL file.
Throws:
IOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException

populate

public void populate(String uri,
                     String username,
                     String password)
              throws IOException,
                     javax.wsdl.WSDLException,
                     SAXException,
                     ParserConfigurationException
Throws:
IOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException

populate

public void populate(String context,
                     Document doc)
              throws IOException,
                     SAXException,
                     javax.wsdl.WSDLException,
                     ParserConfigurationException
Call this method if your WSDL document has already been parsed as an XML DOM document.

Parameters:
context - context This is directory context for the Document. If the Document were from file "/x/y/z.wsdl" then the context could be "/x/y" (even "/x/y/z.wsdl" would work). If context is null, then the context becomes the current directory.
doc - doc This is the XML Document containing the WSDL.
Throws:
IOException
SAXException
javax.wsdl.WSDLException
ParserConfigurationException

add

protected void add(String context,
                   javax.wsdl.Definition def,
                   Document doc)
            throws IOException,
                   SAXException,
                   javax.wsdl.WSDLException,
                   ParserConfigurationException
Add the given Definition and Document information to the symbol table (including imported symbols), populating it with SymTabEntries for each of the top-level symbols. When the symbol table has been populated, iterate through it, setting the isReferenced flag appropriately for each entry.

Throws:
IOException
SAXException
javax.wsdl.WSDLException
ParserConfigurationException

isKnownNamespace

public boolean isKnownNamespace(String namespace)
Check if this is a known namespace (soap-enc or schema xsd or schema xsi or xml)

Parameters:
namespace -
Returns:
true if this is a know namespace.

populateTypes

public void populateTypes(URL context,
                          Document doc)
                   throws IOException,
                          SAXException,
                          javax.wsdl.WSDLException,
                          ParserConfigurationException
Populate the symbol table with all of the Types from the Document.

Throws:
IOException
SAXException
javax.wsdl.WSDLException
ParserConfigurationException

ensureOperationMessageValid

protected void ensureOperationMessageValid(javax.wsdl.Message message)
                                    throws IOException
ensures that a message in a <input>, <output>, or <fault> element in an <operation> element is valid. In particular, ensures that
  1. an attribute message is present (according to the XML Schema for WSDL 1.1 message is required

  2. the value of attribute message (a QName) refers to an already defined message

Note: this method should throw a javax.wsdl.WSDLException rather than a java.io.IOException

Parameters:
message - the message object
Throws:
IOException - thrown, if the message is not valid

ensureOperationValid

protected void ensureOperationValid(javax.wsdl.Operation operation)
                             throws IOException
ensures that an an element <operation> within an element <portType> is valid. Throws an exception if the operation is not valid.

Note: this method should throw a javax.wsdl.WSDLException rather than a java.io.IOException

Parameters:
operation - the operation element
Throws:
IOException - thrown, if the element is not valid.
IllegalArgumentException - thrown, if operation is null

ensureOperationsOfPortTypeValid

protected void ensureOperationsOfPortTypeValid(javax.wsdl.PortType portType)
                                        throws IOException
ensures that an an element <portType> is valid. Throws an exception if the portType is not valid.

Note: this method should throw a javax.wsdl.WSDLException rather than a java.io.IOException

Parameters:
portType - the portType element
Throws:
IOException - thrown, if the element is not valid.
IllegalArgumentException - thrown, if operation is null

getOperationParameters

public Parameters getOperationParameters(javax.wsdl.Operation operation,
                                         String namespace,
                                         BindingEntry bindingEntry)
                                  throws IOException
For the given operation, this method returns the parameter info conveniently collated. There is a bit of processing that is needed to write the interface, stub, and skeleton. Rather than do that processing 3 times, it is done once, here, and stored in the Parameters object.

Throws:
IOException

getParametersFromParts

public void getParametersFromParts(Vector v,
                                   Collection parts,
                                   boolean literal,
                                   String opName,
                                   BindingEntry bindingEntry)
                            throws IOException
This method returns a vector containing Parameters which represent each Part (shouldn't we call these "Parts" or something?)

Throws:
IOException

existsPortWithName

protected boolean existsPortWithName(javax.xml.namespace.QName name)
checks whether there exists a WSDL port with a given name in the current symbol table

Parameters:
name - the QName of the port. Note: only the local part of the qname is relevant, since port names are not qualified with a namespace. They are of type nmtoken in WSDL 1.1 and of type ncname in WSDL 1.2
Returns:
true, if there is a port element with the specified name; false, otherwise


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.