|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.mime4j.parser.AbstractEntity
public abstract class AbstractEntity
Abstract MIME entity.
Field Summary | |
---|---|
protected MutableBodyDescriptor |
body
|
protected int |
endState
|
protected org.apache.commons.logging.Log |
log
|
protected boolean |
maximalBodyDescriptor
|
protected BodyDescriptor |
parent
|
protected int |
startState
|
protected int |
state
|
protected boolean |
strictParsing
|
Method Summary | |
---|---|
protected void |
debug(Event event)
Logs (at debug) an indicative message based on the given event and the current state of the system. |
BodyDescriptor |
getBodyDescriptor()
Gets a descriptor for the current entity. |
protected abstract LineReaderInputStream |
getDataStream()
|
java.lang.String |
getField()
This method is valid, if getState() returns #T_FIELD . |
java.lang.String |
getFieldName()
This method is valid, if getState() returns #T_FIELD . |
java.lang.String |
getFieldValue()
This method is valid, if getState() returns #T_FIELD . |
protected abstract int |
getLineNumber()
|
int |
getState()
Return the current state of the entity. |
protected java.lang.String |
message(Event event)
Creates an indicative message suitable for display based on the given event and the current state of the system. |
protected void |
monitor(Event event)
Monitors the given event. |
protected MutableBodyDescriptor |
newBodyDescriptor(BodyDescriptor pParent)
Creates a new instance of BodyDescriptor . |
protected boolean |
parseField()
|
static java.lang.String |
stateToString(int state)
Renders a state as a string suitable for logging. |
java.lang.String |
toString()
|
protected void |
warn(Event event)
Logs (at warn) an indicative message based on the given event and the current state of the system. |
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.parser.EntityStateMachine |
---|
advance, getContentStream, setRecursionMode |
Field Detail |
---|
protected final org.apache.commons.logging.Log log
protected final BodyDescriptor parent
protected final int startState
protected final int endState
protected final boolean maximalBodyDescriptor
protected final boolean strictParsing
protected final MutableBodyDescriptor body
protected int state
Method Detail |
---|
public int getState()
EntityStateMachine
getState
in interface EntityStateMachine
EntityStates
protected MutableBodyDescriptor newBodyDescriptor(BodyDescriptor pParent)
BodyDescriptor
. Subclasses may override
this in order to create body descriptors, that provide more specific
information.
protected abstract int getLineNumber()
protected abstract LineReaderInputStream getDataStream()
protected boolean parseField() throws java.io.IOException
java.io.IOException
public BodyDescriptor getBodyDescriptor()
Gets a descriptor for the current entity.
This method is valid if getState()
returns:
#T_BODY
#T_START_MULTIPART
#T_EPILOGUE
#T_PREAMBLE
getBodyDescriptor
in interface EntityStateMachine
BodyDescriptor
, not nullspublic java.lang.String getField()
getState()
returns #T_FIELD
.
getField
in interface EntityStateMachine
java.lang.IllegalStateException
- getState()
returns another
value than #T_FIELD
.public java.lang.String getFieldName()
getState()
returns #T_FIELD
.
getFieldName
in interface EntityStateMachine
java.lang.IllegalStateException
- getState()
returns another
value than #T_FIELD
.public java.lang.String getFieldValue()
getState()
returns #T_FIELD
.
getFieldValue
in interface EntityStateMachine
java.lang.IllegalStateException
- getState()
returns another
value than #T_FIELD
.protected void monitor(Event event) throws MimeException, java.io.IOException
event
- Event
, not null
MimeException
- subclasses may elect to throw this exception upon
invalid content
java.io.IOException
- subclasses may elect to throw this exceptionprotected java.lang.String message(Event event)
event
- Event
, not null
protected void warn(Event event)
event
- Event
, not nullprotected void debug(Event event)
event
- Event
, not nullpublic java.lang.String toString()
toString
in class java.lang.Object
public static final java.lang.String stateToString(int state)
state
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |