Package org.apache.james.mime4j.field
Class ContentTypeFieldLenientImpl
- java.lang.Object
-
- org.apache.james.mime4j.field.AbstractField
-
- org.apache.james.mime4j.field.ContentTypeFieldLenientImpl
-
- All Implemented Interfaces:
ContentTypeField
,ParsedField
,Field
public class ContentTypeFieldLenientImpl extends AbstractField implements ContentTypeField
Represents aContent-Type
field.
-
-
Field Summary
Fields Modifier and Type Field Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBoundary()
Gets the value of theboundary
parameter if set.String
getCharset()
Gets the value of thecharset
parameter if set.String
getMediaType()
Gets the media type defined in this Content-Type field.String
getMimeType()
Gets the MIME type defined in this Content-Type field.String
getParameter(String name)
Gets the value of a parameter.Map<String,String>
getParameters()
Gets all parameters.String
getSubType()
Gets the subtype defined in this Content-Type field.boolean
isMimeType(String mimeType)
Determines if the MIME type of this field matches the given one.boolean
isMultipart()
Determines if the MIME type of this field ismultipart/*
.-
Methods inherited from class org.apache.james.mime4j.field.AbstractField
getBody, getName, getNameLowerCase, getParseException, 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.stream.Field
getBody, getName, getNameLowerCase, getRaw
-
Methods inherited from interface org.apache.james.mime4j.dom.field.ParsedField
getParseException, isValidField
-
-
-
-
Field Detail
-
PARSER
public static final FieldParser<ContentTypeField> PARSER
-
-
Method Detail
-
getMimeType
public String getMimeType()
Description copied from interface:ContentTypeField
Gets the MIME type defined in this Content-Type field.- Specified by:
getMimeType
in interfaceContentTypeField
- Returns:
- the MIME type or an empty string if not set.
-
getMediaType
public String getMediaType()
Description copied from interface:ContentTypeField
Gets the media type defined in this Content-Type field.- Specified by:
getMediaType
in interfaceContentTypeField
-
getSubType
public String getSubType()
Description copied from interface:ContentTypeField
Gets the subtype defined in this Content-Type field.- Specified by:
getSubType
in interfaceContentTypeField
-
getParameter
public String getParameter(String name)
Description copied from interface:ContentTypeField
Gets the value of a parameter. Parameter names are case-insensitive.- Specified by:
getParameter
in interfaceContentTypeField
- Parameters:
name
- the name of the parameter to get.- Returns:
- the parameter value or
null
if not set.
-
getParameters
public Map<String,String> getParameters()
Description copied from interface:ContentTypeField
Gets all parameters.- Specified by:
getParameters
in interfaceContentTypeField
- Returns:
- the parameters.
-
isMimeType
public boolean isMimeType(String mimeType)
Description copied from interface:ContentTypeField
Determines if the MIME type of this field matches the given one.- Specified by:
isMimeType
in interfaceContentTypeField
- Parameters:
mimeType
- the MIME type to match against.- Returns:
true
if the MIME type of this field matches,false
otherwise.
-
isMultipart
public boolean isMultipart()
Description copied from interface:ContentTypeField
Determines if the MIME type of this field ismultipart/*
.- Specified by:
isMultipart
in interfaceContentTypeField
- Returns:
true
if this field is has amultipart/*
MIME type,false
otherwise.
-
getBoundary
public String getBoundary()
Description copied from interface:ContentTypeField
Gets the value of theboundary
parameter if set.- Specified by:
getBoundary
in interfaceContentTypeField
- Returns:
- the
boundary
parameter value ornull
if not set.
-
getCharset
public String getCharset()
Description copied from interface:ContentTypeField
Gets the value of thecharset
parameter if set.- Specified by:
getCharset
in interfaceContentTypeField
- Returns:
- the
charset
parameter value ornull
if not set.
-
-