|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.sdedit.text.TextHandler
public class TextHandler
A DiagramDataProvider implementation, reading a diagram specification from a single string.
| Constructor Summary | |
|---|---|
TextHandler(String text)
Creates a new TextHandler for the given text. |
|
| Method Summary | |
|---|---|
boolean |
advance()
Reads the next line in the specification. |
boolean |
closeFragment()
Returns true if the last fragment returned by DiagramDataProvider.openFragment() is to be closed now (so it is a comment on the messages that were read between the last time DiagramDataProvider.openFragment() did not return null and now. |
String |
getAnnotation(Lifeline lifeline)
|
String |
getCurrentLine()
Returns the line that is currently read. |
String[] |
getDescription()
Returns an array of strings to be used as a description of the diagram. |
Pair<Lifeline,Integer> |
getEventAssociation()
If the current line specifies an association of a note to the current vertical position of a lifeline, this method returns a pair consisting of the lifeline and the note number. |
String |
getFragmentSeparator()
If the following messages belong to a new section of the most recently opened fragment, this method returns the title of the section, otherwise null |
int |
getLineBegin()
Returns the index of the first position of the current line in the specification. |
int |
getLineEnd()
Returns the index of the last position of the current line in the specification string. |
int |
getLineNumber()
|
Note |
getNote()
If there is a note specified at the current line and the subsequent lines, a Note representation is returned, otherwise null |
Object |
getState()
Gets the current state of the provider. |
String |
getText()
|
String |
getTitle()
Returns the diagram's title or null, if no title is defined |
MessageData |
nextMessage()
Returns the MessageData object made from the current line. |
Lifeline |
nextObject()
Returns the Lifeline object made from the current line}. |
String |
openFragment()
If at the current position in the data the beginning of a fragment is specified, the title of the fragment is returned, otherwise null. |
void |
setDiagram(Diagram diagram)
Sets the diagram instance that corresponds to the specification read by this TextHandler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextHandler(String text)
text - a diagram specification| Method Detail |
|---|
public void setDiagram(Diagram diagram)
setDiagram in interface DiagramDataProviderdiagram - the diagram that corresponds to the specification read by this
TextHandlerpublic int getLineBegin()
public Object getState()
DiagramDataProvider
getState in interface DiagramDataProviderpublic int getLineNumber()
public String getText()
public int getLineEnd()
public String getCurrentLine()
public String getTitle()
DiagramDataProvider
getTitle in interface DiagramDataProviderDiagramDataProvider.getTitle()public String[] getDescription()
DiagramDataProvider
getDescription in interface DiagramDataProviderpublic boolean advance()
advance in interface DiagramDataProviderpublic String openFragment()
DiagramDataProvider
openFragment in interface DiagramDataProviderpublic String getFragmentSeparator()
DiagramDataProvider
getFragmentSeparator in interface DiagramDataProviderpublic boolean closeFragment()
DiagramDataProvider
closeFragment in interface DiagramDataProvider
public MessageData nextMessage()
throws SyntaxError
nextMessage in interface DiagramDataProviderSyntaxError - if the next message cannot be parsed
public Lifeline nextObject()
throws SyntaxError
nextObject in interface DiagramDataProviderSyntaxError - if the next object declaration is not well-formedpublic String getAnnotation(Lifeline lifeline)
public Note getNote()
throws SyntaxError
getNote in interface DiagramDataProviderSyntaxError
public Pair<Lifeline,Integer> getEventAssociation()
throws SyntaxError
getEventAssociation in interface DiagramDataProviderSyntaxError
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||