org.apache.axis.wsdl
Class Utils

java.lang.Object
  |
  +--org.apache.axis.wsdl.Utils

public class Utils
extends java.lang.Object

This class contains static utility methods for the emitter.

Author:
Rich Scheuerle (scheu@us.ibm.com), Tom Jordahl (tomj@macromedia.com)

Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String capitalizeFirstChar(java.lang.String name)
          Capitalize the first character of the name.
static java.lang.String getAttribute(org.w3c.dom.Node node, java.lang.String attr)
          Given a node, return the value of the given attribute.
static java.util.Vector getAttributesWithLocalName(org.w3c.dom.Node node, java.lang.String localName)
          Given a node, return the attributes that have the specified local name.
static java.lang.String getBaseJavaName(javax.wsdl.QName qName)
          Some QNames represent base types.
static java.lang.String getExceptionName(javax.wsdl.Fault fault)
          Given a fault, return the Java class name of the exception to be generated from this fault
static java.lang.String getJavaLocalName(java.lang.String fullName)
          Query Java Local Name
static java.lang.String getJavaPackageName(java.lang.String fullName)
          Query Java Package Name
static java.util.HashSet getNestedTypes(org.w3c.dom.Node type, SymbolTable symbolTable)
          This method returns a set of all the nested Types.
static javax.wsdl.QName getNodeNameQName(org.w3c.dom.Node node)
          XML nodes may have a name attribute.
static javax.wsdl.QName getNodeQName(org.w3c.dom.Node node)
          An xml element may have a name.
static javax.wsdl.QName getNodeTypeRefQName(org.w3c.dom.Node node)
          XML nodes may have a type/ref attribute.
static javax.wsdl.QName getNodeTypeRefQName(org.w3c.dom.Node node, java.lang.String typeAttrName)
          Obtain the QName of the type/ref using the indicated attribute name.
static javax.wsdl.QName getQNameFromPrefixedName(org.w3c.dom.Node node, java.lang.String prefixedName)
          Convert a prefixed name into a qname
static java.lang.String getScopedAttribute(org.w3c.dom.Node node, java.lang.String attr)
          Given a node, return the value of the given attribute.
static java.lang.String holder(Type type)
          Given a type, return the Java mapping of that type's holder.
static boolean isJavaKeyword(java.lang.String keyword)
          checks if the input string is a valid java keyword.
static boolean isSchemaNS(java.lang.String s)
          Return true if the indicated string is the schema namespace
static boolean isSoapEncodingNS(java.lang.String s)
          Return true if the indicated string is the soap encoding namespace
static boolean isSoapNS(java.lang.String s)
          Return true if the indicated string is the soap namespace
static boolean isSoapWsdlNS(java.lang.String s)
          Return true if the indicated string is the soap wsdl namespace
static boolean isWsdlNS(java.lang.String s)
          Return true if the indicated string is the schema namespace
static java.lang.String makeNonJavaKeyword(java.lang.String keyword)
          Turn a java keyword string into a non-Java keyword string.
static java.lang.String makePackageName(java.lang.String namespace)
           
static java.lang.String xmlNameToJava(java.lang.String name)
          Map an XML name to a valid Java identifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

capitalizeFirstChar

public static java.lang.String capitalizeFirstChar(java.lang.String name)
Capitalize the first character of the name.

getBaseJavaName

public static java.lang.String getBaseJavaName(javax.wsdl.QName qName)
Some QNames represent base types. This routine returns the name of the base java type or null. (These mappings based on JSR-101 version 0.5)

getScopedAttribute

public static java.lang.String getScopedAttribute(org.w3c.dom.Node node,
                                                  java.lang.String attr)
Given a node, return the value of the given attribute. If the attribute does not exist, searching continues through ancestor nodes until found. This method is useful for finding attributes that pertain to a group of contained nodes (i.e. xlmns, xmlns:tns, targetNamespace, name)

getAttribute

public static java.lang.String getAttribute(org.w3c.dom.Node node,
                                            java.lang.String attr)
Given a node, return the value of the given attribute. Returns null if the attribute is not found

getAttributesWithLocalName

public static java.util.Vector getAttributesWithLocalName(org.w3c.dom.Node node,
                                                          java.lang.String localName)
Given a node, return the attributes that have the specified local name. Returns null if the attribute is not found

getNodeQName

public static javax.wsdl.QName getNodeQName(org.w3c.dom.Node node)
An xml element may have a name. For example <.element name="foo" type="b:bar">. has the name "element". This routine gets the full QName of the element.

getNodeNameQName

public static javax.wsdl.QName getNodeNameQName(org.w3c.dom.Node node)
XML nodes may have a name attribute. For example <.element name="foo" type="b:bar">. has the name attribute value "foo". This routine gets the QName of the name attribute value.

getNodeTypeRefQName

public static javax.wsdl.QName getNodeTypeRefQName(org.w3c.dom.Node node)
XML nodes may have a type/ref attribute. For example <.element name="foo" type="b:bar">. has the type attribute value "b:bar". This routine gets the QName of the type/ref attribute value.

getNodeTypeRefQName

public static javax.wsdl.QName getNodeTypeRefQName(org.w3c.dom.Node node,
                                                   java.lang.String typeAttrName)
Obtain the QName of the type/ref using the indicated attribute name. For example, the "type" attribute in an XML enumeration struct is the "base" attribute.

getQNameFromPrefixedName

public static javax.wsdl.QName getQNameFromPrefixedName(org.w3c.dom.Node node,
                                                        java.lang.String prefixedName)
Convert a prefixed name into a qname

isSchemaNS

public static boolean isSchemaNS(java.lang.String s)
Return true if the indicated string is the schema namespace

isWsdlNS

public static boolean isWsdlNS(java.lang.String s)
Return true if the indicated string is the schema namespace

isSoapWsdlNS

public static boolean isSoapWsdlNS(java.lang.String s)
Return true if the indicated string is the soap wsdl namespace

isSoapNS

public static boolean isSoapNS(java.lang.String s)
Return true if the indicated string is the soap namespace

isSoapEncodingNS

public static boolean isSoapEncodingNS(java.lang.String s)
Return true if the indicated string is the soap encoding namespace

isJavaKeyword

public static boolean isJavaKeyword(java.lang.String keyword)
checks if the input string is a valid java keyword.
Returns:
boolean true/false

makeNonJavaKeyword

public static java.lang.String makeNonJavaKeyword(java.lang.String keyword)
Turn a java keyword string into a non-Java keyword string. (Right now this simply means appending an underscore.)

xmlNameToJava

public static java.lang.String xmlNameToJava(java.lang.String name)
Map an XML name to a valid Java identifier

makePackageName

public static java.lang.String makePackageName(java.lang.String namespace)

holder

public static java.lang.String holder(Type type)
Given a type, return the Java mapping of that type's holder.

getExceptionName

public static java.lang.String getExceptionName(javax.wsdl.Fault fault)
Given a fault, return the Java class name of the exception to be generated from this fault
Parameters:
fault - - The WSDL fault object
Returns:
A Java class name for the fault

getNestedTypes

public static java.util.HashSet getNestedTypes(org.w3c.dom.Node type,
                                               SymbolTable symbolTable)
This method returns a set of all the nested Types. The elements of the returned HashSet are Types.

getJavaLocalName

public static java.lang.String getJavaLocalName(java.lang.String fullName)
Query Java Local Name

getJavaPackageName

public static java.lang.String getJavaPackageName(java.lang.String fullName)
Query Java Package Name


Copyright © 2001 Apache XML Project. All Rights Reserved.