Apart from the fact that there is an issue with class properties (not
the Together properties, but the actual properties in the code), where
they are partially properties and partially attributes, I could not
find any way to display the Boolean settings of the getter and setter
for a property.
Can someone assist me?
Thanks,
Eliezer
You may ask them directly at Borland at:
http://newsgroups.borland.com/cgi-bin/dnewsweb?cmd=xover&group=borland.public.together.documentation
Hope, they will provide you some information.
However, if you use Together CC 6.x or Architect 1.x, I can say the
following.
That problem may be a bit compicated.
I'm not sure about .NET, but if you look at "properies" of a Java class
on a class diagram, each property XXX is actually a diagram shortcut to
two private methods simultaneously: getXXX() and setXXX().
To get access to those methods, you need to implement something like
this:
RwiNode rwiNode = ...; // the XXX property node of a diagram
for (Enumeration e = rwiNode.codeElements(); e.hasMoreElements();)
{
Object codeElement = e.nextElement();
if (codeElement == null)
break;
// this will be one of the getXXX() and setXXX() methods
RwiElement rwiElement =
RwiModelAccess.getModel().findNode(codeElement);
}
Regards,
Leonid Rudy
http://www.docflex.com
Apart from the fact that there is an issue with class properties (not the Together properties, but the actual properties in the code), where they are partially properties and partially attributes, I could not find any way to display the Boolean settings of the getter and setter for a property.
Thanks,
Eliezer
package com.togethersoft.modules.netTest;
import com.togethersoft.modules.gendoc.api.GenDocContext;
import com.togethersoft.openapi.rwi.RwiElement;
import com.togethersoft.openapi.sci.SciElement;
import com.togethersoft.openapi.sci.SciCompoundMember;
import com.togethersoft.openapi.sci.enum.SciAccessorEnumeration;
import com.togethersoft.openapi.sci.SciAccessor;
import com.togethersoft.openapi.sci.SciProperty;
public class forGenDoc {
public static String func1(GenDocContext context) {
RwiElement elem = context.getRwiElement();
SciElement sciElem = (SciElement)elem.getCodeElement();
StringBuffer buffer = new StringBuffer();
if (sciElem instanceof SciCompoundMember) {
SciCompoundMember myMember = (SciCompoundMember)sciElem;
SciAccessorEnumeration accessors = myMember.accessors();
while (accessors.hasMoreElements()) {
SciAccessor myAccessor = accessors.nextSciAccessor();
boolean hasGetter =
myAccessor.hasProperty(SciProperty.PROPERTY_GET);
boolean hasSetter =
myAccessor.hasProperty(SciProperty.PROPERTY_SET);
if (hasSetter) { buffer.append("isWriteable"); }
if (hasGetter) { buffer.append("isReadable "); }
}
}
return buffer.toString();
}
}
- place forGenDoc.class into %TGH%/modules/com/togethersoft/modules/netTest
- in your template, create an iteration by Attribute, set the following
filter expression for it:
hasProperty("$property")
- add a formula control to the static section under Attribute iterator:
invokeForName("com.togethersoft.modules.netTest.forGenDoc", "func1")
Hope this helps
"Eliezer" <elie...@matrix.co.il> wrote in message
news:43847dcb$1...@newsgroups.borland.com...