Package com.sun.xml.ws.api.model
Class ParameterBinding
- java.lang.Object
-
- com.sun.xml.ws.api.model.ParameterBinding
-
public final class ParameterBinding extends Object
Denotes the binding of a parameter.This is somewhat like an enumeration (but it is NOT an enumeration.)
The possible values are BODY, HEADER, UNBOUND, and ATTACHMENT. BODY, HEADER, and UNBOUND has a singleton semantics, but there are multiple ATTACHMENT instances as it carries additional MIME type parameter.
So don't use '==' for testing the equality.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParameterBinding.KindRepresents 4 kinds of binding.
-
Field Summary
Fields Modifier and Type Field Description static ParameterBindingBODYSingleton instance that represents 'BODY'static ParameterBindingHEADERSingleton instance that represents 'HEADER'ParameterBinding.KindkindRepresents the kind ofParameterBinding.static ParameterBindingUNBOUNDSingleton instance that represents 'UNBOUND', meaning the parameter doesn't have a representation in a SOAP message.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ParameterBindingcreateAttachment(String mimeType)Creates an instance that represents the attachment with a given MIME type.StringgetMimeType()Returns the MIME type associated with this binding.booleanisAttachment()booleanisBody()booleanisHeader()booleanisUnbound()StringtoString()
-
-
-
Field Detail
-
BODY
public static final ParameterBinding BODY
Singleton instance that represents 'BODY'
-
HEADER
public static final ParameterBinding HEADER
Singleton instance that represents 'HEADER'
-
UNBOUND
public static final ParameterBinding UNBOUND
Singleton instance that represents 'UNBOUND', meaning the parameter doesn't have a representation in a SOAP message.
-
kind
public final ParameterBinding.Kind kind
Represents the kind ofParameterBinding. Always non-null.
-
-
Method Detail
-
createAttachment
public static ParameterBinding createAttachment(String mimeType)
Creates an instance that represents the attachment with a given MIME type.TODO: shall we consider givint the singleton semantics by using a cache? It's more elegant to do so, but no where in JAX-WS RI two
ParameterBindings are compared today,
-
getMimeType
public String getMimeType()
Returns the MIME type associated with this binding.- Returns:
- Can be null, if the MIME type is not known.
- Throws:
IllegalStateException- if this binding doesn't represent an attachment. IOW, ifisAttachment()returns false.
-
isBody
public boolean isBody()
-
isHeader
public boolean isHeader()
-
isUnbound
public boolean isUnbound()
-
isAttachment
public boolean isAttachment()
-
-