Package org.apache.axis.wsdl.toJava
Class Utils
- java.lang.Object
-
- org.apache.axis.wsdl.symbolTable.Utils
-
- org.apache.axis.wsdl.toJava.Utils
-
public class Utils extends Utils
Class Utils- Version:
- %I%, %G%
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Log
log
Field log
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
addPackageName(java.lang.String className, java.lang.String newPkg)
Add package to namestatic java.lang.String
addUnderscore(java.lang.String name)
Prepend an underscore to the namestatic java.lang.String
capitalizeFirstChar(java.lang.String name)
Capitalize the first character of the name.static boolean
fileExists(java.lang.String name, java.lang.String namespace, Namespaces namespaces)
Does the given file already exist in the given namespace?static java.lang.String
getConstructorForParam(Parameter param, SymbolTable symbolTable, BooleanHolder bThrow)
Return a constructor for the provided Parameter This string will be suitable for assignment:static java.util.Vector
getEnumerationBaseAndValues(org.w3c.dom.Node node, SymbolTable symbolTable)
If the specified node represents a supported JAX-RPC enumeration, a Vector is returned which contains the base type and the enumeration values.static QName
getFaultDataType(javax.wsdl.Message faultMessage, SymbolTable symbolTable)
Given a fault message, return the XML type of the exception data.static java.lang.String
getFullExceptionName(javax.wsdl.Message faultMessage, SymbolTable symbolTable)
Given a fault message, return the fully qualified Java class name of the exception to be generated from this faultstatic QName
getItemQName(TypeEntry te)
static QName
getItemType(TypeEntry te)
static java.lang.String
getJavaLocalName(java.lang.String fullName)
Query Java Local Namestatic java.lang.String
getJavaPackageName(java.lang.String fullName)
Query Java Package Namestatic QName
getMIMETypeQName(java.lang.String mimeName)
Given a MIME type, return the AXIS-specific type QName.static java.lang.String
getNewQName(QName qname)
Common code for generating a QName in emitted code.static java.lang.String
getNewQNameWithLastLocalPart(QName qname)
static QName
getOperationQName(javax.wsdl.BindingOperation bindingOper, BindingEntry bEntry, SymbolTable symbolTable)
Return the operation QName.static java.lang.String
getOperationSOAPAction(javax.wsdl.BindingOperation bindingOper)
Return the SOAPAction (if any) of this binding operationstatic java.lang.String
getParameterTypeName(Parameter parm)
Get the parameter type name.static java.lang.String
getResponseString(Parameter param, java.lang.String var)
Return the Object variable 'var' cast to the appropriate type doing the right thing for the primitive types.static java.lang.String
getWrapperType(java.lang.String type)
Return a "wrapper" type for the given type name.static java.lang.String
getWrapperType(TypeEntry type)
Returns a "wrapper" type for the given TypeEntry.static QName
getXSIType(Parameter param)
Get the QName that could be used in the xsi:type when serializing an object for this parameter/returnstatic QName
getXSIType(TypeEntry te)
Get the QName that could be used in the xsi:type when serializing an object of the given type.static boolean
hasMIME(BindingEntry bEntry)
Are there any MIME parameters in the given binding?static boolean
hasMIME(BindingEntry bEntry, javax.wsdl.BindingOperation operation)
Are there any MIME parameters in the given binding's operation?static java.lang.String
holder(Parameter p, Emitter emitter)
Given a type, return the Java mapping of that type's holder.static java.lang.String
holder(TypeEntry type, Emitter emitter)
static boolean
isFaultComplex(javax.wsdl.Message faultMessage, SymbolTable symbolTable)
Given a fault message, return TRUE if the fault is a complex type faultstatic boolean
isPrimitiveType(TypeEntry type)
Method isPrimitiveTypestatic boolean
isXsNode(org.w3c.dom.Node node, java.lang.String nameName)
Determines if the DOM Node represents an xs:static java.lang.String
makePackageName(java.lang.String namespace)
Method makePackageNamestatic boolean
shouldEmit(TypeEntry type)
static java.lang.String
wrapPrimitiveType(TypeEntry type, java.lang.String var)
Return a string with "var" wrapped as an Object type if neededstatic java.lang.String
xmlNameToJava(java.lang.String name)
Map an XML name to a valid Java identifierstatic java.lang.String
xmlNameToJavaClass(java.lang.String name)
Map an XML name to a valid Java identifier w/ capitolized first letter-
Methods inherited from class org.apache.axis.wsdl.symbolTable.Utils
genQNameAttributeString, genQNameAttributeStringWithLastLocalPart, getAttribute, getAttributesWithLocalName, getDerivedTypes, getLastLocalPart, getMemberTypeQNames, getNestedTypes, getNodeNameQName, getNodeQName, getQNameFromPrefixedName, getScopedAttribute, getTypeQName
-
-
-
-
Method Detail
-
holder
public static java.lang.String holder(TypeEntry type, Emitter emitter)
- See Also:
holder(Parameter, Emitter)
-
holder
public static java.lang.String holder(Parameter p, Emitter emitter)
Given a type, return the Java mapping of that type's holder.- Parameters:
p
- parameter whose holder class name we want to obtain.emitter
- the onlyEmitter
object embodying the running instance of WSDL2Java.- Returns:
- the name of the holder class for p.
-
addPackageName
public static java.lang.String addPackageName(java.lang.String className, java.lang.String newPkg)
Add package to name- Parameters:
className
- full name of the class.newPkg
- name of the package to append- Returns:
- String name with package name added
-
getFullExceptionName
public static java.lang.String getFullExceptionName(javax.wsdl.Message faultMessage, SymbolTable symbolTable)
Given a fault message, return the fully qualified Java class name of the exception to be generated from this fault- Parameters:
faultMessage
- The WSDL fault messagesymbolTable
- the current symbol table- Returns:
- A Java class name for the fault
-
getFaultDataType
public static QName getFaultDataType(javax.wsdl.Message faultMessage, SymbolTable symbolTable)
Given a fault message, return the XML type of the exception data.- Parameters:
faultMessage
- The WSDL fault message objectsymbolTable
- the current symbol table- Returns:
- A QName for the XML type of the data
-
isFaultComplex
public static boolean isFaultComplex(javax.wsdl.Message faultMessage, SymbolTable symbolTable)
Given a fault message, return TRUE if the fault is a complex type fault- Parameters:
faultMessage
- The WSDL fault message objectsymbolTable
- the current symbol table- Returns:
- A Java class name for the fault
-
getEnumerationBaseAndValues
public static java.util.Vector getEnumerationBaseAndValues(org.w3c.dom.Node node, SymbolTable symbolTable)
If the specified node represents a supported JAX-RPC enumeration, a Vector is returned which contains the base type and the enumeration values. The first element in the vector is the base type (an TypeEntry). Subsequent elements are values (Strings). If this is not an enumeration, null is returned.- Parameters:
node
-symbolTable
-- Returns:
-
capitalizeFirstChar
public static java.lang.String capitalizeFirstChar(java.lang.String name)
Capitalize the first character of the name.- Parameters:
name
-- Returns:
-
addUnderscore
public static java.lang.String addUnderscore(java.lang.String name)
Prepend an underscore to the name- Parameters:
name
-- Returns:
-
xmlNameToJava
public static java.lang.String xmlNameToJava(java.lang.String name)
Map an XML name to a valid Java identifier- Parameters:
name
-- Returns:
-
xmlNameToJavaClass
public static java.lang.String xmlNameToJavaClass(java.lang.String name)
Map an XML name to a valid Java identifier w/ capitolized first letter- Parameters:
name
-- Returns:
-
makePackageName
public static java.lang.String makePackageName(java.lang.String namespace)
Method makePackageName- Parameters:
namespace
-- Returns:
-
getJavaLocalName
public static java.lang.String getJavaLocalName(java.lang.String fullName)
Query Java Local Name- Parameters:
fullName
-- Returns:
-
getJavaPackageName
public static java.lang.String getJavaPackageName(java.lang.String fullName)
Query Java Package Name- Parameters:
fullName
-- Returns:
-
fileExists
public static boolean fileExists(java.lang.String name, java.lang.String namespace, Namespaces namespaces) throws java.io.IOException
Does the given file already exist in the given namespace?- Parameters:
name
-namespace
-namespaces
-- Returns:
- Throws:
java.io.IOException
-
wrapPrimitiveType
public static java.lang.String wrapPrimitiveType(TypeEntry type, java.lang.String var)
Return a string with "var" wrapped as an Object type if needed- Parameters:
type
-var
-- Returns:
-
getResponseString
public static java.lang.String getResponseString(Parameter param, java.lang.String var)
Return the Object variable 'var' cast to the appropriate type doing the right thing for the primitive types.- Parameters:
var
-- Returns:
-
isPrimitiveType
public static boolean isPrimitiveType(TypeEntry type)
Method isPrimitiveType- Parameters:
type
-- Returns:
-
getWrapperType
public static java.lang.String getWrapperType(java.lang.String type)
Return a "wrapper" type for the given type name. In other words, if it's a primitive type ("int") return the java wrapper class ("java.lang.Integer"). Otherwise return the type name itself.- Parameters:
type
-- Returns:
- the name of a java wrapper class for the type, or the type's name if it's not primitive.
-
getWrapperType
public static java.lang.String getWrapperType(TypeEntry type)
Returns a "wrapper" type for the given TypeEntry.- Parameters:
type
-- Returns:
- the name of a java wrapper class for the type, or the type's name if it's not a primitive.
-
getOperationQName
public static QName getOperationQName(javax.wsdl.BindingOperation bindingOper, BindingEntry bEntry, SymbolTable symbolTable)
Return the operation QName. The namespace is determined from the soap:body namespace, if it exists, otherwise it is "".- Parameters:
bindingOper
- the operationbEntry
- the symbol table binding entrysymbolTable
- SymbolTable- Returns:
- the operation QName
-
getOperationSOAPAction
public static java.lang.String getOperationSOAPAction(javax.wsdl.BindingOperation bindingOper)
Return the SOAPAction (if any) of this binding operation- Parameters:
bindingOper
- the operation to look at- Returns:
- the SOAPAction or null if not found
-
getNewQName
public static java.lang.String getNewQName(QName qname)
Common code for generating a QName in emitted code. Note that there's no semicolon at the end, so we can use this in a variety of contexts.- Parameters:
qname
-- Returns:
-
getNewQNameWithLastLocalPart
public static java.lang.String getNewQNameWithLastLocalPart(QName qname)
-
getParameterTypeName
public static java.lang.String getParameterTypeName(Parameter parm)
Get the parameter type name. If this is a MIME type, then figure out the appropriate type from the MIME type, otherwise use the name of the type itself.- Parameters:
parm
-- Returns:
-
getXSIType
public static QName getXSIType(Parameter param)
Get the QName that could be used in the xsi:type when serializing an object for this parameter/return- Parameters:
param
- is a parameter- Returns:
- the QName of the parameter's xsi type
-
getXSIType
public static QName getXSIType(TypeEntry te)
Get the QName that could be used in the xsi:type when serializing an object of the given type.- Parameters:
te
- is the type entry- Returns:
- the QName of the type's xsi type
-
getMIMETypeQName
public static QName getMIMETypeQName(java.lang.String mimeName)
Given a MIME type, return the AXIS-specific type QName.- Parameters:
mimeName
- the MIME type name- Returns:
- the AXIS-specific QName for the MIME type
-
hasMIME
public static boolean hasMIME(BindingEntry bEntry)
Are there any MIME parameters in the given binding?- Parameters:
bEntry
-- Returns:
-
hasMIME
public static boolean hasMIME(BindingEntry bEntry, javax.wsdl.BindingOperation operation)
Are there any MIME parameters in the given binding's operation?- Parameters:
bEntry
-operation
-- Returns:
-
getConstructorForParam
public static java.lang.String getConstructorForParam(Parameter param, SymbolTable symbolTable, BooleanHolder bThrow)
Return a constructor for the provided Parameter This string will be suitable for assignment: Foo var = string returned Handles basic java types (int, float, etc), wrapper types (Integer, etc) and certain java.math (BigDecimal, BigInteger) types. Will also handle all Axis specific types (org.apache.axis.types.*) Caller should expect to wrap the construction in a try/catch block if bThrow is set to true.- Parameters:
param
- info about the parameter we need a constructor forsymbolTable
- used to lookup enumerationsbThrow
- set to true if contructor needs try/catch block- Returns:
-
shouldEmit
public static boolean shouldEmit(TypeEntry type)
-
isXsNode
public static boolean isXsNode(org.w3c.dom.Node node, java.lang.String nameName)
Determines if the DOM Node represents an xs:
-
-