org.apache.axis.wsdl.symbolTable

Class TypeEntry

Implemented Interfaces:
Serializable
Known Direct Subclasses:
Element, Type

public abstract class TypeEntry
extends SymTabEntry
implements Serializable

This class represents a wsdl types entry that is supported by the WSDL2Java emitter. A TypeEntry has a QName representing its XML name and a name, which in the WSDL2Java back end is its full java name. The TypeEntry may also have a Node, which locates the definition of the emit type in the xml. A TypeEntry object extends SymTabEntry and is built by the SymbolTable class for each supported root complexType, simpleType, and elements that are defined or encountered.

SymTabEntry | TypeEntry / \ Type Element | | (BaseType, (DefinedElement, CollectionType CollectionElement, DefinedType, UndefinedElement) UndefinedType)

UndefinedType and UndefinedElement are placeholders when the real type or element is not encountered yet. Both of these implement the Undefined interface.

A TypeEntry whose java (or other language) name depends on an Undefined type, will have its name initialization deferred until the Undefined type is replaced with a defined type. The updateUndefined() method is invoked by the UndefinedDelegate to update the information.

Each TypeEntry whose language name depends on another TypeEntry will have the refType field set. For example: The TypeEntry for "foo" will have a refType set to the TypeEntry of "bar".

Another Example: The TypeEntry for "hobbyArray" will have a refType that locates the TypeEntry for xsd:string and the dims field will be "[]"

Author:
Rich Scheuerle (scheu@us.ibm.com)

Field Summary

protected QName
componentType
protected Vector
containedAttributes
contained attributes in the schema's type definition
protected Vector
containedElements
contained elements in the schema's type definition
protected String
dims
Field dims
protected boolean
isBaseType
Field isBaseType
protected boolean
isSimpleType
Field isSimpleType
protected QName
itemQName
If this TypeEntry represents an array with elements inside a "wrapper" this field can optionally change the inner QName (default is ).
protected Node
node
Field node
protected boolean
onlyLiteralReference
Field onlyLiteralReference
protected TypeEntry
refType
Field refType
protected HashSet
types
Field types
protected boolean
undefined
Field undefined
protected boolean
underlTypeNillable

Fields inherited from class org.apache.axis.wsdl.symbolTable.SymTabEntry

name, qname

Constructor Summary

TypeEntry(QName pqName)
Create a TypeEntry object for an xml construct name that represents a base type
TypeEntry(QName pqName, Node pNode)
Create a TypeEntry object for an xml construct that is not a base type
TypeEntry(QName pqName, TypeEntry refType, Node pNode, String dims)
Create a TypeEntry object for an xml construct that references another type.

Method Summary

String
getBaseType()
Returns the Base Type Name.
QName
getComponentType()
Return the QName of the component if this is an array type
Vector
getContainedAttributes()
Vector
getContainedElements()
String
getDimensions()
Return the dimensions of this type, which can be 0 or more "[]".
QName
getItemQName()
HashSet
getNestedTypes(SymbolTable symbolTable, boolean derivedFlag)
This method returns a set of all the nested types.
Node
getNode()
Query the node for this type.
TypeEntry
getRefType()
If this type references another type, return that type, otherwise return null.
protected TypeEntry
getUndefinedTypeRef()
getUndefinedTypeRef returns the Undefined TypeEntry that this entry depends on or NULL.
boolean
getUnderlTypeNillable()
Return whether the underlying type is nillable if this is an array type.
boolean
isBaseType()
Method isBaseType
boolean
isOnlyLiteralReferenced()
Is this type references ONLY as a literal type? If a binding's message's soapBody says: use="literal", then a type is referenced literally.
boolean
isSimpleType()
Method isSimpleType
void
setBaseType(boolean baseType)
Method setBaseType
void
setComponentType(QName componentType)
Set the QName of the component if this is an array type
void
setContainedAttributes(Vector containedAttributes)
void
setContainedElements(Vector containedElements)
void
setItemQName(QName itemQName)
void
setOnlyLiteralReference(boolean set)
Set the isOnlyLiteralReference flag.
void
setRefType(TypeEntry refType)
Method setRefType
void
setSimpleType(boolean simpleType)
Method setSimpleType
void
setUnderlTypeNillable(boolean underlTypeNillable)
Set the boolean indicating whether underlying type of array is nillable.
String
toString()
Get string representation.
protected String
toString(String indent)
Get string representation with indentation
protected boolean
updateUndefined(TypeEntry oldRef, TypeEntry newRef)
UpdateUndefined is called when the ref TypeEntry is finally known.

Methods inherited from class org.apache.axis.wsdl.symbolTable.SymTabEntry

getDynamicVar, getName, getQName, isReferenced, setDynamicVar, setIsReferenced, setName, toString, toString

Field Details

componentType

protected QName componentType

containedAttributes

protected Vector containedAttributes
contained attributes in the schema's type definition

containedElements

protected Vector containedElements
contained elements in the schema's type definition

dims

protected String dims
Field dims

isBaseType

protected boolean isBaseType
Field isBaseType

isSimpleType

protected boolean isSimpleType
Field isSimpleType

itemQName

protected QName itemQName
If this TypeEntry represents an array with elements inside a "wrapper" this field can optionally change the inner QName (default is ).

node

protected Node node
Field node

onlyLiteralReference

protected boolean onlyLiteralReference
Field onlyLiteralReference

refType

protected TypeEntry refType
Field refType

types

protected HashSet types
Field types

undefined

protected boolean undefined
Field undefined

underlTypeNillable

protected boolean underlTypeNillable

Constructor Details

TypeEntry

protected TypeEntry(QName pqName)
Create a TypeEntry object for an xml construct name that represents a base type
Parameters:
pqName -

TypeEntry

protected TypeEntry(QName pqName,
                    Node pNode)
Create a TypeEntry object for an xml construct that is not a base type
Parameters:
pqName -
pNode -

TypeEntry

protected TypeEntry(QName pqName,
                    TypeEntry refType,
                    Node pNode,
                    String dims)
Create a TypeEntry object for an xml construct that references another type. Defer processing until refType is known.
Parameters:
pqName -
refType -
pNode -
dims -

Method Details

getBaseType

public String getBaseType()
Returns the Base Type Name. For example if the Type represents a schema integer, "int" is returned. If this is a user defined type, null is returned.
Returns:

getComponentType

public QName getComponentType()
Return the QName of the component if this is an array type
Returns:
QName of array elements or null

getContainedAttributes

public Vector getContainedAttributes()
Returns:
Returns the containedAttributes.

getContainedElements

public Vector getContainedElements()
Returns:
Returns the containedElements.

getDimensions

public String getDimensions()
Return the dimensions of this type, which can be 0 or more "[]".
Returns:

getItemQName

public QName getItemQName()

getNestedTypes

public HashSet getNestedTypes(SymbolTable symbolTable,
                              boolean derivedFlag)
This method returns a set of all the nested types. Nested types are types declared within this TypeEntry (or descendents) plus any extended types and the extended type nested types The elements of the returned HashSet are Types.
Parameters:
symbolTable - is the symbolTable
derivedFlag - should be set if all dependendent derived types should also be returned.
Returns:

getNode

public Node getNode()
Query the node for this type.
Returns:

getRefType

public TypeEntry getRefType()
If this type references another type, return that type, otherwise return null.
Returns:

getUndefinedTypeRef

protected TypeEntry getUndefinedTypeRef()
getUndefinedTypeRef returns the Undefined TypeEntry that this entry depends on or NULL.
Returns:

getUnderlTypeNillable

public boolean getUnderlTypeNillable()
Return whether the underlying type is nillable if this is an array type.
Returns:
true if it is an array and nillable

isBaseType

public boolean isBaseType()
Method isBaseType
Returns:

isOnlyLiteralReferenced

public boolean isOnlyLiteralReferenced()
Is this type references ONLY as a literal type? If a binding's message's soapBody says: use="literal", then a type is referenced literally. Note that that type's contained types (ie., an address contains a phone#) are not referenced literally. Since a type that is ONLY referenced as a literal may cause a generator to act differently (like WSDL2Java), this extra reference distinction is needed.
Returns:

isSimpleType

public boolean isSimpleType()
Method isSimpleType
Returns:

setBaseType

public void setBaseType(boolean baseType)
Method setBaseType
Parameters:
baseType -

setComponentType

public void setComponentType(QName componentType)
Set the QName of the component if this is an array type

setContainedAttributes

public void setContainedAttributes(Vector containedAttributes)
Parameters:
containedAttributes - The containedAttributes to set.

setContainedElements

public void setContainedElements(Vector containedElements)
Parameters:
containedElements - The containedElements to set.

setItemQName

public void setItemQName(QName itemQName)

setOnlyLiteralReference

public void setOnlyLiteralReference(boolean set)
Set the isOnlyLiteralReference flag.
Parameters:
set -

setRefType

public void setRefType(TypeEntry refType)
Method setRefType
Parameters:
refType -

setSimpleType

public void setSimpleType(boolean simpleType)
Method setSimpleType
Parameters:
simpleType -

setUnderlTypeNillable

public void setUnderlTypeNillable(boolean underlTypeNillable)
Set the boolean indicating whether underlying type of array is nillable.

toString

public String toString()
Get string representation.
Overrides:
toString in interface SymTabEntry
Returns:

toString

protected String toString(String indent)
Get string representation with indentation
Overrides:
toString in interface SymTabEntry
Parameters:
indent -
Returns:

updateUndefined

protected boolean updateUndefined(TypeEntry oldRef,
                                  TypeEntry newRef)
            throws IOException
UpdateUndefined is called when the ref TypeEntry is finally known.
Parameters:
oldRef - The TypeEntry representing the Undefined TypeEntry
newRef - The replacement TypeEntry
Returns:
true if TypeEntry is changed in any way.

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.