|
||||||||||
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 MimeEntityConfig |
config
|
protected int |
endState
|
protected org.apache.commons.logging.Log |
log
|
protected BodyDescriptor |
parent
|
protected int |
startState
|
protected int |
state
|
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()
|
Field |
getField()
This method is valid, if getState() returns EntityStates.T_FIELD . |
protected abstract int |
getLineNumber()
Returns the current line number or -1 if line number
information is not available. |
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 MimeEntityConfig config
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()
-1
if line number
information is not available.
protected abstract LineReaderInputStream getDataStream()
protected boolean parseField() throws MimeException, java.io.IOException
MimeException
java.io.IOException
public BodyDescriptor getBodyDescriptor()
Gets a descriptor for the current entity.
This method is valid if getState()
returns:
getBodyDescriptor
in interface EntityStateMachine
BodyDescriptor
, not nullspublic Field getField()
getState()
returns EntityStates.T_FIELD
.
getField
in interface EntityStateMachine
java.lang.IllegalStateException
- getState()
returns another
value than EntityStates.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 |