|
jxUtil 0.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sourceforge.jxutil.net.ContentType
The ContentType class implements RFC 822 style content types. Instances of ContentType are immutable like Strings.
Field Summary | |
static ContentType |
anyUni
|
private int |
hashCode
Cached hashCode value. |
static ContentType |
imageUni
|
private String[] |
parameter
The optional parameter part. |
private String |
subtype
The subtype part. |
static ContentType |
textUni
|
private String |
type
The type part. |
static ContentType |
unknown
|
Constructor Summary | |
|
ContentType(String s)
Initialise a ContentType from its String representation. |
|
ContentType(String type,
String subtype,
Map paramMap)
|
private |
ContentType(String type,
String subtype,
String[] parameter)
|
Method Summary | |
ContentType |
addParam(Map paramMap)
Return a new ContentType with the given key/value pairs added to its parameters. |
ContentType |
addParam(String key,
String value)
Return a new ContentType with the given key/value pair added to its parameters. |
int |
compareTo(Object o)
Compare. |
boolean |
equals(Object obj)
|
static ContentType |
forClass(Class cl)
|
String |
getParameter(String key)
Get the value of a parameter. |
String |
getParameter(String key,
String def)
Get the value of a parameter with default. |
Map |
getParameters()
Copy the parameters into a map. |
String |
getSubType()
Access subtype field. |
String |
getType()
Access type field. |
ContentType |
getUniversalType()
Return a ContentType which is a parent of this type. |
int |
hashCode()
Return the cached hashCode. |
boolean |
isUniversal()
|
private String[] |
makeParameter(Map paramMap)
|
boolean |
matches(ContentType ctype)
|
String |
toString()
Format the the ContentType instance into its String representatsion. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final ContentType anyUni
private final int hashCode
public static final ContentType imageUni
private final String[] parameter
private final String subtype
public static final ContentType textUni
private final String type
public static final ContentType unknown
Constructor Detail |
public ContentType(String s) throws NullPointerException
public ContentType(String type, String subtype, Map paramMap)
private ContentType(String type, String subtype, String[] parameter)
Method Detail |
public final ContentType addParam(Map paramMap)
public final ContentType addParam(String key, String value)
public final int compareTo(Object o)
compareTo
in interface Comparable
public boolean equals(Object obj)
equals
in class Object
public static final ContentType forClass(Class cl)
public final String getParameter(String key)
public final String getParameter(String key, String def)
public final Map getParameters()
public final String getSubType()
public final String getType()
public final ContentType getUniversalType()
public final int hashCode()
hashCode
in class Object
public boolean isUniversal()
private String[] makeParameter(Map paramMap)
public boolean matches(ContentType ctype)
public final String toString()
toString
in class Object
|
jxUtil 0.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |