Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Need a way to control the name of the generated class #43

Open
glassfishrobot opened this issue Nov 21, 2011 · 12 comments
Open

Need a way to control the name of the generated class #43

glassfishrobot opened this issue Nov 21, 2011 · 12 comments

Comments

@glassfishrobot
Copy link
Contributor

The generation API should provide a way for the client to specify the name of the class being generated, currently this can only be defaulted from the URL.

A static API that allows the development tools to generate an API should be provided.

@glassfishrobot
Copy link
Contributor Author

Reported by gdavison

@glassfishrobot
Copy link
Contributor Author

Issue-Links:
is duplicated by
WADL-37

@glassfishrobot
Copy link
Contributor Author

Was assigned to gdavison

@glassfishrobot
Copy link
Contributor Author

aroller said:
Changes to the Maven Mojo that will allow configuration of the custom class names (see attached file).

/**

  • A list of key/value pairs with the key being the Base URL in the WADL file. The value is the

  • desired name of the resulting class.

  • http://localhost:8080

  • MyApi

  • http://example.com/api

  • MyApi

  • Properties used instead of map because colon is not allowed in xml element name.

  • @parameter expression="$ {customClassNames}

    "
    */
    private Properties customClassNames;

@glassfishrobot
Copy link
Contributor Author

File: Wadl2JavaMojo.java
Attached By: aroller

@glassfishrobot
Copy link
Contributor Author

aroller said:
The resulting Generated file

@glassfishrobot
Copy link
Contributor Author

File: MyApi.java
Attached By: aroller

@glassfishrobot
Copy link
Contributor Author

gdavison said:
Merged proposed fix from Aaron, only remaining problem now is the command line interface before I can close this bug.

@glassfishrobot
Copy link
Contributor Author

sirgeek said:
Couldn't something as simple as -r [STRING] be done as a parameter (if it is present, use it else use exactly what you use now.

i.e. something like:

wadl2java -r WebServices -p com.isone.testing.webservices.v1_0a -o ../../../workspace/webservices/src ../../../sqaCVS/www/src-bind/wadl_1.31.xml

@glassfishrobot
Copy link
Contributor Author

gdavison said:
Unfortunately in the above examples you can have multiple root resources in a WADL so you need to be able to enter names for each URI, hence the complication.

@glassfishrobot
Copy link
Contributor Author

sirgeek said:
what about using something like the jax-rs-catalog.xml ?

Would that work ?

@glassfishrobot
Copy link
Contributor Author

This issue was imported from java.net JIRA WADL-43

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants