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-Typefield.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmediaTypeprivate java.lang.StringmimeTypeprivate java.util.Map<java.lang.String,java.lang.String>parametersprivate booleanparsedstatic FieldParser<ContentTypeField>PARSERprivate java.lang.StringsubType-
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
-
-
Constructor Summary
Constructors Constructor Description ContentTypeFieldLenientImpl(Field rawField, DecodeMonitor monitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBoundary()Gets the value of theboundaryparameter if set.java.lang.StringgetCharset()Gets the value of thecharsetparameter if set.java.lang.StringgetMediaType()Gets the media type defined in this Content-Type field.java.lang.StringgetMimeType()Gets the MIME type defined in this Content-Type field.java.lang.StringgetParameter(java.lang.String name)Gets the value of a parameter.java.util.Map<java.lang.String,java.lang.String>getParameters()Gets all parameters.java.lang.StringgetSubType()Gets the subtype defined in this Content-Type field.booleanisMimeType(java.lang.String mimeType)Determines if the MIME type of this field matches the given one.booleanisMultipart()Determines if the MIME type of this field ismultipart/*.private voidparse()-
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.dom.field.ContentTypeField
bodyDescriptionField
-
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
-
parsed
private boolean parsed
-
mimeType
private java.lang.String mimeType
-
mediaType
private java.lang.String mediaType
-
subType
private java.lang.String subType
-
parameters
private final java.util.Map<java.lang.String,java.lang.String> parameters
-
PARSER
public static final FieldParser<ContentTypeField> PARSER
-
-
Constructor Detail
-
ContentTypeFieldLenientImpl
ContentTypeFieldLenientImpl(Field rawField, DecodeMonitor monitor)
-
-
Method Detail
-
getMimeType
public java.lang.String getMimeType()
Description copied from interface:ContentTypeFieldGets the MIME type defined in this Content-Type field.- Specified by:
getMimeTypein interfaceContentTypeField- Returns:
- the MIME type or an empty string if not set.
-
getMediaType
public java.lang.String getMediaType()
Description copied from interface:ContentTypeFieldGets the media type defined in this Content-Type field.- Specified by:
getMediaTypein interfaceContentTypeField
-
getSubType
public java.lang.String getSubType()
Description copied from interface:ContentTypeFieldGets the subtype defined in this Content-Type field.- Specified by:
getSubTypein interfaceContentTypeField
-
getParameter
public java.lang.String getParameter(java.lang.String name)
Description copied from interface:ContentTypeFieldGets the value of a parameter. Parameter names are case-insensitive.- Specified by:
getParameterin interfaceContentTypeField- Parameters:
name- the name of the parameter to get.- Returns:
- the parameter value or
nullif not set.
-
getParameters
public java.util.Map<java.lang.String,java.lang.String> getParameters()
Description copied from interface:ContentTypeFieldGets all parameters.- Specified by:
getParametersin interfaceContentTypeField- Returns:
- the parameters.
-
isMimeType
public boolean isMimeType(java.lang.String mimeType)
Description copied from interface:ContentTypeFieldDetermines if the MIME type of this field matches the given one.- Specified by:
isMimeTypein interfaceContentTypeField- Parameters:
mimeType- the MIME type to match against.- Returns:
trueif the MIME type of this field matches,falseotherwise.
-
isMultipart
public boolean isMultipart()
Description copied from interface:ContentTypeFieldDetermines if the MIME type of this field ismultipart/*.- Specified by:
isMultipartin interfaceContentTypeField- Returns:
trueif this field is has amultipart/*MIME type,falseotherwise.
-
getBoundary
public java.lang.String getBoundary()
Description copied from interface:ContentTypeFieldGets the value of theboundaryparameter if set.- Specified by:
getBoundaryin interfaceContentTypeField- Returns:
- the
boundaryparameter value ornullif not set.
-
getCharset
public java.lang.String getCharset()
Description copied from interface:ContentTypeFieldGets the value of thecharsetparameter if set.- Specified by:
getCharsetin interfaceContentTypeField- Returns:
- the
charsetparameter value ornullif not set.
-
parse
private void parse()
-
-