Thread View: borland.public.together.documentation
2 messages
2 total messages
Started by Eliezer
Wed, 23 Nov 2005 13:33
Documenting .net class properties (getter/setter)
Author: Eliezer
Date: Wed, 23 Nov 2005 13:33
Date: Wed, 23 Nov 2005 13:33
7 lines
1177 bytes
1177 bytes
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
Re: Documenting .net class properties (getter/setter)
Author: ElenaA
Date: Thu, 24 Nov 2005 15:29
Date: Thu, 24 Nov 2005 15:29
64 lines
3492 bytes
3492 bytes
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" <eliezerb@matrix.co.il> wrote in message
news:43847dcb$1@newsgroups.borland.com...
>
> 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
>
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads