|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.uml.generator.Parser
org.argouml.uml.generator.ParserDisplay
Field Summary | |
protected static org.apache.log4j.Category |
_cat
The standard error etc. |
static ParserDisplay |
SINGLETON
|
Method Summary | |
java.lang.Object |
parseAction(java.lang.String s)
|
void |
parseAttribute(java.lang.String s,
ru.novosoft.uml.foundation.core.MAttribute attr)
Parse a line on the form: visibility name [: type-expression] [= initial-value] If only one of visibility and name is given, then it is assumed to be the name and the visibility is left unchanged. |
void |
parseAttributeFig(ru.novosoft.uml.foundation.core.MClassifier cls,
ru.novosoft.uml.foundation.core.MAttribute at,
java.lang.String text)
Parse a string representing one ore more ';' separated attributes. |
void |
parseClassifierRole(ru.novosoft.uml.behavior.collaborations.MClassifierRole cls,
java.lang.String s)
Parses a line on the form: baselist := [base] [, base]* classifierRole := [name] [/ role] [: baselist] |
void |
parseComponentInstance(ru.novosoft.uml.behavior.common_behavior.MComponentInstance coi,
java.lang.String s)
Parse a line of the form: "name : base-component" |
ru.novosoft.uml.behavior.state_machines.MEvent |
parseEvent(java.lang.String s)
|
ru.novosoft.uml.behavior.use_cases.MExtensionPoint |
parseExtensionPoint(java.lang.String text)
Parse a string representing an extension point and return a new extension point. |
void |
parseExtensionPointFig(ru.novosoft.uml.behavior.use_cases.MUseCase useCase,
ru.novosoft.uml.behavior.use_cases.MExtensionPoint ep,
java.lang.String text)
Parse an extension point. |
ru.novosoft.uml.behavior.state_machines.MGuard |
parseGuard(java.lang.String s)
|
void |
parseMessage(ru.novosoft.uml.behavior.collaborations.MMessage mes,
java.lang.String s)
Parses a message line on the form: intno := integer|name seq := intno ['.' intno]* recurrance := '*'['//'] | '*'['//']'['iteration']' | '['condition']' seqelem := {[intno] ['['recurrance']']} seq2 := seqelem ['.' seqelem]* ret_list := lvalue [',' lvalue]* arg_list := rvalue [',' rvalue]* message := [seq [',' seq]* '/'] seq2 ':' [ret_list :=] name ([arg_list]) |
void |
parseModelElement(ru.novosoft.uml.foundation.core.MModelElement me,
java.lang.String text)
Parses a model element, ie reads a string on the format: [<< stereotype >>] [name] and assigns the properties to the passed MModelElement. |
ru.novosoft.uml.foundation.data_types.MMultiplicity |
parseMultiplicity(java.lang.String s)
Parse a string of the form: "range, ...", where range is of the form "lower..upper", or "integer" |
void |
parseNodeInstance(ru.novosoft.uml.behavior.common_behavior.MNodeInstance noi,
java.lang.String s)
Parse a line of the form: "name : base-node" |
void |
parseObject(ru.novosoft.uml.behavior.common_behavior.MObject obj,
java.lang.String s)
Parse a line of the form: "name: base-class" |
void |
parseOperation(java.lang.String s,
ru.novosoft.uml.foundation.core.MOperation op)
Parse a line of text and aligns the MOperation to the specification given. |
void |
parseOperationFig(ru.novosoft.uml.foundation.core.MClassifier cls,
ru.novosoft.uml.foundation.core.MOperation op,
java.lang.String text)
Parse a string representing one ore more ';' separated operations. |
protected java.lang.String |
parseOutInitValue(ru.novosoft.uml.foundation.core.MAttribute attr,
java.lang.String s)
|
protected java.lang.String |
parseOutMultiplicity(ru.novosoft.uml.foundation.core.MAttribute f,
java.lang.String s)
Parses a string for multiplicity and sets the multiplicity with the given attribute. |
java.lang.String |
parseOutName(ru.novosoft.uml.foundation.core.MModelElement me,
java.lang.String s)
Parses the name of modelelement me from some input string s. |
java.lang.String |
parseOutParams(ru.novosoft.uml.foundation.core.MOperation op,
java.lang.String s)
Parses the parameters with an operation. |
protected java.lang.String |
parseOutProperties(ru.novosoft.uml.foundation.core.MAttribute a,
java.lang.String s)
Parses the properties for some attribute a out of a string s. |
protected java.lang.String |
parseOutProperties(ru.novosoft.uml.foundation.core.MOperation op,
java.lang.String s)
|
protected java.lang.String |
parseOutReturnType(ru.novosoft.uml.foundation.core.MOperation op,
java.lang.String s)
Parses the return type for an operation. |
java.lang.String |
parseOutType(ru.novosoft.uml.foundation.core.MAttribute attr,
java.lang.String s)
Parses the user given string s for the type of an attribute. |
java.lang.String |
parseOutVisibility(ru.novosoft.uml.foundation.core.MFeature f,
java.lang.String s)
Parses a string for visibilitykind. |
ru.novosoft.uml.foundation.core.MParameter |
parseParameter(java.lang.String s)
|
ru.novosoft.uml.behavior.state_machines.MState |
parseState(java.lang.String s)
|
void |
parseStateBody(ru.novosoft.uml.behavior.state_machines.MState st,
java.lang.String s)
parse user input for state bodies and assign the individual lines to according actions or transistions. |
void |
parseStateDoAction(ru.novosoft.uml.behavior.state_machines.MState st,
java.lang.String s)
|
void |
parseStateEntyAction(ru.novosoft.uml.behavior.state_machines.MState st,
java.lang.String s)
|
void |
parseStateExitAction(ru.novosoft.uml.behavior.state_machines.MState st,
java.lang.String s)
|
ru.novosoft.uml.foundation.extension_mechanisms.MStereotype |
parseStereotype(java.lang.String s)
|
void |
parseStimulus(ru.novosoft.uml.behavior.common_behavior.MStimulus sti,
java.lang.String s)
Parse a line of the form: "name: action" |
ru.novosoft.uml.foundation.extension_mechanisms.MTaggedValue |
parseTaggedValue(java.lang.String s)
|
ru.novosoft.uml.behavior.state_machines.MTransition |
parseTransition(ru.novosoft.uml.behavior.state_machines.MTransition trans,
java.lang.String s)
Parse a line of the form: "name: trigger [guard] / actions" |
Methods inherited from class org.argouml.uml.generator.Parser |
parseExpression, parseName, parseUninterpreted |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static ParserDisplay SINGLETON
protected static final org.apache.log4j.Category _cat
Method Detail |
public void parseExtensionPointFig(ru.novosoft.uml.behavior.use_cases.MUseCase useCase, ru.novosoft.uml.behavior.use_cases.MExtensionPoint ep, java.lang.String text)
Parse an extension point.
The syntax is "name: location", "name:", "location" or "". The fields of the extension point are updated appropriately.
useCase
- The use case that owns this extension pointep
- The extension point concernedtext
- The text to parsepublic void parseModelElement(ru.novosoft.uml.foundation.core.MModelElement me, java.lang.String text) throws java.text.ParseException
me
- The MModelElement text describes.text
- A String on the above format.
java.text.ParseException
- when it detects an error in the
attribute string. See also ParseError.getErrorOffset().public void parseOperationFig(ru.novosoft.uml.foundation.core.MClassifier cls, ru.novosoft.uml.foundation.core.MOperation op, java.lang.String text) throws java.text.ParseException
text
- The classifier the operation(s) belong to
java.text.ParseException
public void parseAttributeFig(ru.novosoft.uml.foundation.core.MClassifier cls, ru.novosoft.uml.foundation.core.MAttribute at, java.lang.String text) throws java.text.ParseException
text
- The classifier the attribute(s) belong to
java.text.ParseException
public ru.novosoft.uml.behavior.use_cases.MExtensionPoint parseExtensionPoint(java.lang.String text)
Parse a string representing an extension point and return a new extension point.
The syntax is "name: location", "name:", "location" or "". Note. If either field is blank, it will be set to null in the extension point.
We break up the string into tokens at the ":". We must keep the ":" as a token, so we can distinguish between "name:" and "location". The number of tokens will distinguish our four cases.
parseExtensionPoint
in class Parser
text
- The string to parse
null
if we are given null
or a
blank string. Note. The string ":" can be used to
set both name and location to null.public void parseOperation(java.lang.String s, ru.novosoft.uml.foundation.core.MOperation op) throws java.text.ParseException
All elements are optional and, if left unspecified, will preserve
their old values.
A stereotype can be given between any element in the line
on the form: <<stereotype>>
The following properties are recognized to have special meaning: abstract, concurrency, concurrent, guarded, leaf, query, root and sequential.
This syntax is compatible with the UML 1.3 spec.
parseOperation
in class Parser
s
- The String to parse.op
- The MOperation to adjust to the spcification in s.
java.text.ParseException
- when it detects an error in the
attribute string. See also ParseError.getErrorOffset().protected java.lang.String parseOutMultiplicity(ru.novosoft.uml.foundation.core.MAttribute f, java.lang.String s)
f
- s
-
public void parseAttribute(java.lang.String s, ru.novosoft.uml.foundation.core.MAttribute attr) throws java.text.ParseException
The following properties are recognized to have special meaning: frozen.
This syntax is compatible with the UML 1.3 spec.
parseAttribute
in class Parser
s
- The String to parse.attr
- The attribute to modify to comply with the instructions in s.
java.text.ParseException
- when it detects an error in the
attribute string. See also ParseError.getErrorOffset().protected java.lang.String parseOutProperties(ru.novosoft.uml.foundation.core.MAttribute a, java.lang.String s)
a
- s
-
protected java.lang.String parseOutProperties(ru.novosoft.uml.foundation.core.MOperation op, java.lang.String s)
public java.lang.String parseOutVisibility(ru.novosoft.uml.foundation.core.MFeature f, java.lang.String s)
f
- The feature the visibility is part ofs
- The string that possibly identifies some visibility
public java.lang.String parseOutParams(ru.novosoft.uml.foundation.core.MOperation op, java.lang.String s)
op
- s
-
public java.lang.String parseOutName(ru.novosoft.uml.foundation.core.MModelElement me, java.lang.String s)
me
- s
-
public java.lang.String parseOutType(ru.novosoft.uml.foundation.core.MAttribute attr, java.lang.String s)
attr
- s
-
protected java.lang.String parseOutReturnType(ru.novosoft.uml.foundation.core.MOperation op, java.lang.String s)
op
- s
-
protected java.lang.String parseOutInitValue(ru.novosoft.uml.foundation.core.MAttribute attr, java.lang.String s)
public ru.novosoft.uml.foundation.core.MParameter parseParameter(java.lang.String s)
parseParameter
in class Parser
public ru.novosoft.uml.foundation.extension_mechanisms.MStereotype parseStereotype(java.lang.String s)
parseStereotype
in class Parser
public ru.novosoft.uml.foundation.extension_mechanisms.MTaggedValue parseTaggedValue(java.lang.String s)
parseTaggedValue
in class Parser
public ru.novosoft.uml.foundation.data_types.MMultiplicity parseMultiplicity(java.lang.String s)
parseMultiplicity
in class Parser
public ru.novosoft.uml.behavior.state_machines.MState parseState(java.lang.String s)
parseState
in class Parser
public void parseStateBody(ru.novosoft.uml.behavior.state_machines.MState st, java.lang.String s)
public void parseStateEntyAction(ru.novosoft.uml.behavior.state_machines.MState st, java.lang.String s)
public void parseStateExitAction(ru.novosoft.uml.behavior.state_machines.MState st, java.lang.String s)
public void parseStateDoAction(ru.novosoft.uml.behavior.state_machines.MState st, java.lang.String s)
public ru.novosoft.uml.behavior.state_machines.MTransition parseTransition(ru.novosoft.uml.behavior.state_machines.MTransition trans, java.lang.String s)
parseTransition
in class Parser
public void parseClassifierRole(ru.novosoft.uml.behavior.collaborations.MClassifierRole cls, java.lang.String s) throws java.text.ParseException
role and baselist can be given in any order.
This syntax is compatible with the UML 1.3 specification.
cls
- The MClassifierRole to apply any changes to.s
- The String to parse.
java.text.ParseException
- when it detects an error in the
attribute string. See also ParseError.getErrorOffset().public void parseMessage(ru.novosoft.uml.behavior.collaborations.MMessage mes, java.lang.String s) throws java.text.ParseException
Which is rather complex, so a few examples:
2: display(x, y)
1.3.1: p := find(specs)
[x < 0] 4: invert(color)
A3, B4/ C3.1*: update()
This syntax is compatible with the UML 1.3 specification.
Actually, only a subset of this syntax is currently supported, and some is not even planned to be supported. The exceptions are intno, which allows a number possibly followed by a sequence of letters in the range 'a' - 'z', seqelem, which does not allow a recurrance, and message, which does allow one recurrance near seq2.
mes
- The MMessage to apply any changes to.s
- The String to parse.
java.text.ParseException
- when it detects an error in the
attribute string. See also ParseError.getErrorOffset().public void parseStimulus(ru.novosoft.uml.behavior.common_behavior.MStimulus sti, java.lang.String s)
public java.lang.Object parseAction(java.lang.String s)
parseAction
in class Parser
public ru.novosoft.uml.behavior.state_machines.MGuard parseGuard(java.lang.String s)
parseGuard
in class Parser
public ru.novosoft.uml.behavior.state_machines.MEvent parseEvent(java.lang.String s)
parseEvent
in class Parser
public void parseObject(ru.novosoft.uml.behavior.common_behavior.MObject obj, java.lang.String s)
public void parseNodeInstance(ru.novosoft.uml.behavior.common_behavior.MNodeInstance noi, java.lang.String s)
public void parseComponentInstance(ru.novosoft.uml.behavior.common_behavior.MComponentInstance coi, java.lang.String s)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2003 (20040125) | ArgoUML Project Home | ArgoUML Cookbook |