com.sun.xml.ws.encoding
Class ContentType

java.lang.Object
  extended by com.sun.xml.ws.encoding.ContentType

public final class ContentType
extends Object

This class represents a MIME ContentType value. It provides methods to parse a ContentType string into individual components and to generate a MIME style ContentType string.


Constructor Summary
ContentType(String s)
          Constructor that takes a Content-Type string.
 
Method Summary
 String getBaseType()
          Return the MIME type string, without the parameters.
 String getParameter(String name)
          Return the specified parameter value.
 ParameterList getParameterList()
          Return a ParameterList object that holds all the available parameters.
 String getPrimaryType()
          Return the primary type.
 String getSubType()
          Return the subType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentType

public ContentType(String s)
            throws javax.xml.ws.WebServiceException
Constructor that takes a Content-Type string. The String is parsed into its constituents: primaryType, subType and parameters. A ParseException is thrown if the parse fails.

Parameters:
s - the Content-Type string.
Throws:
javax.xml.ws.WebServiceException - if the parse fails.
Method Detail

getPrimaryType

public String getPrimaryType()
Return the primary type.

Returns:
the primary type

getSubType

public String getSubType()
Return the subType.

Returns:
the subType

getBaseType

public String getBaseType()
Return the MIME type string, without the parameters. The returned value is basically the concatenation of the primaryType, the '/' character and the secondaryType.

Returns:
the type

getParameter

public String getParameter(String name)
Return the specified parameter value. Returns null if this parameter is absent.

Parameters:
name - parameter name
Returns:
parameter value

getParameterList

public ParameterList getParameterList()
Return a ParameterList object that holds all the available parameters. Returns null if no parameters are available.

Returns:
ParameterList