|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.mime4j.field.AbstractField
org.apache.james.mime4j.field.ContentTypeFieldImpl
public class ContentTypeFieldImpl
Represents a Content-Type
field.
Field Summary | |
---|---|
static FieldParser<ContentTypeField> |
PARSER
|
Fields inherited from class org.apache.james.mime4j.field.AbstractField |
---|
monitor, rawField |
Fields inherited from interface org.apache.james.mime4j.dom.field.ContentTypeField |
---|
PARAM_BOUNDARY, PARAM_CHARSET, TYPE_MESSAGE_RFC822, TYPE_MULTIPART_DIGEST, TYPE_MULTIPART_PREFIX, TYPE_TEXT_PLAIN |
Method Summary | |
---|---|
java.lang.String |
getBoundary()
Gets the value of the boundary parameter if set. |
java.lang.String |
getCharset()
Gets the value of the charset parameter if set. |
static java.lang.String |
getCharset(ContentTypeField f)
Gets the value of the charset parameter if set for the
given field. |
java.lang.String |
getMediaType()
Gets the media type defined in this Content-Type field. |
java.lang.String |
getMimeType()
Gets the MIME type defined in this Content-Type field. |
static java.lang.String |
getMimeType(ContentTypeField child,
ContentTypeField parent)
Gets the MIME type defined in the child's Content-Type field or derives a MIME type from the parent if child is null or hasn't got a
MIME type value set. |
java.lang.String |
getParameter(java.lang.String name)
Gets the value of a parameter. |
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Gets all parameters. |
org.apache.james.mime4j.field.contenttype.parser.ParseException |
getParseException()
Returns the exception that was thrown by the field parser while parsing the field value. |
java.lang.String |
getSubType()
Gets the subtype defined in this Content-Type field. |
boolean |
isMimeType(java.lang.String mimeType)
Determines if the MIME type of this field matches the given one. |
boolean |
isMultipart()
Determines if the MIME type of this field is multipart/* . |
Methods inherited from class org.apache.james.mime4j.field.AbstractField |
---|
getBody, getName, getRaw, getRawField, isValidField, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.james.mime4j.dom.field.ParsedField |
---|
isValidField |
Methods inherited from interface org.apache.james.mime4j.stream.Field |
---|
getBody, getName, getRaw |
Field Detail |
---|
public static final FieldParser<ContentTypeField> PARSER
Method Detail |
---|
public org.apache.james.mime4j.field.contenttype.parser.ParseException getParseException()
ParsedField
null
if the field is valid
and no errors were encountered.
getParseException
in interface ParsedField
getParseException
in class AbstractField
null
if the field is valid.ParsedField.getParseException()
public java.lang.String getMimeType()
ContentTypeField
getMimeType
in interface ContentTypeField
ContentTypeField.getMimeType()
public java.lang.String getMediaType()
ContentTypeField
getMediaType
in interface ContentTypeField
ContentTypeField.getMediaType()
public java.lang.String getSubType()
ContentTypeField
getSubType
in interface ContentTypeField
ContentTypeField.getSubType()
public java.lang.String getParameter(java.lang.String name)
ContentTypeField
getParameter
in interface ContentTypeField
name
- the name of the parameter to get.
null
if not set.ContentTypeField.getParameter(java.lang.String)
public java.util.Map<java.lang.String,java.lang.String> getParameters()
ContentTypeField
getParameters
in interface ContentTypeField
ContentTypeField.getParameters()
public boolean isMimeType(java.lang.String mimeType)
ContentTypeField
isMimeType
in interface ContentTypeField
mimeType
- the MIME type to match against.
true
if the MIME type of this field matches,
false
otherwise.ContentTypeField.isMimeType(java.lang.String)
public boolean isMultipart()
ContentTypeField
multipart/*
.
isMultipart
in interface ContentTypeField
true
if this field is has a
multipart/*
MIME type, false
otherwise.ContentTypeField.isMultipart()
public java.lang.String getBoundary()
ContentTypeField
boundary
parameter if set.
getBoundary
in interface ContentTypeField
boundary
parameter value or null
if not set.ContentTypeField.getBoundary()
public java.lang.String getCharset()
ContentTypeField
charset
parameter if set.
getCharset
in interface ContentTypeField
charset
parameter value or null
if not set.ContentTypeField.getCharset()
public static java.lang.String getMimeType(ContentTypeField child, ContentTypeField parent)
null
or hasn't got a
MIME type value set. If child's MIME type is multipart but no boundary
has been set the MIME type of child will be derived from the parent.
child
- the child.parent
- the parent.
public static java.lang.String getCharset(ContentTypeField f)
charset
parameter if set for the
given field. Returns the default us-ascii
if not set or if
f
is null
.
charset
parameter value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |