Commande WADL2JAVA
L'outil de ligne de commande wadl2java traite un fichier WADL (Web Application Description Language) existant et génère les artefacts requis pour le développement d'applications de service Web de l'API Java™ API for RESTful Web Services (JAX-RS). L'outil de ligne de commande wadl2java prend en charge l'approche descendante pour le développement de services Web JAX-RS. Lorsque vous commencez avec un fichier WADL existant, utilisez l'outil de ligne de commande wadl2java pour générer les artefacts JAX-RS requis.
WADL (Web Application Description Language)
WADL est un langage de description centré sur les ressources qui est conçu pour faciliter la modélisation, la description et les tests des applications Web RESTful. Pour plus d'informations, voir Web Application Description Language.Syntaxe
La syntaxe de la commande est la suivante :
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