|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DiagramDataProvider
A DiagramDataProvider reads object and message specifications from some source and creates Lifeline and MessageData representations from them.
It should be used in such a way:
DiagramDataProvider provider = new ...;
while (provider.advance()) {
Lifeline lifeline = provider.nextObject();
// do something with the lifeline
}
while (provider.advance()) {
String comment = provider.openComment();
if (comment != null) {
// handle the comment, if you are interested
continue;
}
if (provider.closeComment()) {
// the comment most recently returned by openComment() is
// closed, so react to it, if you are interested
continue;
}
MessageData data = provider.nextMessage();
// do something with the message data
}
| Method Summary | |
|---|---|
boolean |
advance()
Advances to the next data specification in the current section and returns true if there is one. |
boolean |
closeFragment()
Returns true if the last fragment returned by openFragment() is to be closed now (so it is a comment on the messages that were read between the last time openFragment() did not return null and now. |
String[] |
getDescription()
Returns an array of strings to be used as a description of the diagram. |
Pair<Lifeline,Integer> |
getEventAssociation()
Returns a pair consisting of a lifeline and the number of a description if the description is to be associated to the lifeline at the current position. |
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 |
Note |
getNote()
If at the current position in the data a note is specified, returns it, otherwise null. |
Object |
getState()
Gets the current state of the provider. |
String |
getTitle()
Returns the diagram's title or null, if no title is defined |
MessageData |
nextMessage()
Returns the next MessageData object specifying a message appearing on the diagram. |
Lifeline |
nextObject()
Returns the next Lifeline object specifying an object or actor appearing on the diagram. |
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 that uses this DiagramDataProvider. |
| Method Detail |
|---|
String getTitle()
String[] getDescription()
boolean advance()
Lifeline nextObject()
throws SyntaxError
SyntaxError - if the object is specified syntactically wrong
MessageData nextMessage()
throws SyntaxError
SyntaxError - if the message is specified syntactically wrongObject getState()
String openFragment()
boolean closeFragment()
Note getNote()
throws SyntaxError
SyntaxErrorvoid setDiagram(Diagram diagram)
diagram - the diagram that uses this DiagramDataProvider
Pair<Lifeline,Integer> getEventAssociation()
throws SyntaxError
SyntaxErrorString getFragmentSeparator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||