Fornax-Platform
Forum

[Sculptor] add @param and @return to javadoc

View: New views
3 Messages — Rating Filter:   Alert me  

[Sculptor] add @param and @return to javadoc

by amphoras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'd like to add the @param and @return javadoc tags to the getters and setters.  What is the best way to go about this?  I can see definitions like this in DomainObject.xpt:

«DEFINE propertySetter FOR Attribute»
    «formatJavaDoc()»
    «getVisibilityLitteralSetter()»void set«name.toFirstUpper()»(«getTypeName()» «name») {
        this.«name» = «name»;
    };
«ENDDEFINE»

However, I am not sure how to get to formatJavaDoc()'s output to add the @param tag.  

Any help would be greatly appreciated.

Thanks!
--Polly

Re: [Sculptor] add @param and @return to javadoc

by Patrik Nordwall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Add something like this to SpecialCases.xpt:

«EXTENSION extensions::myhelper»

«AROUND *::propertyGetter FOR Attribute»
    «formatGetterJavaDoc()»
    «getVisibilityLitteralGetter()»«getTypeName()» «getGetAccessor()»() {
        return «name»;
    };
«ENDAROUND»

«AROUND *::propertySetter FOR Attribute»
    «formatSetterJavaDoc()»
    «getVisibilityLitteralSetter()»void set«name.toFirstUpper()»(«getTypeName()» «name») {
        this.«name» = «name»;
    };
«ENDAROUND»

Define formatGetterJavaDoc, and formatSetterJavaDoc
in extensions/myhelper.ext

Implement them in similar way as is done in sculptor helper.ext, GenerationHelper.java

/Patrik


amphoras wrote:
Hi,

I'd like to add the @param and @return javadoc tags to the getters and setters.  What is the best way to go about this?  I can see definitions like this in DomainObject.xpt:

«DEFINE propertySetter FOR Attribute»
    «formatJavaDoc()»
    «getVisibilityLitteralSetter()»void set«name.toFirstUpper()»(«getTypeName()» «name») {
        this.«name» = «name»;
    };
«ENDDEFINE»

However, I am not sure how to get to formatJavaDoc()'s output to add the @param tag.  

Any help would be greatly appreciated.

Thanks!
--Polly

Re: [Sculptor] add @param and @return to javadoc

by amphoras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Patrik,

Thank you for the detailed advice.  It's exactly what I need.  Thanks!

--Polly


Patrik Nordwall wrote:
Add something like this to SpecialCases.xpt:

«EXTENSION extensions::myhelper»

«AROUND *::propertyGetter FOR Attribute»
    «formatGetterJavaDoc()»
    «getVisibilityLitteralGetter()»«getTypeName()» «getGetAccessor()»() {
        return «name»;
    };
«ENDAROUND»

«AROUND *::propertySetter FOR Attribute»
    «formatSetterJavaDoc()»
    «getVisibilityLitteralSetter()»void set«name.toFirstUpper()»(«getTypeName()» «name») {
        this.«name» = «name»;
    };
«ENDAROUND»

Define formatGetterJavaDoc, and formatSetterJavaDoc
in extensions/myhelper.ext

Implement them in similar way as is done in sculptor helper.ext, GenerationHelper.java

/Patrik

LightInTheBox - Buy quality products at wholesale price