Package org.apache.axis.wsdl.symbolTable
Class SchemaUtils
java.lang.Object
org.apache.axis.wsdl.symbolTable.SchemaUtils
This class contains static utility methods specifically for schema type queries.
- Author:
- Rich Scheuerle (scheu@us.ibm.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetAnnotationDocumentation(Node typeNode) Returns the complete text of the child xsd:annotation/xsd:documentation element from the provided node.static QNamegetArrayComponentQName(Node node, IntHolder dims, BooleanHolder underlTypeNillable, QNameHolder itemQName, BooleanHolder forElement, SymbolTable symbolTable) If the specified node represents an array encoding of one of the following forms, then return the qname repesenting the element type of the array.static QNamegetAttributeAnonQName(Node node) Returns the WSDL2Java QName for the anonymous type of the attribute or null.static TypeEntrygetBaseType(TypeEntry type, SymbolTable symbolTable) Returns the base type of a given type with its symbol table.static QNamegetCollectionComponentQName(Node node, QNameHolder itemQName, BooleanHolder forElement, SymbolTable symbolTable) If the specified node represents an element that references a collection then return the qname repesenting the component of the collection.static TypeEntrygetComplexElementExtensionBase(Node node, SymbolTable symbolTable) If the specified node represents a supported JAX-RPC complexType/element which extends another complexType.static TypeEntrygetComplexElementRestrictionBase(Node node, SymbolTable symbolTable) Look for the base type of node iff node is a complex type that has been derived by restriction; otherwise return null.static VectorgetContainedAttributeTypes(Node node, SymbolTable symbolTable) Return the attribute names and types if any in the node The even indices are the attribute types (TypeEntry) and the odd indices are the corresponding names (Strings).static VectorgetContainedElementDeclarations(Node node, SymbolTable symbolTable) If the specified node represents a supported JAX-RPC complexType or simpleType, a Vector is returned which contains ElementDecls for the child element names.static QName[]getContainedSimpleTypes(Node node) Method getContainedSimpleTypesstatic QNamegetElementAnonQName(Node node) Returns the WSDL2Java QName for the anonymous type of the element or null.static QNamegetListItemType(Node node) Returns the value of itemType attribute of invalid input: '<'xsd:list> in invalid input: '<'xsd:simpleType>static NodegetListNode(Node node) static NodeReturns the contained restriction or extension node underneath the specified node.static QNamegetSimpleTypeBase(Node node) If the specified node represents a 'normal' non-enumeration simpleType, the QName of the simpleType base is returned.static StringgetTextByPath(Node root, String path) Returns all textual nodes of a subnode defined by a parent node and a path of element names to that subnode.static NodegetUnionNode(Node node) static booleanisListWithItemType(Node node) Returns whether the specified node represents a invalid input: '<'xsd:simpleType> with a nested invalid input: '<'xsd:list itemType="...">.static booleanThis method checks mixed=true attribute is set either on complexType or complexContent element.static booleanisSimpleSchemaType(QName qname) Determine if a QName is a simple XML Schema typestatic booleanIf the specified node is a simple type or contains simpleContent, return truestatic booleanisSimpleTypeWithUnion(Node node) static booleanisWrappedType(Node node) This method checks out if the given node satisfies the 3rd condition of the "wrapper" style: such an element (a wrapper) must be of a complex type defined using the xsd:sequence compositor and containing only elements declarations.
-
Constructor Details
-
SchemaUtils
public SchemaUtils()
-
-
Method Details
-
isMixed
This method checks mixed=true attribute is set either on complexType or complexContent element. -
getUnionNode
-
getListNode
-
isSimpleTypeWithUnion
-
isWrappedType
This method checks out if the given node satisfies the 3rd condition of the "wrapper" style: such an element (a wrapper) must be of a complex type defined using the xsd:sequence compositor and containing only elements declarations. (excerpt from JAX-RPC spec 1.1 Maintenanace Review 2 Chapter 6 Section 4.1.)- Parameters:
node-- Returns:
-
getContainedElementDeclarations
If the specified node represents a supported JAX-RPC complexType or simpleType, a Vector is returned which contains ElementDecls for the child element names. If the element is a simpleType, an ElementDecls is built representing the restricted type with the special name "value". If the element is a complexType which has simpleContent, an ElementDecl is built representing the extended type with the special name "value". This method does not return attribute names and types (use the getContainedAttributeTypes) If the specified node is not a supported JAX-RPC complexType/simpleType/element null is returned.- Parameters:
node-symbolTable-- Returns:
-
getTextByPath
Returns all textual nodes of a subnode defined by a parent node and a path of element names to that subnode.- Parameters:
root- Parent node.path- Path of element names to text of interest, delimited by "/".- Throws:
DOMException
-
getAnnotationDocumentation
Returns the complete text of the child xsd:annotation/xsd:documentation element from the provided node. Only the first annotation element and the first documentation element in the annotation element will be used.- Parameters:
typeNode- Parent node.
-
getElementAnonQName
Returns the WSDL2Java QName for the anonymous type of the element or null.- Parameters:
node-- Returns:
-
getAttributeAnonQName
Returns the WSDL2Java QName for the anonymous type of the attribute or null.- Parameters:
node-- Returns:
-
isSimpleTypeOrSimpleContent
If the specified node is a simple type or contains simpleContent, return true- Parameters:
node-- Returns:
-
getComplexElementRestrictionBase
Look for the base type of node iff node is a complex type that has been derived by restriction; otherwise return null.- Parameters:
node-symbolTable-- Returns:
-
getComplexElementExtensionBase
If the specified node represents a supported JAX-RPC complexType/element which extends another complexType. The Type of the base is returned.- Parameters:
node-symbolTable-- Returns:
-
getSimpleTypeBase
If the specified node represents a 'normal' non-enumeration simpleType, the QName of the simpleType base is returned.- Parameters:
node-- Returns:
-
getContainedSimpleTypes
Method getContainedSimpleTypes- Parameters:
node-- Returns:
-
getRestrictionOrExtensionNode
Returns the contained restriction or extension node underneath the specified node. Returns null if not found- Parameters:
node-- Returns:
-
getArrayComponentQName
public static QName getArrayComponentQName(Node node, IntHolder dims, BooleanHolder underlTypeNillable, QNameHolder itemQName, BooleanHolder forElement, SymbolTable symbolTable) If the specified node represents an array encoding of one of the following forms, then return the qname repesenting the element type of the array.- Parameters:
node- is the nodedims- is the output value that contains the number of dimensions if return is not nullitemQName- will end up containing the "inner" QName for a wrapped literal array- Returns:
- QName or null
-
getCollectionComponentQName
public static QName getCollectionComponentQName(Node node, QNameHolder itemQName, BooleanHolder forElement, SymbolTable symbolTable) If the specified node represents an element that references a collection then return the qname repesenting the component of the collection. invalid input: '<'xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/> returns qname for"xsd:string" invalid input: '<'xsd:complexType> invalid input: '<'xsd:sequence> invalid input: '<'xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/> invalid input: '<'/xsd:sequence> invalid input: '<'/xsd:complexType> returns qname for"xsd:string" invalid input: '<'xsd:element ref="alias" maxOccurs="unbounded"/> returns qname for "alias"- Parameters:
node- is the Node- Returns:
- QName of the compoent of the collection
-
getContainedAttributeTypes
Return the attribute names and types if any in the node The even indices are the attribute types (TypeEntry) and the odd indices are the corresponding names (Strings). Example:- Parameters:
node-symbolTable-- Returns:
-
isSimpleSchemaType
Determine if a QName is a simple XML Schema type- Parameters:
qname-- Returns:
-
getBaseType
Returns the base type of a given type with its symbol table. This logic is extracted from JavaTypeWriter's constructor() method for reusing.- Parameters:
type-symbolTable-- Returns:
-
isListWithItemType
Returns whether the specified node represents a invalid input: '<'xsd:simpleType> with a nested invalid input: '<'xsd:list itemType="...">.- Parameters:
node-- Returns:
-
getListItemType
Returns the value of itemType attribute of invalid input: '<'xsd:list> in invalid input: '<'xsd:simpleType>- Parameters:
node-- Returns:
-