| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Represents the element's string property and contains
the names and descriptions of hardcoded properties.
The string constants in this interface are used in RwiPropertyMap's methods
such as
getProperty(String propertyName)
hasProperty(String propertyName)
etc. as the
name of a property you wish to work with.
For example, if you need to get the name of the element:
String elementName = someRwiElement.getProperty(RwiProperty.NAME); //RwiProperty.NAME is defined in this interface
// now you have the element's name
Depending on the kind of information being represented by the property, an element
can have single or multiple instances of that property.
For example, every element has only one RwiProperty.NAME property.
On the other hand,
a member representing an operation can have multiple instances of the
RwiProperty.PARAMETER property.
The string properties are
represented by instances of this interface. It provides methods for working with the values of a property
(getValue, setValue, canSetValue methods), for
getting the name of this property (via the getName method) and for getting other
information containing in this property.
The term "other information" requires some clarification:
For example, let's condider the PARAMETER property. It contains information about
a parameter of an operation. Since properties can have only one value (boolean or string),
it is not possible to keep the name and the type of the parameter as the value of a property.
For properties like
EXTENDS we would like to be able to get not only the names of extended classes/interfaces
but to be able to quickly find RwiNodes representing these classes/interfaces in order to
perform some further analysis, etc.
That is why some of the hardcoded properties, besides their values, contain an instance of
RwiPropertyMap. This instance is returned by the getSubproperties
method. And that instance contains some other properties which can be obtained using the methods of
RwiPropertyMap. For example, when you have a PARAMETER property, it contains
"subproperties" TYPE, NAME, and TYPE_REFERENCED_ELEMENT.
See PARAMETER property for a detailed example.
Since Together 5.1, new properties were added to support Visual Basic 6.0, VB.NET and C# lanuages. Those properties
are not defined as constants here, but instead it is suggested to use their textual names in source code. Below is
the list of new properties:
"$propertyGet" property indicating that this element has the Property Get modifier (Visual Basic only). For operations only
"$propertySet" property indicating that this element has the Property Set modifier (Visual Basic only). For operations only
"$propertyLet" property indicating that this element has the Property Let modifier (Visual Basic only). For operations only
"$event" property indicating that this element reperesents a declaration of event (Visual Basic and C# only)
"$delegate" property indicating that this element has the Event modifier (C# only)
"$override" property indicating that this element has the override modifier (C# only). For operation only
"$explicit" property indicating that this element has the explicit modifier (C# only). For operation only
"$implicit" property indicating that this element has the implicit modifier (C# only). For operation only
"$internal" property indicating that this element has the internal visiblity (C# only)
"$operator" property indicating that this element is an operator. Reserved for the future versions (C++ and C# only)
"$friend" property indicating that this element has the Friend modifier (Visual Basic only)
"$procedure" property indicating that this element is a procedure. Applicable in languages that distinct procedures and functions (Visual Basic only)
"$property" property indicating that this element is a property. Applicable in languages which have special syntax for properties (Visual Basic .NET and C# only)
"$modifierNew" property indicating that this element has new modifier (C# only)
"$extern" property indicating that this element has an extern. Applicable for methods (C# only)
"$protectedInternal" property indicating that this element has the protected internal visibility (C# only)
"$protectedFriend" property indicating that this element has the protected friend visibility (VB.NET only)
"$idlReadOnly" property indicating that this element has the readonlymodifier. C# and IDL only.
"$struct" property indicating that this element is a structure. Applicable to C++, IDL, C#
"$union" property indicating that this element is a union. Applicable to C++, IDL.
"$enum" property indicating that this element is an enum. Applicable to C++, IDL.
"$indexer" property indicating that this element is an indexer (C# only).
"$sealed" property indicating that this element has the sealed modifier (C# only).
"$shadows"
"$mustInherit"
"$notInheritable"
"$overridable"
"$notOverridable"
"$mustOverride"
"$overrides"
"$overloads"
"$default"
"$writeOnly"
"$shared"
| Field Summary | |
final static String | ABSTRACTA boolean property which indicates whether an element is abstract. |
final static String | AGGREGATIONA boolean property for RwiLink whose SHAPE_TYPE property is
RwiShapeType.ASSOCIATION indicating whether this association link is an aggregation link. |
final static String | ASSOCIATESContains a string with the qualified name of a class (interface) this attribute or operation is associated. |
final static String | BODYContains a string with the value of the body of an operation. |
final static String | BY_VALUEA boolean property for Rwilink indicating whether this link
is a composition link. |
final static String | COMPILEDA boolean property indicating whether this element is a compiled Java class. |
final static String | COMPONENTDeprecated. |
final static String | CONST |
final static String | CONSTRUCTORA boolean property which indicates whether an element is a constructor. |
final static String | DECLARATION_TEXTContains a string with a text of an element's declaration. |
final static String | DEFINITION_END_POSITIONContains a string with the value of the position of the end of an element's defintion in a file. |
final static String | DEFINITION_FILEContains a string with the name of a file where the definition of this element is located. |
final static String | DEFINITION_START_POSITIONContains a string with the value of the position of the beginning of an element's defintion in a file. |
final static String | DESTRUCTORA boolean property which indicates whether an element is a destructor. |
final static String | DIRECTORIESContains a string with the full name of a directory containing elements of the RwiPackage. |
final static String | DIRECTORY_PACKAGEA boolean property which indicates whether a package is a directory. |
final static String | DOCContains a string with the value of the description of this element. |
final static String | END_POSITIONContains a string with the value of the offset of the end of an element's declaration in a file, including JavaDoc description comments (and body for Java language). |
final static String | ENUMA boolean property which indicates whether this element is an enum. |
final static String | EXTENDSContains a string with the name of the class (interface) extended by this class (interface). |
final static String | FILEContains a string with the name of a file where the declaration of this element is located. |
final static String | FILESFor packages that are directories only, contains a string with the name of a file in this package. |
final static String | FINALA boolean property which indicates whether an element has the final modifier. |
final static String | FULL_NAMEContains a string with the qualified name of the element. |
final static String | HYPERLINKContains a string with the unique name of the element pointed to by a hyperlink from this element. |
final static String | IMPLEMENTSContains a string with the name of an interface implemented by this class. |
final static String | IMPORTDeprecated. |
final static String | IMPORTED |
final static String | INITIAL_VALUEContains a string with the initial value of the attribute. |
final static String | INLINEA boolean property which indicates whether an element is an inline function in C++ language. |
final static String | INTERFACEA boolean property which indicates whether this element is an interface. |
final static String | LANGUAGEContains a string with the name of the language associated with this element. |
final static String | LINK_MEMBERFor an association link, contains a string with the unique name of the attribute representing this link. |
final static String | LINK_PREFIXA boolean property which indicates whether an attribute's name starts with "lnk". |
final static String | MEMBER_LINKFor RwiMember representing an attribute, contains a string with the unique name of
an association RwiLink represented by this attribute. |
final static String | MEMBER_SIGNATUREContians a string with the signature of an operation or an attribute. |
final static String | MODELDeprecated. |
final static String | MODEL_PARTContains string which indicates which part of the model this element belongs to. |
final static String | NAMEContains a string with the name of an element. |
final static String | NAMESPACE |
final static String | NATIVEA boolean property which indicates whether an element is a native element. |
final static String | PACKAGE_LOCALA boolean property which indicates whether an element is package local. |
final static String | PARAMETERContains information about a parameter of an operation. |
final static String | PARAMETERS_TEXTContains a string with the text of parameters of the operation. |
final static String | PHYSICAL_PACKAGEA boolean property which indicates whether this element is a physical package diagram. |
final static String | PRIVATEA boolean property which indicates whether an element is private. |
final static String | PROTECTEDA boolean property which indicates whether an element is protected. |
final static String | PUBLICA boolean property which indicates whether an element is public. |
final static String | PUREA boolean property which indicates whether an element is a PURE element. |
final static String | READ_ONLYA boolean property indicating whether this element is read-only. |
final static String | REFERENCED_ELEMENTThis property is contained in the RwiPropertyMap instance returned by
getSubproperties method of the EXTENDS, IMPLEMENTS, and THROW properties. |
final static String | RETURN_TYPEContains a string with an operation's return type. |
final static String | RETURN_TYPE_REFERENCED_ELEMENTContains a string with the unique name of operation's return type. |
final static String | SHAPE_TYPEContains string information about the nature of the element. |
final static String | START_POSITIONContains a string with the value of the offset of the beginning of an element's declaration in a file, including JavaDoc description comments (and body for Java language). |
final static String | STATICA boolean property which indicates whether an element is static. |
final static String | SYNCHRONIZEDA boolean property indicating whether this element has the synchronized modifier. |
final static String | TEMPLATEA boolean property which indicates whether this element is an template. |
final static String | TEMPLATE_PARAM_TEXTContains a string with the text of parameters of the template class. |
final static String | TEXTContains a string from a file with an element's declaration including JavaDoc description comments (and body for Java language) from START_POSITION
to END_POSITION. |
final static String | THROWContains a string with the name of an exception which can be thrown by this element. |
final static String | TRANSIENTA boolean property indicating whether this element has the transient modifier. |
final static String | TYPEContains a string with the type of an operation's parameter or the type of an attribute. |
final static String | TYPE_REFERENCED_ELEMENTFor RwiMembers representing attributes, this property contains a string with
the unique name of the element which is a type of the attribute. |
final static String | UML_PARAMETERS_TEXTContains a string with a text of all parameters in the UML format separated by commas. |
final static String | UNIQUE_NAMEContains a string with the unique name of this element. |
final static String | VALUETYPEA boolean property which indicates whether this element is an valuetype. |
final static String | VIEW_TYPEContains a string characterizing the visual representation of RwiDiagram
(used to distinguish collaboration and sequence diagrams). |
final static String | VIRTUAL |
final static String | VISIBLE |
final static String | VOLATILEA boolean property indicating whether this element has the volatile modifier. |
| Method Summary | |
boolean | canSetValue(String value)Checks whether a specified value can be assigned to this property. |
String | getName()Returns the name of this property. |
RwiPropertyMap | getSubproperties()Returns a properties container that has a set of properties which are the supbproperties for this property. |
String | getValue()Returns a string with the value of this property. |
boolean | isWritable()Returns true if this property is writable, false otherwise. |
void | setValue(String value)Sets the value for this property, or removes this property. |
| Field Detail |
public final static String ABSTRACT
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$abstract". You can use this value in queries in .config files.
public final static String AGGREGATION
RwiLink whose SHAPE_TYPE property is
RwiShapeType.ASSOCIATION indicating whether this association link is an aggregation link.
An element can have only one instance of this property.
The value of this constant is "$aggregation". You can use this value in queries in .config files.
public final static String ASSOCIATES
RwiMembers
An element can have only one instance of this property.
The value of this constant is "$associates". You can use this value in queries in .config files.
public final static String BODY
For example, for myRwiMember representing this operation
public int getSalary(String name, int year) {
int k=100;
return k;
}
System.out.println("The body is :"+myRwiMember.getProperty(RwiProperty.BODY));
" int k=100; return k;"
It is very easy to set the body of an operation to the desired content using this property. For the operation
described above, the execution of
myRwiMember.setProperty(RwiProperty.BODY, "return 100;");
public int getSalary(String name, int year) {
return 100;
}
The value of this constant is "$body". You can use this value in queries in .config files.
public final static String BY_VALUE
Rwilink indicating whether this link
RwiLinks having the
An element can have only one instance of this property.
The value of this constant is "$byValue". You can use this value in queries in .config files.
public final static String COMPILED
RwiNodes representing classes have this property. For Java language only.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$compiled". You can use this value in queries in .config files.
public final static String COMPONENT
public final static String CONST
public final static String CONSTRUCTOR
RwiMembers representing operations have this property.
An element can have only one instance of this property.
The value of this constant is "$constructor". You can use this value in queries in .config files.
public final static String DECLARATION_TEXT
RwiNodes representing classes or interfaces, and RwiMembers
RwiMember
/**
* @author TogetherSoft Corporation
*/
public void someOperation(String str){
System.out.println(str);
}
"public void someOperation(String str)".
An element can have only one instance of this property.
The value of this constant is "$declarationText". You can use this value in queries in .config files.
public final static String DEFINITION_END_POSITION
RwiMembers representing functions in C++ language only. For example:
if (someElement.getProperty(RwiProperty.DEFINITION_END_POSITION)!=null){
System.out.println("The definition end position is :"+Integer.parseInt(someElement.getProperty(RwiProperty.DEFINITION_END_POSITION)));
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$definitionEndPosition". You can use this value in queries in .config files.
public final static String DEFINITION_FILE
RwiMembers representing functions in C++ language only.
An element can have only one instance of this property.
The value of this constant is "$definitionFile". You can use this value in queries in .config files.
public final static String DEFINITION_START_POSITION
RwiMembers representing functions in C++ language only. For example:
if (someElement.getProperty(RwiProperty.DEFINITION_START_POSITION)!=null){
System.out.println("The definition start position is :"+Integer.parseInt(someElement.getProperty(RwiProperty.DEFINITION_START_POSITION)));
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$definitionStartPosition". You can use this value in queries in .config files.
public final static String DESTRUCTOR
RwiMembers representing operations have this property.
An element can have only one instance of this property.
The value of this constant is "$destructor". You can use this value in queries in .config files.
public final static String DIRECTORIES
RwiPackage.
RwiPackages only. Usually the package's data is located only in one directory, but
RwiPackage
someRwiPackage's data:
RwiPropertyEnumeration dirs=someOperation.properties(RwiProperty.DIRECTORIES);
while (dirs.hasMoreElements()){
System.out.println("Full name of a directory :"+dirs.nextRwiProperty().getValue());
}
An element can have multiple instances of this property, they can be obtained using
the RwiElement.properties(String propertyName) method.
The value of this constant is "$directories". You can use this value in queries in .config files.
public final static String DIRECTORY_PACKAGE
An element can have only one instance of this property.
The value of this constant is "$directoryPackage". You can use this value in queries in .config files.
public final static String DOC
An element can have only one instance of this property.
The value of this constant is "$doc". You can use this value in queries in .config files.
public final static String END_POSITION
RwiNodes representing classes or interfaces, and RwiMembers
if (someElement.getProperty(RwiProperty.END_POSITION)!=null){
System.out.println("The end position is :"+Integer.parseInt(someElement.getProperty(RwiProperty.END_POSITION)));
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$endPosition". You can use this value in queries in .config files.
public final static String ENUM
RwiNodes whose SHAPE_TYPE property is RwiShapeType.CLASS.
See RwiShapeType interface for an example.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$enum". You can use this value in queries in .config files.
public final static String EXTENDS
RwiNodes representing classes or interfaces have this property.
It it possible to
get the unique name of the extended element using getSubproperties method and retrieving
the REFERENCED_ELEMENT property. The unique name can be used to
find an element in the model though the RwiModel.findElement method.
For example, let us print the names and the fully qualified names of all classes (interfaces) extended by someRwiNode representing a class/interface:
RwiPropertyEnumeration extended = someRwiNode.properties(RwiProperty.EXTENDS);
while (extended.hasMoreElements()){
RwiProperty nextExtended=extended.nextRwiProperty();
System.out.println("Our class/interface extends a class/interface :"+nextExtended.getValue());
RwiPropertyMap subpropertiesContainer = nextExtended.getSubproperties();
RwiModel model = RwiModelAccess.getModel();
RwiElement foundClassOrInterface = model.findElement(subpropertiesContainer.getProperty(RwiProperty.REFERENCED_ELEMENT));
if (foundClassOrInterface != null) {
System.out.println(" The fully qualified name of this class/interface is :"+foundClassOrInterface.getProperty(RwiProperty.FULL_NAME));
}
}
An element can have multiple instances of this property, they can be obtained using
the RwiElement.properties(String propertyName) method.
The value of this constant is "$extends". You can use this value in queries in .config files.
public final static String FILE
RwiNodes representing classes or interfaces, and RwiMembers
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$file". You can use this value in queries in .config files.
public final static String FILES
RwiPropertyEnumeration files=somePackage.properties(RwiProperty.FILES);
while (files.hasMoreElements()){
System.out.println("Package contains a file :"+files.nextRwiProperty().getValue());
}
This property is read-only.
An element can have multiple instances of this property, they can be obtained using
the RwiElement.properties(String propertyName) method.
The value of this constant is "$files". You can use this value in queries in .config files.
public final static String FINAL
final modifier. Only
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$final". You can use this value in queries in .config files.
public final static String FULL_NAME
RwiPackages and
RwiNodes representing classes or interfaces,
RwiPackages representing root packages this property contains an empty string.
For example, for a node representing a java class
"com.togethersoft.util.Agent007" method getProperty(RwiProperty.FULL_NAME) will return
"com.togethersoft.util.Agent007".
For root packages this property contains an empty string (NAME works ok).
An element can have only one instance of this property.
The value of this constant is "$fullName". You can use this value in queries in .config files.
public final static String HYPERLINK
RwiPropertyEnumeration hLinks = someRwiElement.properties(RwiProperty.HYPERLINK);
while (hLinks.hasMoreElements()){
String uniqueNameOfReferencedElement = hLinks.nextRwiProperty().getValue();
RwiModel model = RwiModelAccess.getModel();
RwiElement foundElement = model.findElement(uniqueNameOfReferencedElement);
if (foundElement != null) { //we might not find it. For example, if it is not in the classpath ;)
System.out.println("Contains a hyperlink to :"+foundElement.getProperty(RwiProperty.NAME));
}
}
An element can have multiple instances of this property, they can be obtained using
the RwiElement.properties(String propertyName) method.
The value of this constant is "$hyperlink". You can use this value in queries in .config files.
public final static String IMPLEMENTS
RwiNodes representing classes have this property.
It it possible to
get the unique name of the implemented interface using getSubproperties method and retrieving
the REFERENCED_ELEMENT property. The unique name can be used to
find an element in the model though the RwiModel.findElement method.
For example, let us print the names and the fully qualified names of all interfaces implemented by someClass:
RwiPropertyEnumeration implemented=someClass.properties(RwiProperty.IMPLEMENTS);
while (implemented.hasMoreElements()){
RwiProperty nextImplemented=implemented.nextRwiProperty();
System.out.println("Our class implements an interface :"+nextImplemented.getValue());
RwiPropertyMap subpropertiesContainer = nextImplemented.getSubproperties();
RwiModel model = RwiModelAccess.getModel();
RwiElement foundInterface = model.findElement(subpropertiesContainer.getProperty(RwiProperty.REFERENCED_ELEMENT));
if (foundInterface != null) {
System.out.println(" The fully qualified name of this interface is :"+foundInterface.getProperty(RwiProperty.FULL_NAME));
}
}
An element can have multiple instances of this property, they can be obtained using
the RwiElement.properties(String propertyName) method.
The value of this constant is "$implements". You can use this value in queries in .config files.
public final static String IMPORT
public final static String IMPORTED
public final static String INITIAL_VALUE
For example, if someRwiMember represents the attribute "myName" in this class:
class A {
private String myName;
}
and you wish to assign an initial value to this attribute (for example, myName = "Bob"), you can done it using these lines of code:
if (someRwiMember.canSetProperty(RwiProperty.INITIAL_VALUE, "\"Bob\"")) {
someRwiMember.setProperty(RwiProperty.INITIAL_VALUE, "\"Bob\""));
}
A new attribute in a class/interface can be created using the method
RwiNode.createMemberByPattern.
An element can have only one instance of this property.
The value of this constant is "$initialValue". You can use this value in queries in .config files.
public final static String INLINE
RwiMembers representing operations have this property.
An element can have only one instance of this property.
The value of this constant is "$inline". You can use this value in queries in .config files.
public final static String INTERFACE
RwiNodes whose SHAPE_TYPE property is RwiShapeType.CLASS.
See RwiShapeType interface for an example.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$interface". You can use this value in queries in .config files.
public final static String LANGUAGE
RwiLanguage interface.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$language". You can use this value in queries in .config files.
public final static String LINK_MEMBER
RwiShapeType.ASSOCIATION.
For example, in case someRwiElement represents an association link you with
to get the attribute representing that link:
if (RwiShapeType.ASSOCIATION.equals(someRwiElement.getProperty(RwiProperty.SHAPE_TYPE))){
String uniqueNameOfAttribute = someRwiElement.getProperty(RwiProperty.MEMBER);
RwiModel model = RwiModelAccess.getModel();
RwiElement foundMember = model.findElement(uniqueNameOfAttribute);
if (foundMember != null) {
System.out.println(" The name of the attribute is :"+foundMember.getProperty(RwiProperty.NAME));
}
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$linkMember". You can use this value in queries in .config files.
public final static String LINK_PREFIX
RwiMembers
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$linkPrefix". You can use this value in queries in .config files.
public final static String MEMBER_LINK
RwiMember representing an attribute, contains a string with the unique name of
RwiLink represented by this attribute. If there is no
RwiLink represented by this attribute, this property contains null,
RwiMember's hasProperty(RwiProperty.LINK) method returns false.
For example, suppose someRwiMemberRepresentingAttribute represents an attribute.
We wish to find out if this attribute represents an association link, and if it does,
we want to get the destination of that link:
if (someRwiMemberRepresentingAttibute.hasProperty(RwiProperty.LINK)) {
String uniqueNameOfLink = someRwiMemberRepresentingAttibute.getProperty(RwiProperty.LINK);
RwiModel model = RwiModelAccess.getModel();
RwiElement foundElement = model.findElement(uniqueNameOfLink);
if (foundElement instanceof RwiLink){
RwiElement destination = ((RwiLink)foundElement).getDestination();
//... now you can analyze the destination
}
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$memberLink". You can use this value in queries in .config files.
public final static String MEMBER_SIGNATURE
RwiMembers
For operations the string contains the name and the types of parameters. For example, for this
operation:
public int getSalary(String name, int year) {
return 0;
}
"getSalary(String,int)".
For attributes the string will contain the name of an attribute. For example, for this
attribute:
int myAttr;
"myAttr".
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$memberSignature". You can use this value in queries in .config files.
public final static String MODEL
public final static String MODEL_PART
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$modelPart". You can use this value in queries in .config files.
public final static String NAME
For example, for a node representing a java class
"com.togethersoft.util.Agent007" method getProperty(RwiProperty.NAME) will return
"Agent007".
An element can have only one instance of this property.
The value of this constant is "$name". You can use this value in queries in .config files.
public final static String NAMESPACE
public final static String NATIVE
RwiMembers representing operations have this property.
An element can have only one instance of this property.
The value of this constant is "$native". You can use this value in queries in .config files.
public final static String PACKAGE_LOCAL
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$packageLocal". You can use this value in queries in .config files.
public final static String PARAMETER
RwiPropertyMap) which can be accessed through
getSubproperties method. And that object has properties NAME and
For example, let's say we have some RwiNode representing a class. We want to type the names and types of its attributes
and operations. Moreover, for operations we would like to type the name and the type of its parameters:
RwiMemberEnumeration rwiMemberEnumeration = rwiNode.members();
while (rwiMemberEnumeration.hasMoreElements()) {
RwiMember rwiNextMember=rwiMemberEnumeration.nextRwiMember();
System.out.println("Next member's name is : "+rwiNextMember.getProperty(RwiProperty.NAME));
if (RwiShapeType.OPERATION.equals(rwiNextMember.getProperty(RwiProperty.SHAPE_TYPE))){
System.out.println(" It is an operation!");
System.out.println(" Its return type is: "+rwiNextMember.getProperty(RwiProperty.RETURN_TYPE));
RwiPropertyEnumeration rwiParametersEnumeration=rwiNextMember.properties(RwiProperty.PARAMETER);
while (rwiParametersEnumeration.hasMoreElements()) {
RwiProperty nextParameterProperty=rwiParametersEnumeration.nextRwiProperty();
RwiPropertyMap subpropertiesContainer=nextParameterProperty.getSubproperties();
System.out.println(" Name of parameter: "+subpropertiesContainer.getProperty(RwiProperty.NAME) );
System.out.println(" Type of parameter: "+subpropertiesContainer.getProperty(RwiProperty.TYPE) );
//now, suppose we want to get the RwiNode representing the type of the parameter
String uniqueNameOfType = subpropertiesContainer.getProperty(RwiProperty.TYPE_REFERENCED_ELEMENT);
RwiModel model = RwiModelAccess.getModel();
RwiElement foundElement = model.findElement(uniqueNameOfType);
if (foundElement != null) { //we might not find it. For example, if it is not in the classpath ;)
System.out.println(" The fully qualified name of the type is:"+foundElement.getProperty(RwiProperty.FULL_NAME));
}
}
} else {
if (RwiShapeType.ATTRIBUTE.equals(rwiNextMember.getProperty(RwiProperty.SHAPE_TYPE))){
System.out.println(" It is an attribute!");
System.out.println(" Its type is: "+rwiNextMember.getProperty(RwiProperty.TYPE));
}
}
}
The example above shows how to extract information about operation's parameters. Now, below is an
explanation of how to add this kind of property to an operation. Let's say we have some RwiMember
fOper representing this operation:
public void f(){
}
and we want to change it to
public void f(ClassA a, ClassB b){
}
There are four possible ways to do it:
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "ClassA a, ClassB b");
fOper.addProperty(RwiProperty.PARAMETER,"ClassA a");
fOper.addProperty(RwiProperty.PARAMETER,"ClassB b");
getSubproperties method using the TYPE property:
RwiProperty p=fOper.addProperty(RwiProperty.PARAMETER, null) //creates the property with the default value
p.getSubproperties.setProperty(RwiProperty.TYPE,"ClassA");
p.getSubproperties.setProperty(RwiProperty.NAME,"a");
RwiProperty q=fOper.addProperty(RwiProperty.PARAMETER, null) //creates the property with the default value
q.getSubproperties.setProperty(RwiProperty.TYPE,"ClassB");
q.getSubproperties.setProperty(RwiProperty.NAME,"b");
getSubproperties method using the TYPE_REFERENCED_ELEMENT property:
RwiProperty p=fOper.addProperty(RwiProperty.PARAMETER, null) //creates the property with the default value
p.getSubproperties.setProperty(RwiProperty.TYPE_REFERENCED_ELEMENT, stringWithUniqueNameFor_ClassA);
p.getSubproperties.setProperty(RwiProperty.NAME,"a");
RwiProperty q=fOper.addProperty(RwiProperty.PARAMETER, null) //creates the property with the default value
q.getSubproperties.setProperty(RwiProperty.TYPE_REFERENCED_ELEMENT, stringWithUniqueNameFor_ClassB);
q.getSubproperties.setProperty(RwiProperty.NAME,"b");
The value of this constant is "$parameter". You can use this value in queries in .config files.
public final static String PARAMETERS_TEXT
public void f(String s, int i){}
}
"String s, int i".
You can use this property to change the text of parameters. In this case you must specify
a string with a valid (from the syntax viewpoint) set of parameters. For example, if RwiMember
fOper
represents the operation described above, and you wish to change it to
public void f(long l, MyClass c){}
you must call
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "long l, MyClass c");
Note that none of
will work.
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "long , MyClass c");
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "l, MyClass c");
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "long l,");
An element can have only one instance of this property.
The value of this constant is "$parametersText". You can use this value in queries in .config files.
public final static String PHYSICAL_PACKAGE
RwiDiagrams have this property.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$physicalPackage". You can use this value in queries in .config files.
public final static String PRIVATE
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$private". You can use this value in queries in .config files.
public final static String PROTECTED
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$protected". You can use this value in queries in .config files.
public final static String PUBLIC
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$public". You can use this value in queries in .config files.
public final static String PURE
RwiMembers
An element can have only one instance of this property.
The value of this constant is "$pure". You can use this value in queries in .config files.
public final static String READ_ONLY
if (someElement.hasProperty(RwiProperty.READ_ONLY)) System.out.println("Element is read-only");
An element can have only one instance of this property.
The value of this constant is "$readOnly". You can use this value in queries in .config files.
public final static String REFERENCED_ELEMENT
RwiPropertyMap instance returned by
getSubproperties method of the EXTENDS, IMPLEMENTS, and THROW properties.
It contains
a string with the unqie name of the element whose name is contained in the EXTENDS, IMPLEMENTS, or THROW property.
If it is not possible to obtain the element (for
example, it is not in the CLASSPATH), then the value of this property is null.
See each property description (EXTENDS, IMPLEMENTS, THROW) for examples.
This property is read-only.
public final static String RETURN_TYPE
RwiMembers
For example, for the operation
public void myMethod(){
}
myRwiMember,
"void". To change the return type to the "int",
myRwiMember.setProperty(RwiProperty.RETURN_TYPE,"int");
An element can have only one instance of this property.
The value of this constant is "$returnType". You can use this value in queries in .config files.
public final static String RETURN_TYPE_REFERENCED_ELEMENT
public ClassA makeA(){
return null;
}
RwiMember representing operation makeA, this property will contain the unique name of
ClassA.
Note the difference with the RETURN_TYPE property: this property
returns the information which allows uniquely to find the referenced element
(via RwiModel.findElement method)
, while the RETURN_TYPE property
returns only the string representation of that referenced element.
An element can have only one instance of this property.
The value of this constant is "$returnTypeReferencedElement". You can use this value in queries in .config files.
public final static String SHAPE_TYPE
RwiShapeType interface.
if (RwiShapeType.OPERATION.equals(rwiSomeElement.getProperty(RwiProperty.SHAPE_TYPE))) {
System.out.println("rwiSomeElement is an operation")
}
createNode and
createDiagram in RwiPackage and RwiDiagram interfaces.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$shapeType". You can use this value in queries in .config files.
public final static String START_POSITION
RwiNodes representing classes or interfaces, and RwiMembers
if (someElement.getProperty(RwiProperty.START_POSITION)!=null){
System.out.println("The start position is :"+Integer.parseInt(someElement.getProperty(RwiProperty.START_POSITION)));
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$startPosition". You can use this value in queries in .config files.
public final static String STATIC
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$static". You can use this value in queries in .config files.
public final static String SYNCHRONIZED
synchronized modifier. Only
RwiNodes representing classes or interfaces, and RwiMembers representing operations
An element can have only one instance of this property.
The value of this constant is "$synchronized". You can use this value in queries in .config files.
public final static String TEMPLATE
RwiNodes whose SHAPE_TYPE property is RwiShapeType.CLASS.
See RwiShapeType interface for an example.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$template". You can use this value in queries in .config files.
public final static String TEMPLATE_PARAM_TEXT
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$templateParamText". You can use this value in queries in .config files.
public final static String TEXT
START_POSITION
END_POSITION. For example, for the RwiMember
/**
* @author TogetherSoft Corporation
*/
public void someOperation(String str){
System.out.println(str);
}
"/**
* @author TogetherSoft Corporation
*/
public void someOperation(String str){
System.out.println(str);
}"
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$text". You can use this value in queries in .config files.
public final static String THROW
RwiMembers representing operations have this property.
It it possible to
get the unique name of the exception object using getSubproperties method and retrieving
the REFERENCED_ELEMENT property.
For example, let us print the names and the fully qualified names of all exceptions which can be thrown by someOperation:
RwiPropertyEnumeration exceptions=someOperation.properties(RwiProperty.THROW);
while (exceptions.hasMoreElements()){
RwiProperty nextException = exceptions.nextRwiProperty();
System.out.println("Our operation can throw :"+nextException.getValue());
RwiPropertyMap subpropertiesContainer = nextException.getSubproperties();
RwiModel model = RwiModelAccess.getModel();
RwiElement foundClass = model.findElement(subpropertiesContainer.getProperty(RwiProperty.REFERENCED_ELEMENT));
if (foundClass != null) {
System.out.println(" The fully qualified name of this exception is :"+foundClass.getProperty(RwiProperty.FULL_NAME));
}
}
An element can have multiple instances of this property, they can be obtained using
the RwiElement.properties(String propertyName) method.
The value of this constant is "$throw". You can use this value in queries in .config files.
public final static String TRANSIENT
transient modifier. Only
RwiMembers representing attributes
An element can have only one instance of this property.
The value of this constant is "$transient". You can use this value in queries in .config files.
public final static String TYPE
getSubproperties method and
For example, for an an attribute "int i;"
represented by someRwiMember, the execution of
System.out.println(someRwiMember.getProperty(RwiProperty.TYPE));
will print int.
Since this property is not ready-only you can easily change the type of an attribute:
The execution of
someRwiMember.setProperty(RwiProperty.TYPE, "String");
"String i;"
An element can have only one instance of this property.
The value of this constant is "$type". You can use this value in queries in .config files.
public final static String TYPE_REFERENCED_ELEMENT
RwiMembers representing attributes, this property contains a string with
SomeClass A;
RwiMember representing attribute A, this property will contain the unique name of
RwiNode representing the class SomeClass.
Note the difference with the TYPE property: this property
returns the information which allows uniquely to find the referenced element
(via RwiModel.findElement method)
, while the TYPE property
returns only the string representation of that referenced element.
For a parameter of an operation it is also possible to get the unique name
of the element which is a type of the parameter. The RwiPropertyMap instance
returned by the getSubproperties method for the PARAMETER property,
contains the TYPE_REFERENCED_ELEMENT subproperty with the desired value. See PARAMETER property
description for the example.
An element can have only one instance of this property.
The value of this constant is "$typeReferencedElement". You can use this value in queries in .config files.
public final static String UML_PARAMETERS_TEXT
RwiMembers which are operations only. In the UML notation name of a parameter comes first,
public void operation(String s, int i){}
"s:String,i:int".
An element can have only one instance of this property.
The value of this constant is "$umlParametersText". You can use this value in queries in .config files.
public final static String UNIQUE_NAME
An element can have only one instance of this property.
The value of this constant is "$uniqueName". You can use this value in queries in .config files.
public final static String VALUETYPE
RwiNodes whose SHAPE_TYPE property is RwiShapeType.CLASS.
See RwiShapeType interface for an example.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$valuetype". You can use this value in queries in .config files.
public final static String VIEW_TYPE
RwiDiagram
RwiDiagram.
When it
is displayed as a collaboration diagram, it has the VIEW_TYPE property. If it
is displayed as a sequence diagram, it does not have this property.
See an example
in RwiShapeType interface.
An element can have only one instance of this property.
The value of this constant is "$viewType". You can use this value in queries in .config files.
public final static String VIRTUAL
public final static String VISIBLE
public final static String VOLATILE
volatile modifier. Only
RwiMembers representing attributes
An element can have only one instance of this property.
The value of this constant is "$volatile". You can use this value in queries in .config files.
| Method Detail |
public boolean canSetValue(String value)
value
null then this property will be removed.true if the value can be assigned to this property, false
public String getName()
public RwiPropertyMap getSubproperties()
RwiPropertyMap returned by this method.RwiPropertyMap containing properties which are subproperties of this propertypublic String getValue()
public boolean isWritable()
true if this property is writable, false otherwise.
false can be returned if this property is read-only, or the whole element this property belongs to
true if this property is writable, false otherwisepublic void setValue(String value)
value
null then this property will be removed.| Association Links |
RwiShapeType interface.
if (RwiShapeType.OPERATION.equals(rwiSomeElement.getProperty(RwiProperty.SHAPE_TYPE))) {
System.out.println("rwiSomeElement is an operation")
}
createNode and
createDiagram in RwiPackage and RwiDiagram interfaces.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$shapeType". You can use this value in queries in .config files.
to Class java.lang.String
getSubproperties method and
For example, for an an attribute "int i;"
represented by someRwiMember, the execution of
System.out.println(someRwiMember.getProperty(RwiProperty.TYPE));
will print int.
Since this property is not ready-only you can easily change the type of an attribute:
The execution of
someRwiMember.setProperty(RwiProperty.TYPE, "String");
"String i;"
An element can have only one instance of this property.
The value of this constant is "$type". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing attributes, this property contains a string with
SomeClass A;
RwiMember representing attribute A, this property will contain the unique name of
RwiNode representing the class SomeClass.
Note the difference with the {@link #TYPE TYPE} property: this property
returns the information which allows uniquely to find the referenced element
(via {@link RwiModel#findElement RwiModel.findElement} method)
, while the TYPE property
returns only the string representation of that referenced element.
For a parameter of an operation it is also possible to get the unique name
of the element which is a type of the parameter. The RwiPropertyMap instance
returned by the getSubproperties method for the {@link #PARAMETER PARAMETER} property,
contains the TYPE_REFERENCED_ELEMENT subproperty with the desired value. See PARAMETER property
description for the example.
An element can have only one instance of this property.
The value of this constant is "$typeReferencedElement". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers
For example, for the operation
public void myMethod(){
}
myRwiMember,
"void". To change the return type to the "int",
myRwiMember.setProperty(RwiProperty.RETURN_TYPE,"int");
An element can have only one instance of this property.
The value of this constant is "$returnType". You can use this value in queries in .config files.
to Class java.lang.String
public ClassA makeA(){
return null;
}
RwiMember representing operation makeA, this property will contain the unique name of
ClassA.
Note the difference with the {@link #RETURN_TYPE RETURN_TYPE} property: this property
returns the information which allows uniquely to find the referenced element
(via {@link RwiModel#findElement RwiModel.findElement} method)
, while the RETURN_TYPE property
returns only the string representation of that referenced element.
An element can have only one instance of this property.
The value of this constant is "$returnTypeReferencedElement". You can use this value in queries in .config files.
to Class java.lang.String
RwiPropertyMap) which can be accessed through
getSubproperties method. And that object has properties {@link #NAME NAME} and
For example, let's say we have some RwiNode representing a class. We want to type the names and types of its attributes
and operations. Moreover, for operations we would like to type the name and the type of its parameters:
RwiMemberEnumeration rwiMemberEnumeration = rwiNode.members();
while (rwiMemberEnumeration.hasMoreElements()) {
RwiMember rwiNextMember=rwiMemberEnumeration.nextRwiMember();
System.out.println("Next member's name is : "+rwiNextMember.getProperty(RwiProperty.NAME));
if (RwiShapeType.OPERATION.equals(rwiNextMember.getProperty(RwiProperty.SHAPE_TYPE))){
System.out.println(" It is an operation!");
System.out.println(" Its return type is: "+rwiNextMember.getProperty(RwiProperty.RETURN_TYPE));
RwiPropertyEnumeration rwiParametersEnumeration=rwiNextMember.properties(RwiProperty.PARAMETER);
while (rwiParametersEnumeration.hasMoreElements()) {
RwiProperty nextParameterProperty=rwiParametersEnumeration.nextRwiProperty();
RwiPropertyMap subpropertiesContainer=nextParameterProperty.getSubproperties();
System.out.println(" Name of parameter: "+subpropertiesContainer.getProperty(RwiProperty.NAME) );
System.out.println(" Type of parameter: "+subpropertiesContainer.getProperty(RwiProperty.TYPE) );
//now, suppose we want to get the RwiNode representing the type of the parameter
String uniqueNameOfType = subpropertiesContainer.getProperty(RwiProperty.TYPE_REFERENCED_ELEMENT);
RwiModel model = RwiModelAccess.getModel();
RwiElement foundElement = model.findElement(uniqueNameOfType);
if (foundElement != null) { //we might not find it. For example, if it is not in the classpath ;)
System.out.println(" The fully qualified name of the type is:"+foundElement.getProperty(RwiProperty.FULL_NAME));
}
}
} else {
if (RwiShapeType.ATTRIBUTE.equals(rwiNextMember.getProperty(RwiProperty.SHAPE_TYPE))){
System.out.println(" It is an attribute!");
System.out.println(" Its type is: "+rwiNextMember.getProperty(RwiProperty.TYPE));
}
}
}
The example above shows how to extract information about operation's parameters. Now, below is an
explanation of how to add this kind of property to an operation. Let's say we have some RwiMember
fOper representing this operation:
public void f(){
}
and we want to change it to
public void f(ClassA a, ClassB b){
}
There are four possible ways to do it:
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "ClassA a, ClassB b");
fOper.addProperty(RwiProperty.PARAMETER,"ClassA a");
fOper.addProperty(RwiProperty.PARAMETER,"ClassB b");
getSubproperties method using the TYPE property:
RwiProperty p=fOper.addProperty(RwiProperty.PARAMETER, null) //creates the property with the default value
p.getSubproperties.setProperty(RwiProperty.TYPE,"ClassA");
p.getSubproperties.setProperty(RwiProperty.NAME,"a");
RwiProperty q=fOper.addProperty(RwiProperty.PARAMETER, null) //creates the property with the default value
q.getSubproperties.setProperty(RwiProperty.TYPE,"ClassB");
q.getSubproperties.setProperty(RwiProperty.NAME,"b");
getSubproperties method using the TYPE_REFERENCED_ELEMENT property:
RwiProperty p=fOper.addProperty(RwiProperty.PARAMETER, null) //creates the property with the default value
p.getSubproperties.setProperty(RwiProperty.TYPE_REFERENCED_ELEMENT, stringWithUniqueNameFor_ClassA);
p.getSubproperties.setProperty(RwiProperty.NAME,"a");
RwiProperty q=fOper.addProperty(RwiProperty.PARAMETER, null) //creates the property with the default value
q.getSubproperties.setProperty(RwiProperty.TYPE_REFERENCED_ELEMENT, stringWithUniqueNameFor_ClassB);
q.getSubproperties.setProperty(RwiProperty.NAME,"b");
The value of this constant is "$parameter". You can use this value in queries in .config files.
to Class java.lang.String
public void f(String s, int i){}
}
"String s, int i".
You can use this property to change the text of parameters. In this case you must specify
a string with a valid (from the syntax viewpoint) set of parameters. For example, if RwiMember
fOper
represents the operation described above, and you wish to change it to
public void f(long l, MyClass c){}
you must call
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "long l, MyClass c");
Note that none of
will work.
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "long , MyClass c");
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "l, MyClass c");
fOper.setProperty(RwiProperty.PARAMETERS_TEXT, "long l,");
An element can have only one instance of this property.
The value of this constant is "$parametersText". You can use this value in queries in .config files.
to Class java.lang.String
For example, if someRwiMember represents the attribute "myName" in this class:
class A {
private String myName;
}
and you wish to assign an initial value to this attribute (for example, myName = "Bob"), you can done it using these lines of code:
if (someRwiMember.canSetProperty(RwiProperty.INITIAL_VALUE, "\"Bob\"")) {
someRwiMember.setProperty(RwiProperty.INITIAL_VALUE, "\"Bob\""));
}
A new attribute in a class/interface can be created using the method
{@link com.togethersoft.openapi.rwi.RwiNode#createMemberByPattern RwiNode.createMemberByPattern}.
An element can have only one instance of this property.
The value of this constant is "$initialValue". You can use this value in queries in .config files.
to Class java.lang.String
For example, for myRwiMember representing this operation
public int getSalary(String name, int year) {
int k=100;
return k;
}
System.out.println("The body is :"+myRwiMember.getProperty(RwiProperty.BODY));
" int k=100; return k;"
It is very easy to set the body of an operation to the desired content using this property. For the operation
described above, the execution of
myRwiMember.setProperty(RwiProperty.BODY, "return 100;");
public int getSalary(String name, int year) {
return 100;
}
The value of this constant is "$body". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$public". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$private". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$protected". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$packageLocal". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$static". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$abstract". You can use this value in queries in .config files.
to Class java.lang.String
final modifier. Only
RwiNodes representing classes or interfaces, and RwiMembers
An element can have only one instance of this property.
The value of this constant is "$final". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing operations have this property.
An element can have only one instance of this property.
The value of this constant is "$constructor". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing operations have this property.
An element can have only one instance of this property.
The value of this constant is "$destructor". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing operations have this property.
An element can have only one instance of this property.
The value of this constant is "$inline". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers
An element can have only one instance of this property.
The value of this constant is "$pure". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing operations have this property.
An element can have only one instance of this property.
The value of this constant is "$native". You can use this value in queries in .config files.
to Class java.lang.String
transient modifier. Only
RwiMembers representing attributes
An element can have only one instance of this property.
The value of this constant is "$transient". You can use this value in queries in .config files.
to Class java.lang.String
volatile modifier. Only
RwiMembers representing attributes
An element can have only one instance of this property.
The value of this constant is "$volatile". You can use this value in queries in .config files.
to Class java.lang.String
synchronized modifier. Only
RwiNodes representing classes or interfaces, and RwiMembers representing operations
An element can have only one instance of this property.
The value of this constant is "$synchronized". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes have this property. For Java language only.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$compiled". You can use this value in queries in .config files.
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
RwiPackages and
RwiNodes representing classes or interfaces,
RwiPackages representing root packages this property contains an empty string.
For example, for a node representing a java class
"com.togethersoft.util.Agent007" method getProperty(RwiProperty.FULL_NAME) will return
"com.togethersoft.util.Agent007".
For root packages this property contains an empty string (NAME works ok).
An element can have only one instance of this property.
The value of this constant is "$fullName". You can use this value in queries in .config files.
to Class java.lang.String
For example, for a node representing a java class
"com.togethersoft.util.Agent007" method getProperty(RwiProperty.NAME) will return
"Agent007".
An element can have only one instance of this property.
The value of this constant is "$name". You can use this value in queries in .config files.
to Class java.lang.String
RwiLanguage interface.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$language". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$file". You can use this value in queries in .config files.
to Class java.lang.String
RwiPropertyEnumeration files=somePackage.properties(RwiProperty.FILES);
while (files.hasMoreElements()){
System.out.println("Package contains a file :"+files.nextRwiProperty().getValue());
}
This property is read-only.
An element can have multiple instances of this property, they can be obtained using
the {@link RwiPropertyMap#properties(String) RwiElement.properties(String propertyName)} method.
The value of this constant is "$files". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
if (someElement.getProperty(RwiProperty.START_POSITION)!=null){
System.out.println("The start position is :"+Integer.parseInt(someElement.getProperty(RwiProperty.START_POSITION)));
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$startPosition". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
if (someElement.getProperty(RwiProperty.END_POSITION)!=null){
System.out.println("The end position is :"+Integer.parseInt(someElement.getProperty(RwiProperty.END_POSITION)));
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$endPosition". You can use this value in queries in .config files.
to Class java.lang.String
START_POSITION
END_POSITION. For example, for the RwiMember
/**
* @author TogetherSoft Corporation
*/
public void someOperation(String str){
System.out.println(str);
}
"/**
* @author TogetherSoft Corporation
*/
public void someOperation(String str){
System.out.println(str);
}"
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$text". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces, and RwiMembers
RwiMember
/**
* @author TogetherSoft Corporation
*/
public void someOperation(String str){
System.out.println(str);
}
"public void someOperation(String str)".
An element can have only one instance of this property.
The value of this constant is "$declarationText". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes whose SHAPE_TYPE property is RwiShapeType.CLASS.
See RwiShapeType interface for an {@link RwiShapeType#CLASS example}.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$interface". You can use this value in queries in .config files.
to Class java.lang.String
RwiDiagrams have this property.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$physicalPackage". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes or interfaces have this property.
It it possible to
get the unique name of the extended element using getSubproperties method and retrieving
the {@link #REFERENCED_ELEMENT REFERENCED_ELEMENT} property. The unique name can be used to
find an element in the model though the {@link RwiModel#findElement RwiModel.findElement} method.
For example, let us print the names and the fully qualified names of all classes (interfaces) extended by someRwiNode representing a class/interface:
RwiPropertyEnumeration extended = someRwiNode.properties(RwiProperty.EXTENDS);
while (extended.hasMoreElements()){
RwiProperty nextExtended=extended.nextRwiProperty();
System.out.println("Our class/interface extends a class/interface :"+nextExtended.getValue());
RwiPropertyMap subpropertiesContainer = nextExtended.getSubproperties();
RwiModel model = RwiModelAccess.getModel();
RwiElement foundClassOrInterface = model.findElement(subpropertiesContainer.getProperty(RwiProperty.REFERENCED_ELEMENT));
if (foundClassOrInterface != null) {
System.out.println(" The fully qualified name of this class/interface is :"+foundClassOrInterface.getProperty(RwiProperty.FULL_NAME));
}
}
An element can have multiple instances of this property, they can be obtained using
the {@link RwiPropertyMap#properties(String) RwiElement.properties(String propertyName)} method.
The value of this constant is "$extends". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes representing classes have this property.
It it possible to
get the unique name of the implemented interface using getSubproperties method and retrieving
the {@link #REFERENCED_ELEMENT REFERENCED_ELEMENT} property. The unique name can be used to
find an element in the model though the {@link RwiModel#findElement RwiModel.findElement} method.
For example, let us print the names and the fully qualified names of all interfaces implemented by someClass:
RwiPropertyEnumeration implemented=someClass.properties(RwiProperty.IMPLEMENTS);
while (implemented.hasMoreElements()){
RwiProperty nextImplemented=implemented.nextRwiProperty();
System.out.println("Our class implements an interface :"+nextImplemented.getValue());
RwiPropertyMap subpropertiesContainer = nextImplemented.getSubproperties();
RwiModel model = RwiModelAccess.getModel();
RwiElement foundInterface = model.findElement(subpropertiesContainer.getProperty(RwiProperty.REFERENCED_ELEMENT));
if (foundInterface != null) {
System.out.println(" The fully qualified name of this interface is :"+foundInterface.getProperty(RwiProperty.FULL_NAME));
}
}
An element can have multiple instances of this property, they can be obtained using
the {@link RwiPropertyMap#properties(String) RwiElement.properties(String propertyName)} method.
The value of this constant is "$implements". You can use this value in queries in .config files.
to Class java.lang.String
RwiPropertyMap instance returned by
getSubproperties method of the EXTENDS, IMPLEMENTS, and THROW properties.
It contains
a string with the unqie name of the element whose name is contained in the EXTENDS, IMPLEMENTS, or THROW property.
If it is not possible to obtain the element (for
example, it is not in the CLASSPATH), then the value of this property is null.
See each property description (EXTENDS, IMPLEMENTS, THROW) for examples.
This property is read-only.
to Class java.lang.String
An element can have only one instance of this property.
The value of this constant is "$doc". You can use this value in queries in .config files.
to Class java.lang.String
An element can have only one instance of this property.
The value of this constant is "$uniqueName". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing functions in C++ language only.
An element can have only one instance of this property.
The value of this constant is "$definitionFile". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing functions in C++ language only. For example:
if (someElement.getProperty(RwiProperty.DEFINITION_START_POSITION)!=null){
System.out.println("The definition start position is :"+Integer.parseInt(someElement.getProperty(RwiProperty.DEFINITION_START_POSITION)));
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$definitionStartPosition". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing functions in C++ language only. For example:
if (someElement.getProperty(RwiProperty.DEFINITION_END_POSITION)!=null){
System.out.println("The definition end position is :"+Integer.parseInt(someElement.getProperty(RwiProperty.DEFINITION_END_POSITION)));
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$definitionEndPosition". You can use this value in queries in .config files.
to Class java.lang.String
An element can have only one instance of this property.
The value of this constant is "$directoryPackage". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers representing operations have this property.
It it possible to
get the unique name of the exception object using getSubproperties method and retrieving
the {@link #REFERENCED_ELEMENT REFERENCED_ELEMENT} property.
For example, let us print the names and the fully qualified names of all exceptions which can be thrown by someOperation:
RwiPropertyEnumeration exceptions=someOperation.properties(RwiProperty.THROW);
while (exceptions.hasMoreElements()){
RwiProperty nextException = exceptions.nextRwiProperty();
System.out.println("Our operation can throw :"+nextException.getValue());
RwiPropertyMap subpropertiesContainer = nextException.getSubproperties();
RwiModel model = RwiModelAccess.getModel();
RwiElement foundClass = model.findElement(subpropertiesContainer.getProperty(RwiProperty.REFERENCED_ELEMENT));
if (foundClass != null) {
System.out.println(" The fully qualified name of this exception is :"+foundClass.getProperty(RwiProperty.FULL_NAME));
}
}
An element can have multiple instances of this property, they can be obtained using
the {@link RwiPropertyMap#properties(String) RwiElement.properties(String propertyName)} method.
The value of this constant is "$throw". You can use this value in queries in .config files.
to Class java.lang.String
RwiShapeType.ASSOCIATION.
For example, in case someRwiElement represents an association link you with
to get the attribute representing that link:
if (RwiShapeType.ASSOCIATION.equals(someRwiElement.getProperty(RwiProperty.SHAPE_TYPE))){
String uniqueNameOfAttribute = someRwiElement.getProperty(RwiProperty.MEMBER);
RwiModel model = RwiModelAccess.getModel();
RwiElement foundMember = model.findElement(uniqueNameOfAttribute);
if (foundMember != null) {
System.out.println(" The name of the attribute is :"+foundMember.getProperty(RwiProperty.NAME));
}
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$linkMember". You can use this value in queries in .config files.
to Class java.lang.String
RwiMember representing an attribute, contains a string with the unique name of
RwiLink represented by this attribute. If there is no
RwiLink represented by this attribute, this property contains null,
RwiMember's hasProperty(RwiProperty.LINK) method returns false.
For example, suppose someRwiMemberRepresentingAttribute represents an attribute.
We wish to find out if this attribute represents an association link, and if it does,
we want to get the destination of that link:
if (someRwiMemberRepresentingAttibute.hasProperty(RwiProperty.LINK)) {
String uniqueNameOfLink = someRwiMemberRepresentingAttibute.getProperty(RwiProperty.LINK);
RwiModel model = RwiModelAccess.getModel();
RwiElement foundElement = model.findElement(uniqueNameOfLink);
if (foundElement instanceof RwiLink){
RwiElement destination = ((RwiLink)foundElement).getDestination();
//... now you can analyze the destination
}
}
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$memberLink". You can use this value in queries in .config files.
to Class java.lang.String
RwiDiagram
RwiDiagram.
When it
is displayed as a collaboration diagram, it has the VIEW_TYPE property. If it
is displayed as a sequence diagram, it does not have this property.
See an {@link RwiShapeType#SEQUENCE_DIAGRAM example}
in RwiShapeType interface.
An element can have only one instance of this property.
The value of this constant is "$viewType". You can use this value in queries in .config files.
to Class java.lang.String
RwiPropertyEnumeration hLinks = someRwiElement.properties(RwiProperty.HYPERLINK);
while (hLinks.hasMoreElements()){
String uniqueNameOfReferencedElement = hLinks.nextRwiProperty().getValue();
RwiModel model = RwiModelAccess.getModel();
RwiElement foundElement = model.findElement(uniqueNameOfReferencedElement);
if (foundElement != null) { //we might not find it. For example, if it is not in the classpath ;)
System.out.println("Contains a hyperlink to :"+foundElement.getProperty(RwiProperty.NAME));
}
}
An element can have multiple instances of this property, they can be obtained using
the {@link RwiPropertyMap#properties(String) RwiElement.properties(String propertyName)} method.
The value of this constant is "$hyperlink". You can use this value in queries in .config files.
to Class java.lang.String
if (someElement.hasProperty(RwiProperty.READ_ONLY)) System.out.println("Element is read-only");
An element can have only one instance of this property.
The value of this constant is "$readOnly". You can use this value in queries in .config files.
to Class java.lang.String
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$import". You can use this value in queries in .config files.
to Class java.lang.String
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$component". You can use this value in queries in .config files.
to Class java.lang.String
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$model". You can use this value in queries in .config files.
to Class java.lang.String
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$modelPart". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers which are operations only. In the UML notation name of a parameter comes first,
public void operation(String s, int i){}
"s:String,i:int".
An element can have only one instance of this property.
The value of this constant is "$umlParametersText". You can use this value in queries in .config files.
to Class java.lang.String
RwiLink whose SHAPE_TYPE property is
RwiShapeType.ASSOCIATION indicating whether this association link is an aggregation link.
An element can have only one instance of this property.
The value of this constant is "$aggregation". You can use this value in queries in .config files.
to Class java.lang.String
Rwilink indicating whether this link
RwiLinks having the
An element can have only one instance of this property.
The value of this constant is "$byValue". You can use this value in queries in .config files.
to Class java.lang.String
RwiPackage.
RwiPackages only. Usually the package's data is located only in one directory, but
RwiPackage
someRwiPackage's data:
RwiPropertyEnumeration dirs=someOperation.properties(RwiProperty.DIRECTORIES);
while (dirs.hasMoreElements()){
System.out.println("Full name of a directory :"+dirs.nextRwiProperty().getValue());
}
An element can have multiple instances of this property, they can be obtained using
the {@link RwiPropertyMap#properties(String) RwiElement.properties(String propertyName)} method.
The value of this constant is "$directories". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$linkPrefix". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers
For operations the string contains the name and the types of parameters. For example, for this
operation:
public int getSalary(String name, int year) {
return 0;
}
"getSalary(String,int)".
For attributes the string will contain the name of an attribute. For example, for this
attribute:
int myAttr;
"myAttr".
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$memberSignature". You can use this value in queries in .config files.
to Class java.lang.String
RwiMembers
An element can have only one instance of this property.
The value of this constant is "$associates". You can use this value in queries in .config files.
to Class java.lang.String
to Class java.lang.String
RwiNodes whose SHAPE_TYPE property is RwiShapeType.CLASS.
See RwiShapeType interface for an {@link RwiShapeType#CLASS example}.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$template". You can use this value in queries in .config files.
to Class java.lang.String
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$templateParamText". You can use this value in queries in .config files.
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
RwiNodes whose SHAPE_TYPE property is RwiShapeType.CLASS.
See RwiShapeType interface for an {@link RwiShapeType#CLASS example}.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$valuetype". You can use this value in queries in .config files.
to Class java.lang.String
RwiNodes whose SHAPE_TYPE property is RwiShapeType.CLASS.
See RwiShapeType interface for an {@link RwiShapeType#CLASS example}.
This property is read-only.
An element can have only one instance of this property.
The value of this constant is "$enum". You can use this value in queries in .config files.
| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||