org.apache.wsif.providers
Class ProviderUtils

java.lang.Object
  extended by org.apache.wsif.providers.ProviderUtils

public class ProviderUtils
extends java.lang.Object

A class of static utility methods for use across multiple providers

Author:
Owen Burroughs

Constructor Summary
ProviderUtils()
           
 
Method Summary
static java.lang.String capitalizeFirst(java.lang.String s)
          Capatalise the first character of a String
static java.lang.Object characterArrayToStringArray(java.lang.Object obj)
          Convert an array of java.lang.Characters of any dimensions to an equivalent array of java.lang.Strings which has the same dimensions.
static java.lang.Object charArrayToStringArray(java.lang.Object obj)
          Convert an array of chars of any dimensions to an equivalent array of java.lang.Strings which has the same dimensions.
static java.lang.Object getDefaultObject(java.lang.Class cls)
          Returns a default Object value for a given Class.
static javax.xml.namespace.QName getPartType(javax.wsdl.Part p)
          Gets the type of a Part, if the Part doesn't have a type, then gets the Element name as WSIF treats this as the same thing.
static javax.wsdl.Part getWrapperPart(java.util.List parts, java.lang.String operationName)
          Gets the wrapped Part if this is wrapped document literal stype operation.
static boolean isUnwrapable(javax.wsdl.Operation op)
          Tests if this is wrapped stype operation.
static java.lang.String lowercaseFirst(java.lang.String s)
          Lowercase the first character of a String
static java.lang.Object stringArrayToCharacterArray(java.lang.Object obj)
          Convert an array of any dimensions containing only Strings of length 1, to an array of java.lang.Characters which has the same dimensions.
static java.lang.Object stringArrayToCharArray(java.lang.Object obj)
          Convert an array of any dimensions containing only Strings of length 1, to an array of chars which has the same dimensions.
static java.lang.Character stringToCharacter(java.lang.String str)
          Convert a String to a Character.
static java.util.List unWrapPart(javax.wsdl.Part p, javax.wsdl.Definition def)
          Unwraps a wrapped DocLit style part.
static java.util.List unWrapPart(javax.wsdl.Part p, javax.wsdl.Definition def, WSIFMessage context)
          Unwraps a wrapped DocLit style part.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderUtils

public ProviderUtils()
Method Detail

stringArrayToCharacterArray

public static java.lang.Object stringArrayToCharacterArray(java.lang.Object obj)
                                                    throws WSIFException
Convert an array of any dimensions containing only Strings of length 1, to an array of java.lang.Characters which has the same dimensions.

Parameters:
obj - The array of Strings
Returns:
The Character array
Throws:
A - WSIFException thrown if the conversion fails for any reason.
WSIFException

stringArrayToCharArray

public static java.lang.Object stringArrayToCharArray(java.lang.Object obj)
                                               throws WSIFException
Convert an array of any dimensions containing only Strings of length 1, to an array of chars which has the same dimensions.

Parameters:
obj - The array of Strings
Returns:
The char array
Throws:
A - WSIFException thrown if the conversion fails for any reason.
WSIFException

characterArrayToStringArray

public static java.lang.Object characterArrayToStringArray(java.lang.Object obj)
                                                    throws WSIFException
Convert an array of java.lang.Characters of any dimensions to an equivalent array of java.lang.Strings which has the same dimensions.

Parameters:
obj - The array of Characters
Returns:
The array of Strings
Throws:
A - WSIFException thrown if the conversion fails for any reason.
WSIFException

charArrayToStringArray

public static java.lang.Object charArrayToStringArray(java.lang.Object obj)
                                               throws WSIFException
Convert an array of chars of any dimensions to an equivalent array of java.lang.Strings which has the same dimensions.

Parameters:
obj - The array of chars
Returns:
The array of Strings
Throws:
A - WSIFException thrown if the conversion fails for any reason.
WSIFException

stringToCharacter

public static java.lang.Character stringToCharacter(java.lang.String str)
Convert a String to a Character. If the String is longer than one character this method will return null;

Parameters:
str - The String
Returns:
The Character or null if the String was longer than one character

getDefaultObject

public static java.lang.Object getDefaultObject(java.lang.Class cls)
Returns a default Object value for a given Class. If the Class is a primitive type the method will return the default value for that primitive type wrapped up in its object form. For example, invoking the method with int.class will return a new java.lang.Integer with an int value of 0. If the Class does not represent a primitive type then null will be returned.

Parameters:
cls - The Class
Returns:
The default object value

isUnwrapable

public static boolean isUnwrapable(javax.wsdl.Operation op)
Tests if this is wrapped stype operation. An operation is wrapped if: - the input message name has a part with an element which has the same name as the operation name, and the output message has an element with a name the same as the operation name appended with "Response" - there is only a single part (but with attachments there may be multiple parts so ignore this for now?)


getWrapperPart

public static javax.wsdl.Part getWrapperPart(java.util.List parts,
                                             java.lang.String operationName)
Gets the wrapped Part if this is wrapped document literal stype operation. An operation is wrapped if: - there is only one input or output message part and that part is an element not a type (MIME means there can be many parts, so all this can check is that there is only one element part) - the message name is the same as the operation name (for a response the operation name is appened with "Response")


unWrapPart

public static java.util.List unWrapPart(javax.wsdl.Part p,
                                        javax.wsdl.Definition def)
                                 throws WSIFException
Unwraps a wrapped DocLit style part.

Throws:
WSIFException

unWrapPart

public static java.util.List unWrapPart(javax.wsdl.Part p,
                                        javax.wsdl.Definition def,
                                        WSIFMessage context)
                                 throws WSIFException
Unwraps a wrapped DocLit style part.

Throws:
WSIFException

getPartType

public static javax.xml.namespace.QName getPartType(javax.wsdl.Part p)
Gets the type of a Part, if the Part doesn't have a type, then gets the Element name as WSIF treats this as the same thing.


capitalizeFirst

public static java.lang.String capitalizeFirst(java.lang.String s)
Capatalise the first character of a String

Parameters:
s - the string to be capatalized
Returns:
String the capatalized String

lowercaseFirst

public static java.lang.String lowercaseFirst(java.lang.String s)
Lowercase the first character of a String

Parameters:
s - the string to be lowercased
Returns:
String the lowercased String


Copyright ? 2002, 2006 Apache XML Project. All Rights Reserved.