com.sun.xml.ws.model
Class ParameterImpl

java.lang.Object
  extended by com.sun.xml.ws.model.ParameterImpl
All Implemented Interfaces:
Parameter
Direct Known Subclasses:
WrapperParameter

public class ParameterImpl
extends Object
implements Parameter

runtime Parameter that abstracts the annotated java parameter

A parameter may be bound to a header, a body, or an attachment. Note that when it's bound to a body, it's bound to a body, it binds to the whole payload.

Sometimes multiple Java parameters are packed into the payload, in which case the subclass WrapperParameter is used.


Constructor Summary
ParameterImpl(JavaMethodImpl parent, TypeReference type, javax.jws.WebParam.Mode mode, int index)
           
 
Method Summary
 Object createHolderValue(Object value)
          Creates a holder if applicable else gives the object as it is.
(package private)  void fillTypes(List<TypeReference> types)
           
 ParameterBinding getBinding()
          Returns the binding associated with the parameter.
 Bridge getBridge()
          Gives the Bridge associated with this Parameter
protected  Bridge getBridge(TypeReference typeRef)
           
 Object getHolderValue(Object obj)
          Gets the holder value if applicable.
 ParameterBinding getInBinding()
          Returns the ParameterBinding associated with the IN mode
 int getIndex()
          Position of a parameter in the method signature.
 javax.jws.WebParam.Mode getMode()
           
 QName getName()
           
 ParameterBinding getOutBinding()
          Returns the ParameterBinding associated with the OUT mode
 AbstractSEIModelImpl getOwner()
          Gets the root SEIModel that owns this model.
 JavaMethod getParent()
          Gets the parent JavaMethod to which this parameter belongs.
 String getPartName()
          Gives the wsdl:part@name value
 TypeReference getTypeReference()
          TODO: once the model gets JAXBContext, shouldn't Bridges be made available from model objects?
 boolean isIN()
           
 boolean isINOUT()
           
 boolean isOUT()
           
 boolean isResponse()
          If true, this parameter maps to the return value of a method invocation.
 boolean isReturnValue()
          Returns true if this parameter is bound to the return value from the JavaMethod.
 boolean isWrapperStyle()
           
 void setBinding(ParameterBinding binding)
           
static void setHolderValue(Object obj, Object value)
           
 void setInBinding(ParameterBinding binding)
           
 void setOutBinding(ParameterBinding binding)
           
 void setPartName(String partName)
           
(package private)  void setTypeReference(TypeReference type)
          Sometimes we need to overwrite the typeReferenc, such as during patching for rpclit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterImpl

public ParameterImpl(JavaMethodImpl parent,
                     TypeReference type,
                     javax.jws.WebParam.Mode mode,
                     int index)
Method Detail

getOwner

public AbstractSEIModelImpl getOwner()
Description copied from interface: Parameter
Gets the root SEIModel that owns this model.

Specified by:
getOwner in interface Parameter

getParent

public JavaMethod getParent()
Description copied from interface: Parameter
Gets the parent JavaMethod to which this parameter belongs.

Specified by:
getParent in interface Parameter

getName

public QName getName()
Specified by:
getName in interface Parameter
Returns:
Returns the name.

getBridge

public Bridge getBridge()
Description copied from interface: Parameter
Gives the Bridge associated with this Parameter

Specified by:
getBridge in interface Parameter

getBridge

protected Bridge getBridge(TypeReference typeRef)

getTypeReference

public TypeReference getTypeReference()
TODO: once the model gets JAXBContext, shouldn't Bridges be made available from model objects?

Returns:
Returns the TypeReference associated with this Parameter

setTypeReference

void setTypeReference(TypeReference type)
Sometimes we need to overwrite the typeReferenc, such as during patching for rpclit

See Also:
AbstractSEIModelImpl.applyParameterBinding(com.sun.xml.ws.model.wsdl.WSDLBoundPortTypeImpl)

getMode

public javax.jws.WebParam.Mode getMode()
Specified by:
getMode in interface Parameter
Returns:
Returns the mode, such as IN, OUT or INOUT.

getIndex

public int getIndex()
Description copied from interface: Parameter
Position of a parameter in the method signature. It would be -1 if the parameter is a return.

Specified by:
getIndex in interface Parameter
Returns:
Returns the index.

isWrapperStyle

public boolean isWrapperStyle()
Specified by:
isWrapperStyle in interface Parameter
Returns:
true if this instanceof WrapperParameter.

isReturnValue

public boolean isReturnValue()
Description copied from interface: Parameter
Returns true if this parameter is bound to the return value from the JavaMethod.

Just the convenience method for getIndex()==-1

Specified by:
isReturnValue in interface Parameter

getBinding

public ParameterBinding getBinding()
Description copied from interface: Parameter
Returns the binding associated with the parameter. For IN parameter the binding will be same as Parameter.getInBinding(), for OUT parameter the binding will be same as Parameter.getOutBinding() and for INOUT parameter the binding will be same as calling Parameter.getInBinding()

Specified by:
getBinding in interface Parameter
Returns:
the Binding for this Parameter

setBinding

public void setBinding(ParameterBinding binding)
Parameters:
binding -

setInBinding

public void setInBinding(ParameterBinding binding)

setOutBinding

public void setOutBinding(ParameterBinding binding)

getInBinding

public ParameterBinding getInBinding()
Description copied from interface: Parameter
Returns the ParameterBinding associated with the IN mode

Specified by:
getInBinding in interface Parameter
Returns:
the binding

getOutBinding

public ParameterBinding getOutBinding()
Description copied from interface: Parameter
Returns the ParameterBinding associated with the OUT mode

Specified by:
getOutBinding in interface Parameter
Returns:
the binding

isIN

public boolean isIN()
Specified by:
isIN in interface Parameter
Returns:
true if the WebParam.Mode associated with the parameter is WebParam.Mode.IN and false otherwise.

isOUT

public boolean isOUT()
Specified by:
isOUT in interface Parameter
Returns:
true if the WebParam.Mode associated with the parameter is WebParam.Mode.OUT and false otherwise.

isINOUT

public boolean isINOUT()
Specified by:
isINOUT in interface Parameter
Returns:
true if the WebParam.Mode associated with the parameter is WebParam.Mode.INOUT and false otherwise.

isResponse

public boolean isResponse()
If true, this parameter maps to the return value of a method invocation.

JavaMethodImpl.getResponseParameters() is guaranteed to have at most one such ParameterImpl. Note that there coule be none, in which case the method returns void.

Specified by:
isResponse in interface Parameter

createHolderValue

public Object createHolderValue(Object value)
Creates a holder if applicable else gives the object as it is. To be called on the inbound message.

Parameters:
value -
Returns:
the non-holder value if its Response or IN otherwise creates a holder with the passed value and returns it back.

getHolderValue

public Object getHolderValue(Object obj)
Gets the holder value if applicable. To be called for inbound client side message.

Specified by:
getHolderValue in interface Parameter
Parameters:
obj -
Returns:
the holder value if applicable.

setHolderValue

public static void setHolderValue(Object obj,
                                  Object value)

getPartName

public String getPartName()
Description copied from interface: Parameter
Gives the wsdl:part@name value

Specified by:
getPartName in interface Parameter
Returns:
Value of WebParam.partName() annotation if present, otherwise its the localname of the infoset associated with the parameter

setPartName

public void setPartName(String partName)

fillTypes

void fillTypes(List<TypeReference> types)