public class WSDLUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addSchemaModel(WSDLTypes types,
String namespace,
JBossXSModel model) |
boolean |
checkIgnoreClass(Class<?> cls)
Check if the class is a Java standard class
|
boolean |
checkIgnoreMethod(Method method)
Check if this method should be ignored
|
String |
chop(String name,
String chopstr)
Chop chopstr at the end of the String
|
String |
chopPortType(String name)
Chop "PortType" at the end of the String
|
StringBuilder |
createClassBasicStructure(String pkgname,
String fname,
XSTypeDefinition type,
List<?> importList,
String baseName)
Create the basic template of a class
|
File |
createPackage(String path,
String packageName)
Given a packageName, start creating the package structure
|
File |
createPhysicalFile(File loc,
String fname)
Create a file on the disk
|
boolean |
doesPublicFieldExist(Class<?> javaType,
String name)
Checks whether there exists a public field with the given name
|
String |
firstLetterUpperCase(String fname)
Ensure that the first alphabet is uppercase
|
int |
getArrayDimension(Class<?> arr)
Get the dimension of an array
|
String |
getFormattedString(QName qn)
Given a QName, provide a string that is prefix:localpart
|
Class<?> |
getHolder(Class<?> cls)
Return the Jaxrpc holder that
represents the class
|
static WSDLUtils |
getInstance()
Singleton - Only way to get an instance
|
Class<?> |
getJavaType(QName xmlType)
Given the XMLType, we will check if it is of basic schema
types that are mapped to Java primitives and wrappers
Jaxrpc 1.1 Section 5.3
|
Class<?> |
getJavaTypeForHolder(Class<?> cls)
Return the Java class that is represented by
the Jaxrpc holder
|
static String |
getJustClassName(Class<?> cls)
Given a class, strip out the package name
|
static String |
getJustClassName(String classname)
Given a FQN of a class, strip out the package name
|
String |
getMessagePartForArray(Class<?> javaType)
An input of "HelloObjArray" is converted into arrayOfHelloObj
Applied in the input part for WSDL 1.1 Messages
|
String |
getMixedCase(String str)
Change the first character to uppercase
|
String |
getPackageName(String typeNS)
Extracts the package name from the typeNS
|
String |
getPrimitive(String str)
Return the primitive for a wrapper equivalent (Integer -> int)
|
Field[] |
getPublicFields(Class<?> cls)
From the list of fields defined by this class (not superclasses)
get the fields that are relevant (public)
|
Method[] |
getPublicProtectedMethods(Method[] methods)
From the list of fields defined by this class (not superclasses)
get the fields that are relevant (public/protected)
|
QName |
getQName(String formattedStr)
Return a QName given a formatted string
|
static JBossXSModel |
getSchemaModel(WSDLTypes types) |
static String |
getTypeNamespace(Class<?> javaType) |
static String |
getTypeNamespace(String packageName)
Extracts the typeNS given the package name
Algorithm is based on the one specified in JAWS v2.0 spec
|
static WSDLInterfaceOperationInput |
getWsdl11Input(WSDLInterfaceOperation operation) |
static WSDLInterfaceOperationOutput |
getWsdl11Output(WSDLInterfaceOperation operation) |
String |
getWSDLStyle(WSDLDefinitions wsdl)
Given WSDLDefinitions, detect the wsdl style
|
boolean |
isBaseTypeIgnorable(XSTypeDefinition baseType,
XSComplexTypeDefinition t)
For the given complex type, check if its base type is the regular xsd type (xsd:anyType)
which can be ignored
|
boolean |
isPrimitive(String str)
Check if it is of Primitive Type
|
boolean |
isStandardHolder(Class<?> cls)
Checks whether the class is a standard jaxrpc holder
|
boolean |
isWrapper(String str)
Check if it is of Wrapper Type
|
protected void |
populatePrimList() |
protected void |
populateWrapperList() |
void |
writeJbossHeader(StringBuilder buf)
Write the JBoss License Header at the top of generated class source files
|
public static WSDLUtils getInstance()
public boolean isPrimitive(String str)
str
- public boolean isWrapper(String str)
str
- public boolean isBaseTypeIgnorable(XSTypeDefinition baseType, XSComplexTypeDefinition t)
baseType
- t
- ComplexTypeDefinitionpublic boolean checkIgnoreClass(Class<?> cls)
cls
- public boolean checkIgnoreMethod(Method method)
public String chopPortType(String name)
name
- public String chop(String name, String chopstr)
name
- chopstr
- the string that is the key Eg: Faultpublic File createPackage(String path, String packageName)
packageName
- public File createPhysicalFile(File loc, String fname) throws IOException
loc
- Location where the file has to be createdfname
- File Name to which '.java' will be appendedIOException
- Problem creating the filepublic StringBuilder createClassBasicStructure(String pkgname, String fname, XSTypeDefinition type, List<?> importList, String baseName)
pkgname
- Package Namefname
- File Name to which '.java' will be appendedtype
- XSDType to obtain base class info (if Complex Type)importList
- Strings representing importspublic boolean doesPublicFieldExist(Class<?> javaType, String name)
javaType
- Class Objectname
- Field name to checkpublic String firstLetterUpperCase(String fname)
fname
- public int getArrayDimension(Class<?> arr)
arr
- public Class<?> getHolder(Class<?> cls)
cls
- public Class<?> getJavaTypeForHolder(Class<?> cls)
cls
- The jaxrpc holder typepublic String getMessagePartForArray(Class<?> javaType)
arrayStr
- public static String getJustClassName(Class<?> cls)
cls
- public static String getJustClassName(String classname)
classname
- public Field[] getPublicFields(Class<?> cls)
public Method[] getPublicProtectedMethods(Method[] methods)
methods
- public Class<?> getJavaType(QName xmlType)
xmlType
- public String getMixedCase(String str)
str
- public String getFormattedString(QName qn)
qn
- public QName getQName(String formattedStr)
formattedStr
- string that is prefix:localpartpublic String getPrimitive(String str)
str
- public String getPackageName(String typeNS)
typeNS
- public static String getTypeNamespace(String packageName)
public String getWSDLStyle(WSDLDefinitions wsdl)
wsdl
- public static JBossXSModel getSchemaModel(WSDLTypes types)
public static void addSchemaModel(WSDLTypes types, String namespace, JBossXSModel model)
public boolean isStandardHolder(Class<?> cls)
cls
- a Class objectpublic void writeJbossHeader(StringBuilder buf)
buf
- protected void populatePrimList()
protected void populateWrapperList()
public static WSDLInterfaceOperationOutput getWsdl11Output(WSDLInterfaceOperation operation)
public static WSDLInterfaceOperationInput getWsdl11Input(WSDLInterfaceOperation operation)
Copyright © 2018 JBoss by Red Hat. All rights reserved.