|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ws4d.java.types.InternetMediaType
public class InternetMediaType
Kind of MIME-Type like described at RFC 1590.
Constructor Summary | |
---|---|
InternetMediaType(java.lang.String mediaType)
Create a new media type object from the information given. |
|
InternetMediaType(java.lang.String type,
java.lang.String subtype)
Creates a new media type object from given types. |
|
InternetMediaType(java.lang.String type,
java.lang.String subtype,
java.lang.String[] parameterKeys,
java.lang.String[] parameterValues)
Creates a new media type object from given types. |
|
InternetMediaType(java.lang.String type,
java.lang.String subtype,
java.lang.String parameterKey,
java.lang.String parameterValue)
Creates a new media type object from given types. |
Method Summary | |
---|---|
static InternetMediaType |
cloneAndAddParameter(InternetMediaType original,
java.lang.String parameterKey,
java.lang.String parameterValue)
Clones an InternetMediaType instance and adds the passed parameter to the original ones. |
static InternetMediaType |
cloneAndAddParameters(InternetMediaType original,
java.lang.String[] parameterKeys,
java.lang.String[] parameterValues)
Clones an InternetMediaType instance and adds the passed parameters to the original ones. |
static InternetMediaType |
cloneAndSetParameter(InternetMediaType original,
java.lang.String parameterKey,
java.lang.String parameterValue)
Clones an InternetMediaType instance and replaces the original parameters with the passed one. |
static InternetMediaType |
cloneAndSetParameters(InternetMediaType original,
java.lang.String[] parameterKeys,
java.lang.String[] parameterValues)
Clones an InternetMediaType instance and replaces the original parameters with the passed ones. |
boolean |
equals(java.lang.Object obj)
|
static InternetMediaType |
getApplicationOctetStream()
Returns the application/octet-stream type. |
static InternetMediaType |
getApplicationXOPXML()
Returns the application/xop+xml type. |
static InternetMediaType |
getApplicationXWWWFormUrlEncoded()
Returns the application/x-www-form-urlencoded type. |
static InternetMediaType |
getImageJPEG()
Returns the image/jpeg type. |
java.lang.String |
getMediaType()
Returns the complete media type. |
static InternetMediaType |
getMultipartFormdata()
Returns the multipart/form-data type. |
static InternetMediaType |
getMultipartRelated()
Returns the multipart/related type. |
java.lang.String |
getParameter(java.lang.String attributeName)
Returns the value of a given attribute. |
static InternetMediaType |
getSOAPXML()
Returns the application/soap+xml type. |
java.lang.String |
getSubtype()
Returns the subtype. |
static InternetMediaType |
getTextHTML()
Returns the text/html type. |
static InternetMediaType |
getTextPlain()
Returns the text/plain type. |
java.lang.String |
getType()
Returns the main type. |
static InternetMediaType |
getXML()
Returns the application/xml type. |
int |
hashCode()
|
boolean |
hasMainType(java.lang.String type)
Checks whether this media type has the given main type. |
boolean |
hasParameter(java.lang.String attributeName)
Checks whether this parameter exists. |
boolean |
hasSubType(java.lang.String subtype)
Checks whether this media type has the given sub type. |
boolean |
hasType(java.lang.String type,
java.lang.String subtype)
Checks whether this media type has the given type. |
java.lang.String |
toString()
Returns a string representation of this media type. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InternetMediaType(java.lang.String type, java.lang.String subtype)
type
- media type.subtype
- media sub type.public InternetMediaType(java.lang.String type, java.lang.String subtype, java.lang.String[] parameterKeys, java.lang.String[] parameterValues)
type
- media type.subtype
- media sub type.parameterKeys
- key array for parameters.parameterValues
- value array for parameters.public InternetMediaType(java.lang.String type, java.lang.String subtype, java.lang.String parameterKey, java.lang.String parameterValue)
type
- media type.subtype
- media sub type.parameterKey
- key of the parameter.parameterValue
- value of the parameter.public InternetMediaType(java.lang.String mediaType)
mediaType
- the string describing the media type.Method Detail |
---|
public static final InternetMediaType getSOAPXML()
public static final InternetMediaType getXML()
public static final InternetMediaType getApplicationOctetStream()
public static final InternetMediaType getApplicationXOPXML()
public static final InternetMediaType getMultipartRelated()
public static final InternetMediaType getMultipartFormdata()
public static final InternetMediaType getApplicationXWWWFormUrlEncoded()
public static final InternetMediaType getImageJPEG()
public static final InternetMediaType getTextHTML()
public static final InternetMediaType getTextPlain()
public static InternetMediaType cloneAndSetParameters(InternetMediaType original, java.lang.String[] parameterKeys, java.lang.String[] parameterValues)
original
- InternetMediaType instance to clone.parameterKeys
- key array for parameters.parameterValues
- value array for parameters.
public static InternetMediaType cloneAndSetParameter(InternetMediaType original, java.lang.String parameterKey, java.lang.String parameterValue)
original
- InternetMediaType instance to clone.parameterKey
- key of the parameter.parameterValue
- value of the parameters.
public static InternetMediaType cloneAndAddParameters(InternetMediaType original, java.lang.String[] parameterKeys, java.lang.String[] parameterValues)
original
- InternetMediaType instance to clone.parameterKeys
- key array for parameters to add.parameterValues
- value array for parameters to add.
public static InternetMediaType cloneAndAddParameter(InternetMediaType original, java.lang.String parameterKey, java.lang.String parameterValue)
original
- InternetMediaType instance to clone.parameterKey
- key of the parameter to add.parameterValue
- value of the parameter to add.
public java.lang.String getMediaType()
public java.lang.String getType()
public java.lang.String getSubtype()
public boolean hasType(java.lang.String type, java.lang.String subtype)
type
- the main type to check against. Case insensitive.subtype
- the subtype to check against. Case insensitive.
true
if the object has the given type,
false
otherwise.public boolean hasMainType(java.lang.String type)
type
- the main type to check against. Case insensitive.
true
if the object has the given type,
false
otherwise.public boolean hasSubType(java.lang.String subtype)
subtype
- the sub type to check against. Case insensitive.
true
if the object has the given type,
false
otherwise.public java.lang.String getParameter(java.lang.String attributeName)
attributeName
- the name of the attribute to get the value of. Case
insensitive.
public boolean hasParameter(java.lang.String attributeName)
attributeName
- the parameter to check for.
true
if the object has the given parameter,
false
otherwise.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |