Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Documenting .net class properties (getter/setter)

1 view
Skip to first unread message

eliezerb

unread,
Nov 22, 2005, 1:59:01 PM11/22/05
to
Hi,

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

LR

unread,
Nov 23, 2005, 6:50:26 AM11/23/05
to
Hi,

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

Eliezer

unread,
Nov 23, 2005, 8:33:47 AM11/23/05
to

Hi,

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

ElenaA

unread,
Nov 24, 2005, 10:29:33 AM11/24/05
to
do you want to output smth. like 'has getter'/'has setter' in documentation
for each C# property? If you are using TCC/TA1.*, this can be done with
GenDoc by templates.
To do this, I'd recommend using invokeForName() GenDoc function.
Create, e.g., the following class:

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...

0 new messages