|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.ContentType
public final 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(String contentType)
Creates a new content type from the argument. |
|
ContentType(String contentType,
String charset)
Creates a new content type with the given MIME type and charset |
Method Summary | |
---|---|
boolean |
equals(Object o)
Returns true only if the other object is another instance of ContentType, and has the ssame baseType, subType and set of parameters. |
String |
getBaseType()
|
String |
getCharset()
|
String |
getMimeType()
|
String |
getParameter(String key)
|
List<String> |
getParameterNames()
|
String |
getSubType()
|
void |
parse(String contentType)
Parses the argument and configures the content type accordingly. |
void |
setBaseType(String baseType)
|
void |
setParameter(String key,
String value)
|
void |
setSubType(String subType)
|
String |
toString()
|
String |
unparse()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContentType()
public ContentType(String contentType)
contentType
- the content type that needs to be representedpublic ContentType(String contentType, String charset)
Method Detail |
---|
public boolean equals(Object o)
equals
in class Object
public String getBaseType()
public void setBaseType(String baseType)
baseType
- public String getSubType()
public void setSubType(String subType)
subType
- public String getMimeType()
public List<String> getParameterNames()
public String getCharset()
public String getParameter(String key)
key
- the name of the content type parameter
public void setParameter(String key, String value)
key
- the name of the content type parametervalue
- the value of the content type parameterpublic void parse(String contentType)
contentType
- the content type that needs to be representedpublic String unparse()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |