public class EmailDocumentHandler extends Object
Modifier and Type | Field and Description |
---|---|
protected List<StatusListener> |
myStatusListeners |
Constructor and Description |
---|
EmailDocumentHandler()
Constructor used in tests mostly
|
EmailDocumentHandler(Document aGateDocument,
Map<String,String> aMarkupElementsMap,
Map<String,String> anElement2StringMap)
Constructor initialises some private fields
|
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(StatusListener listener)
This methos is called when a listener is registered with this class
|
void |
annotateMessages()
Reads the Gate Document line by line and does the folowing things:
Each line is analized in order to detect where an e-mail starts.
|
protected boolean |
containsSemicolon(String aString)
This method checks if a String contains a semicolon char
|
protected boolean |
containsWhiteSpaces(String aString)
This method checks if a String contains white spaces.
|
protected void |
fireStatusChangedEvent(String text)
This methos is called whenever we need to inform the listener
about an event.
|
protected boolean |
hasAMeaning(String aToken)
This method tests a token if is Day, Month, Zone, Time, Year
|
protected boolean |
isTime(String aToken)
Tests a token if is in time format HH:MM:SS
|
protected boolean |
lineBeginsMessage(String aTextLine)
Tests if the line begins an e-mail message
|
protected boolean |
lineBeginsWithField(String aTextLine)
Tests if the line begins with a field from the e-mail header
If the answer is true then it also sets the member fieldName with the
value of this e-mail header field.
|
void |
removeStatusListener(StatusListener listener)
This methos is called when a listener is removed
|
protected List<StatusListener> myStatusListeners
public EmailDocumentHandler()
public void annotateMessages() throws IOException, InvalidOffsetException
IOException
InvalidOffsetException
protected boolean lineBeginsMessage(String aTextLine)
aTextLine
- a line from the file containing the e-mail messagesprotected boolean lineBeginsWithField(String aTextLine)
aTextLine
- a line from the file containing the e-mail textprotected boolean containsWhiteSpaces(String aString)
protected boolean containsSemicolon(String aString)
protected boolean hasAMeaning(String aToken)
protected boolean isTime(String aToken)
public void addStatusListener(StatusListener listener)
public void removeStatusListener(StatusListener listener)
protected void fireStatusChangedEvent(String text)
Copyright © 2024 GATE. All rights reserved.