cancel
Showing results for 
Search instead for 
Did you mean: 

Impossible to add javadoc comment for the constructor in WD Java

Former Member
0 Kudos

Hi, all.

For the generated java code by Web Dynpro, the constructor method

doesn't have //@@begin nor //@@end line so we cannot write javadoc

for the constructor.

For example, we have HelloWorld01View and its generated code is

like the following.

-


private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;

public HelloWorld01View(IPrivateHelloWorld01View wdThis)

{

this.wdThis = wdThis;

this.wdContext = wdThis.wdGetContext();

this.wdControllerAPI = wdThis.wdGetAPI();

this.wdComponentAPI = wdThis.wdGetAPI().getComponent();

}

//@@begin javadoc:wdDoInit()

/** Hook method called to initialize controller. */

//@@end

public void wdDoInit()

{

//@@begin wdDoInit()

//@@end

}

-


In the constructor "public HelloWorld01View(IPrivateHelloWorld01View wdThis)",

there is no //@@begin and //@@end line while method wdDoInit() has.

Is this Web Dynpro bug or any particular reason? Any workaround?

Best Regards.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

User Coding Within the Standard Web Dynpro Framework

Within any controller, a set of predefined locations exist where you can add your code.

These are known as hook methods and have standard names such as wdDoInit() or wdDoExit().

You are not permitted to change either the name or the parameters of these hook methods.

There is always a pair of special comment markers within any generated method,

between which you can write code or comments.

Any coding outside the //@@begin and //@@end comment markers will be deleted during the regeneration process.

The coding extract below illustrates how the wdDoInit() method will appear immediately after initial code generation.

//@@begin javadoc:wdDoInit()

/** Hook method called to initialize controller. */

//@@en

dpublic void wdDoInit() {

//@@begin wdDoInit()

//@@end

}

This is the reason.

Thanks,

Lohi.

Answers (1)

Answers (1)

Former Member
0 Kudos

Sejoon,

I'm sure this was done for reason -- this code ia auto-generated by IDE, you may not control/alter it, so there is no reason to document.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net