public abstract class AbstractEntity extends java.lang.Object implements Entity
| Modifier and Type | Field and Description |
|---|---|
private Body |
body |
private Header |
header |
private Entity |
parent |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEntity()
Creates a new
Entity. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.lang.String |
calcCharset(ContentTypeField contentType) |
protected abstract java.lang.String |
calcMimeType(ContentTypeField child,
ContentTypeField parent) |
protected abstract java.lang.String |
calcTransferEncoding(ContentTransferEncodingField f) |
void |
dispose()
Disposes of the body of this entity.
|
Body |
getBody()
Gets the body of this entity.
|
java.lang.String |
getCharset()
Determines the MIME character set encoding of this
Entity. |
java.lang.String |
getContentTransferEncoding()
Determines the transfer encoding of this
Entity. |
private ContentTypeField |
getContentTypeField() |
java.lang.String |
getDispositionType()
Return the disposition type of the content disposition of this
Entity. |
java.lang.String |
getFilename()
Returns the filename parameter of the content disposition of this
Entity. |
Header |
getHeader()
Gets the entity header.
|
java.lang.String |
getMimeType()
Determines the MIME type of this
Entity. |
Entity |
getParent()
Gets the parent entity of this entity.
|
boolean |
isMultipart()
Determines if the MIME type of this
Entity is
multipart/*. |
(package private) <F extends ParsedField> |
obtainField(java.lang.String fieldName)
Obtains the header field with the specified name.
|
(package private) Header |
obtainHeader()
Obtains the header of this entity.
|
Body |
removeBody()
Removes and returns the body of this entity.
|
void |
setBody(Body body)
Sets the body of this entity.
|
void |
setHeader(Header header)
Sets the entity header.
|
void |
setParent(Entity parent)
Sets the parent entity of this entity.
|
protected AbstractEntity()
Entity. Typically invoked implicitly by a
subclass constructor.public Entity getParent()
null if this is the root entity.public void setParent(Entity parent)
public Header getHeader()
public void setHeader(Header header)
public Body getBody()
public void setBody(Body body)
public Body removeBody()
disposed of.removeBody in interface Entitynull if no body was set.public java.lang.String getMimeType()
EntityEntity. The MIME type
is derived by looking at the parent's Content-Type field if no
Content-Type field is set for this Entity.getMimeType in interface Entityprivate ContentTypeField getContentTypeField()
public java.lang.String getCharset()
Entity.getCharset in interface Entitypublic java.lang.String getContentTransferEncoding()
Entity.getContentTransferEncoding in interface Entitypublic java.lang.String getDispositionType()
Entity.getDispositionType in interface Entitynull if no disposition
type has been set.public java.lang.String getFilename()
Entity.getFilename in interface Entitynull if the filename has not been set.public boolean isMultipart()
Entity is
multipart/*. Since multipart-entities must have
a boundary parameter in the Content-Type field this
method returns false if no boundary exists.isMultipart in interface Entitytrue on match, false otherwise.public void dispose()
dispose in interface DisposableDisposable.dispose()Header obtainHeader()
null.null.<F extends ParsedField> F obtainField(java.lang.String fieldName)
F - concrete field type.fieldName - name of the field to retrieve.null if this entity has no
header or the header contains no such field.protected abstract java.lang.String calcMimeType(ContentTypeField child, ContentTypeField parent)
protected abstract java.lang.String calcTransferEncoding(ContentTransferEncodingField f)
protected abstract java.lang.String calcCharset(ContentTypeField contentType)