WADL2JAVA command
The wadl2java command line tool processes an existing Web Application Description Language (WADL) file and generates the required artifacts for developing Java™ API for RESTful Web Services (JAX-RS) web service applications. The wadl2java command line tool supports the top-down approach to developing JAX-RS web services. When you start with an existing WADL file, use the wadl2java command line tool to generate the required JAX-RS artifacts.
Web Application Description Language (WADL)
WADL is a resource-centric description language that is designed to facilitate the modeling, description, and testing of RESTful web applications. For more information, see Web Application Description Language.Syntax
The command syntax is as follows:
wadl2java --[options]
wadl2java -wadlns wadl-namespace -p package-name -sp [schema-namespace =]package-name -tMap schema-type=java-type * -repMap media-type=class-name * -resource resource-name -b binding-file-name * -catalog catalog-file-name -d output-directory -interface -impl -async methodNames * -generateEnums -inheritResourceParams -noTypes -noVoidForEmptyResponses -noAddressBinding -supportMultipleXmlReps -generateResponseIfHeadersSet -generateResponseForMethods methodNames * -async methodNames * -xjc xjc-argumentsv * -encoding encoding -h|-?|-help -version|-v -verbose|-V -quiet|-q|-Q wadl
Parameters
The following options values are available for the
wadl2java command:
- -wadlns wadl-namespace
- Specify the WADL namespace.
- -p package-name
- Specifies the Java package name to use for the generated code that represents WADL resource elements.
- -sp [schema-namespace =]package-name
- Specifies the Java package name to use for the generated code that represents WADL grammar elements. Optionally specify a namespace to Java package name mapping.
- -tMap schema-type=java-type *
- Specifies the optional mapping between WADL parameter or representation schema type and custom Java type.
- -repMap media-type=class-name *
- Specifies the optional mapping between a WADL representation with no wadl:element attribute and Java class.
- -resource resource-name
- Specify the simple class name to use for the generated code code that represents a WADL resource without the id attribute.
- -b binding-file-name *
- Specify external jaxb binding files. Use one -b flag for each binding file.
- -catalog catalog-file-name
- Specify catalog file to map the imported wadl or schema.
- -d output-directory
- Specify the directory into which the code is placed.
- -interface
- Specifies that interface is generated.
- -impl
- Specifies that a dummy service implementation is generated.
- -async methodNames *
- Specifies a comma-separated list of method names or identifiers that need to support suspended asynchronous invocations.
- -generateEnums
- Specifies that Enum classes can be generated to represent parameters with multiple options.
- -inheritResourceParams
- Specifies that resource-level (path or matrix) parameters can be inherited by child resources.
- -noTypes
- Turns off generating types
- -noVoidForEmptyResponses
- Use JAX-RS Response return type for methods with no response representation.
- -noAddressBinding
- Specifies that the generator might not use the address jaxb binding file to map wsa:EndpointReferenceType or wsa:EndpointReference to javax.xml.ws.wsaddressing.W3CEndpointReference.
- -supportMultipleXmlReps
- Specifies that if a method contains multiple request XML representations then a separate method per every such representation is generated. Do not enable this option when a server-side JAX-RS code is generated. A single method that contains a javax.xml.transform. Source input parameter is generated by default such cases.
- -generateResponseIfHeadersSet
- Use JAX-RS Response return type if WADL Response element has 'header' parameters.
- -generateResponseForMethods methodNames *
- Specifies a comma-separated list of method names or identifiers that need to have JAXRS Response return type generated.
- -async methodNames *
- Specifies a comma-separated list of method names or identifiers that need to support suspended asynchronous invocations.
- -xjc xjc-argumentsv *
- Specifies a comma-separated list of arguments that are passed directly to XJC when the JAXB data binding is used. This option causes XJC to load extra plug-ins that augment code generation. For example, to load the toString(ts) plug-in that adds a toString() method to all generated types the followingarguments would be used: -xjc-Xts A list of available XJC plug-ins can be obtained by using -xjc-X.
- -encoding encoding
- Specifies the charset encoding to use when Java sources are generated.
- -h|-?|-help
- Display detailed information for options.
- -version|-v
- Display the version of the tool.
- -verbose|-V
- Specifies that the generator runs in verbose mode.
- -quiet|-q|-Q
- -quiet|-q|-Q
- wadl
- wadl-url