|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectccs.mime.MimeHeader
public class MimeHeader
The basic MIME header syntax defines a name/value pair. However, there is also a mechanism for the value to be refined with an arbitray set of parameters. This extended syntax looks like this:
name: value; paramname=paramvalue; paramname=paramvalue; [...]
The basic name/value syntax is handled by HeaderedEntity. This class
allows the extended syntax to be manipulated. It also optionally stores the
rest of the header information (name and index of the header in the parent
HeaderedEntity) as a convenience. It tolerates RFC822-style comments, and removes
then during parsing.MT-UNSAFE.
| Constructor Summary | |
|---|---|
MimeHeader(HeaderedEntity parent,
int index,
java.lang.String name,
java.lang.String raw)
A MimeHeader which decodes the value part of the header into a value and a set of parameters, and also stores other optional information about the header. |
|
MimeHeader(java.lang.String raw)
A MimeHeader which decodes the value part of the header into a value and a set of parameters. |
|
| Method Summary | |
|---|---|
java.lang.String |
compile()
Return the value and parameter set as a raw header value. |
void |
deleteParam(java.lang.String paramName)
Delete the parameter with the specified name. |
int |
getIndex()
Return the index of this header in the parent entity. |
java.lang.String |
getName()
Return the name of this header. |
java.lang.String |
getParam(java.lang.String paramName)
Return the value of the parameter with the specified name, or null if there is none such. |
java.lang.String[] |
getParamNames()
Return the list of available param names. |
HeaderedEntity |
getParent()
Return the HeaderedEntity this belongs to |
java.lang.String |
getValue()
Return the processed value (no parameters). |
void |
setParam(java.lang.String paramName,
java.lang.String paramValue)
Add a new parameter or change the value of an existing one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MimeHeader(java.lang.String raw)
raw - The raw value, with any parameters and / or comments
public MimeHeader(HeaderedEntity parent,
int index,
java.lang.String name,
java.lang.String raw)
parent - The HeaderedEntity this header came in.index - The index of this header in the entity's header list.name - The header's name.raw - The raw value, with any parameters and / or comments embedded.| Method Detail |
|---|
public HeaderedEntity getParent()
public int getIndex()
public java.lang.String getName()
public java.lang.String getValue()
public java.lang.String getParam(java.lang.String paramName)
paramName - the name of the parameter. This must be in lowercase, or
it won't get anything. (Parameter names are specified to be case-insensitive).
public void setParam(java.lang.String paramName,
java.lang.String paramValue)
paramName - The name of the parameter.paramValue - The (new) value of the parameter.public void deleteParam(java.lang.String paramName)
paramName - The name of the parameter to delete.public java.lang.String[] getParamNames()
public java.lang.String compile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||