|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.util.ContentType
public class ContentType
Represents an HTTP content type. Allows to set various elements like the mime type, the character set, and other parameters. This is similar to a number of other implementations of the same concept in JAF, etc. We have created this simple implementation to avoid including the whole libraries.
Constructor Summary | |
---|---|
ContentType()
Creates a new empty content type |
|
ContentType(java.lang.String contentType)
Creates a new content type from the argument. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Returns true only if the other object is another instance of ContentType, and has the ssame baseType, subType and set of parameters. |
java.lang.String |
getBaseType()
|
java.lang.String |
getMimeType()
|
java.lang.String |
getParameter(java.lang.String key)
|
java.lang.String[] |
getParameterNames()
|
java.lang.String |
getSubType()
|
void |
parse(java.lang.String contentType)
Parses the argument and configures the content type accordingly. |
void |
setBaseType(java.lang.String baseType)
|
void |
setParameter(java.lang.String key,
java.lang.String value)
|
void |
setSubType(java.lang.String subType)
|
java.lang.String |
toString()
|
java.lang.String |
unparse()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContentType()
public ContentType(java.lang.String contentType)
contentType
- the content type that needs to be representedMethod Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String getBaseType()
public void setBaseType(java.lang.String baseType)
baseType
- public java.lang.String getSubType()
public void setSubType(java.lang.String subType)
subType
- public java.lang.String getMimeType()
public java.lang.String[] getParameterNames()
public java.lang.String getParameter(java.lang.String key)
key
- the name of the content type parameter
public void setParameter(java.lang.String key, java.lang.String value)
key
- the name of the content type parametervalue
- the value of the content type parameterpublic void parse(java.lang.String contentType)
contentType
- the content type that needs to be representedpublic java.lang.String unparse()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |