All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.mojo.axistools.HelpMojo Maven / Gradle / Ivy

Go to download

This plugin supports the wsdl2java and java2wsdl tools from the Apache Axis (1) project.

There is a newer version: 1.4
Show newest version
package org.codehaus.mojo.axistools;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;

/**
 * Display help information on axistools-maven-plugin. Call 
  mvn axistools:help -Ddetail=true -Dgoal=<goal-name>
to display parameter details. * * @version generated on Tue Jan 20 21:58:34 CET 2009 * @goal help * @requiresProject false */ public class HelpMojo extends AbstractMojo { /** * If true, display all settable properties for each goal. * * @parameter expression="${detail}" default-value="false" */ private boolean detail; /** * The name of the goal for which to show help. If unspecified, all goals will be displayed. * * @parameter expression="${goal}" */ private java.lang.String goal; /** * The maximum length of a display line. * * @parameter expression="${lineLength}" default-value="80" */ private int lineLength; /** * The number of spaces per indentation level. * * @parameter expression="${indentSize}" default-value="2" */ private int indentSize; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { StringBuffer sb = new StringBuffer(); append( sb, "org.codehaus.mojo:axistools-maven-plugin:1.3", 0 ); append( sb, "", 0 ); append( sb, "Maven Axis Tools Plugin 1.3", 0 ); append( sb, "This plugin supports the wsdl2java and java2wsdl tools from the Apache Axis (1) project.", 1 ); append( sb, "", 0 ); if ( goal == null || goal.length() <= 0 ) { append( sb, "This plugin has 4 goals:", 0 ); append( sb, "", 0 ); } if ( goal == null || goal.length() <= 0 || "admin".equals( goal ) ) { append( sb, "axistools:admin", 0 ); append( sb, "Utility for turning xml into Axis deployment operations (wraps org.apache.axis.utils.Admin)", 1 ); append( sb, "", 0 ); if ( detail ) { append( sb, "Available parameters:", 1 ); append( sb, "", 0 ); append( sb, "configOutputDirectory", 2 ); append( sb, "Where the server-config.wsdd or client-config.wsdd should go", 3 ); append( sb, "", 0 ); append( sb, "inputFiles", 2 ); append( sb, "Files used to create deployment file", 3 ); append( sb, "", 0 ); append( sb, "isServerConfig", 2 ); append( sb, "Generate a server or client deployment file", 3 ); append( sb, "", 0 ); } } if ( goal == null || goal.length() <= 0 || "help".equals( goal ) ) { append( sb, "axistools:help", 0 ); append( sb, "Display help information on axistools-maven-plugin. Call\n\u00a0\u00a0mvn\u00a0axistools:help\u00a0-Ddetail=true\u00a0-Dgoal=\nto display parameter details.", 1 ); append( sb, "", 0 ); if ( detail ) { append( sb, "Available parameters:", 1 ); append( sb, "", 0 ); append( sb, "detail (Default: false)", 2 ); append( sb, "If true, display all settable properties for each goal.", 3 ); append( sb, "", 0 ); append( sb, "goal", 2 ); append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 ); append( sb, "", 0 ); append( sb, "lineLength (Default: 80)", 2 ); append( sb, "The maximum length of a display line.", 3 ); append( sb, "", 0 ); append( sb, "indentSize (Default: 2)", 2 ); append( sb, "The number of spaces per indentation level.", 3 ); append( sb, "", 0 ); } } if ( goal == null || goal.length() <= 0 || "java2wsdl".equals( goal ) ) { append( sb, "axistools:java2wsdl", 0 ); append( sb, "A Plugin for generating WSDL files using Axis Java2WSDL.", 1 ); append( sb, "", 0 ); if ( detail ) { append( sb, "Available parameters:", 1 ); append( sb, "", 0 ); append( sb, "all", 2 ); append( sb, "Look for allowed methods in inherited class.", 3 ); append( sb, "", 0 ); append( sb, "bindingName", 2 ); append( sb, "Indicates the name to use for the binding element. If not specified, the value of the servicePortName + \'SoapBinding\' is used.", 3 ); append( sb, "", 0 ); append( sb, "classOfPortType", 2 ); append( sb, "(no description available)", 3 ); append( sb, "", 0 ); append( sb, "classesDirectory", 2 ); append( sb, "The directory the compile objects will be located for java2wsdl to source from.", 3 ); append( sb, "", 0 ); append( sb, "excludes", 2 ); append( sb, "List of methods not to export.", 3 ); append( sb, "", 0 ); append( sb, "extraClasses", 2 ); append( sb, "Specify a list of class names which should be included in the types section of the WSDL document. This is useful in the case where your service interface references a base class and you would like your WSDL to contain XML Schema type definitions for these other classes.", 3 ); append( sb, "", 0 ); append( sb, "filename", 2 ); append( sb, "Indicates the name of the output WSDL file.", 3 ); append( sb, "", 0 ); append( sb, "implClass", 2 ); append( sb, "Sometimes extra information is available in the implementation class file. Use this option to specify the implementation class.", 3 ); append( sb, "", 0 ); append( sb, "importSchema", 2 ); append( sb, "A file or URL to an XML Schema that should be physically imported into the generated WSDL.", 3 ); append( sb, "", 0 ); append( sb, "input", 2 ); append( sb, "Optional parameter that indicates the name of the input wsdl file. The output wsdl file will contain everything from the input wsdl file plus the new constructs. If a new construct is already present in the input wsdl file, it is not added. This option is useful for constructing a wsdl file with multiple ports, bindings, or portTypes.", 3 ); append( sb, "", 0 ); append( sb, "location", 2 ); append( sb, "Indicates the url of the location of the service. The name after the last slash or backslash is the name of the service port (unless overridden by the servicePortName option). The service port address location attribute is assigned the specified value.", 3 ); append( sb, "", 0 ); append( sb, "locationImport", 2 ); append( sb, "Used to indicate the location of the interface WSDL when generating an implementation WSDL.", 3 ); append( sb, "", 0 ); append( sb, "methods", 2 ); append( sb, "Methods to export.", 3 ); append( sb, "", 0 ); append( sb, "namespace", 2 ); append( sb, "Indicates the name of the target namespace of the WSDL.", 3 ); append( sb, "", 0 ); append( sb, "namespaceImpl", 2 ); append( sb, "Namespace of the implementation WSDL.", 3 ); append( sb, "", 0 ); append( sb, "outputDirectory", 2 ); append( sb, "Directory for generated content.", 3 ); append( sb, "", 0 ); append( sb, "outputImpl", 2 ); append( sb, "Use this option to indicate the name of the output implementation WSDL file. If specified, Java2WSDL will produce interface and implementation WSDL files. If this option is used, the outputWSDLMode option is ignored.", 3 ); append( sb, "", 0 ); append( sb, "outputWSDLMode", 2 ); append( sb, "Indicates the kind of WSDL to generate. Accepted values are:\n-\tAll --- (default) Generates wsdl containing both interface and implementation WSDL constructs.\n-\tInterface --- Generates a WSDL containing the interface constructs (no service element).\n-\tImplementation -- Generates a WSDL containing the implementation. The interface WSDL is imported via the locationImport option.\n", 3 ); append( sb, "", 0 ); append( sb, "packageToNamespace", 2 ); append( sb, "(no description available)", 3 ); append( sb, "", 0 ); append( sb, "portTypeName", 2 ); append( sb, "Indicates the name to use for the portType element. If not specified, the classOfPortType name is used.", 3 ); append( sb, "", 0 ); append( sb, "serviceElementName", 2 ); append( sb, "(no description available)", 3 ); append( sb, "", 0 ); append( sb, "servicePortName", 2 ); append( sb, "Indicates the name of the service port. If not specified, the service port name is derived from the location value.", 3 ); append( sb, "", 0 ); append( sb, "soapAction", 2 ); append( sb, "The value of the operations soapAction field. Values are DEFAULT, OPERATION or NONE. OPERATION forces soapAction to the name of the operation. DEFAULT causes the soapAction to be set according to the operation\'s meta data (usually \'\'). NONE forces the soapAction to \'\'. The default is DEFAULT.", 3 ); append( sb, "", 0 ); append( sb, "stopClasses", 2 ); append( sb, "List of classes which stop the Java2WSDL inheritance search.", 3 ); append( sb, "", 0 ); append( sb, "style", 2 ); append( sb, "The style of the WSDL document: RPC, DOCUMENT or WRAPPED. The default is RPC. If RPC is specified, an rpc wsdl is generated. If DOCUMENT is specified, a document wsdl is generated. If WRAPPED is specified, a document/literal wsdl is generated using the wrapped approach. Wrapped style forces the use attribute to be literal.", 3 ); append( sb, "", 0 ); append( sb, "typeMappingVersion", 2 ); append( sb, "Choose the default type mapping registry to use. Either 1.1 or 1.2.", 3 ); append( sb, "", 0 ); append( sb, "use", 2 ); append( sb, "The use of the WSDL document: LITERAL or ENCODED. If LITERAL is specified, the XML Schema defines the representation of the XML for the request. If ENCODED is specified, SOAP encoding is specified in the generated WSDL.", 3 ); append( sb, "", 0 ); } } if ( goal == null || goal.length() <= 0 || "wsdl2java".equals( goal ) ) { append( sb, "axistools:wsdl2java", 0 ); append( sb, "A Plugin for generating stubs for WSDL files using Axis WSDL2Java.", 1 ); append( sb, "", 0 ); if ( detail ) { append( sb, "Available parameters:", 1 ); append( sb, "", 0 ); append( sb, "allElements", 2 ); append( sb, "Generate code for all elements, even unreferenced ones. By default, WSDL2Java only generates code for those elements in the WSDL file that are referenced. A note about what it means to be referenced. We cannot simply say: start with the services, generate all bindings referenced by the service, generate all portTypes referenced by the referenced bindings, etc. What if we\'re generating code from a WSDL file that only contains portTypes, messages, and types? If WSDL2Java used service as an anchor, and there\'s no service in the file, then nothing will be generated. So the anchor is the lowest element that exists in the WSDL file in the order:\n1.\ttypes\n2.\tportTypes\n3.\tbindings\n4.\tservices\nFor example, if a WSDL file only contained types, then all the listed types would be generated. But if a WSDL file contained types and a portType, then that portType will be generated and only those types that are referenced by that portType. Note that the anchor is searched for in the WSDL file appearing on the command line, not in imported WSDL files. This allows one WSDL file to import constructs defined in another WSDL file without the nuisance of having all the imported WSDL file\'s constructs generated.", 3 ); append( sb, "", 0 ); append( sb, "debug", 2 ); append( sb, "Print debug information, which currently is WSDL2Java\'s symbol table. Note that this is only printed after the symbol table is complete, ie., after the WSDL is parsed successfully.", 3 ); append( sb, "", 0 ); append( sb, "deployScope", 2 ); append( sb, "Add scope to deploy.xml: \'Application\', \'Request\', \'Session\'", 3 ); append( sb, "", 0 ); append( sb, "factory", 2 ); append( sb, "Name of a custom class that implements GeneratorFactory interface (for extending Java generation functions).", 3 ); append( sb, "", 0 ); append( sb, "fileNamespaceToPackage", 2 ); append( sb, "file of NStoPkg mappings", 3 ); append( sb, "", 0 ); append( sb, "helperGen", 2 ); append( sb, "Emits separate Helper classes for meta data.", 3 ); append( sb, "", 0 ); append( sb, "implementationClassName", 2 ); append( sb, "Use this as the implementation class.", 3 ); append( sb, "", 0 ); append( sb, "mappings", 2 ); append( sb, "mappings are only used when useEmitter is set to true", 3 ); append( sb, "", 0 ); append( sb, "namespaceToPackage", 2 ); append( sb, "Mapping of namespace to package", 3 ); append( sb, "", 0 ); append( sb, "noImports", 2 ); append( sb, "Only generate code for the immediate WSDL document.", 3 ); append( sb, "", 0 ); append( sb, "noWrapped", 2 ); append( sb, "Turn off support for \'wrapped\' document/literal.", 3 ); append( sb, "", 0 ); append( sb, "nsExcludes", 2 ); append( sb, "Namespace to specifically exclude from the generated code (defaults to none excluded until first namespace included with nsIncludes option)", 3 ); append( sb, "", 0 ); append( sb, "nsIncludes", 2 ); append( sb, "Namescape to specifically include in the generated code (defaults to all namespaces unless specifically excluded with the nsExcludes option)", 3 ); append( sb, "", 0 ); append( sb, "outputDirectory", 2 ); append( sb, "(no description available)", 3 ); append( sb, "", 0 ); append( sb, "packageSpace", 2 ); append( sb, "package to create the java files under", 3 ); append( sb, "", 0 ); append( sb, "password", 2 ); append( sb, "Password to access the WSDL-URI.", 3 ); append( sb, "", 0 ); append( sb, "runTestCasesAsUnitTests", 2 ); append( sb, "copy the generated test cases to a generated-sources test directory to be compiled and run as normal surefire unit tests", 3 ); append( sb, "", 0 ); append( sb, "serverSide", 2 ); append( sb, "Emit server-side bindings for web service.", 3 ); append( sb, "", 0 ); append( sb, "skeletonDeploy", 2 ); append( sb, "Deploy skeleton (true) or implementation (false) in deploy.wsdd.", 3 ); append( sb, "", 0 ); append( sb, "sourceDependencies", 2 ); append( sb, "list of source dependencies in the format groupId:artifactId:version:file", 3 ); append( sb, "", 0 ); append( sb, "sourceDependencyDirectory", 2 ); append( sb, "Cache directory for WSDLs from sourceDependencies", 3 ); append( sb, "", 0 ); append( sb, "sourceDirectory", 2 ); append( sb, "source directory that contains .wsdl files", 3 ); append( sb, "", 0 ); append( sb, "staleMillis (Default: 0)", 2 ); append( sb, "The granularity in milliseconds of the last modification date for testing whether a source needs recompilation", 3 ); append( sb, "", 0 ); append( sb, "subPackageByFileName", 2 ); append( sb, "load.wsdl would further subpackage into load.*", 3 ); append( sb, "", 0 ); append( sb, "testCases", 2 ); append( sb, "generate the test cases", 3 ); append( sb, "", 0 ); append( sb, "testSourceDirectory", 2 ); append( sb, "location to place generated test source", 3 ); append( sb, "", 0 ); append( sb, "timeout", 2 ); append( sb, "Timeout in seconds (default is 45, specify -1 to disable).", 3 ); append( sb, "", 0 ); append( sb, "timestampDirectory", 2 ); append( sb, "(no description available)", 3 ); append( sb, "", 0 ); append( sb, "typeMappingVersion", 2 ); append( sb, "Indicate 1.1 or 1.2. The default is 1.1 (SOAP 1.1 JAX-RPC compliant. 1.2 indicates SOAP 1.1 encoded.)", 3 ); append( sb, "", 0 ); append( sb, "urlDownloadDirectory", 2 ); append( sb, "Cache directory for WSDLs from URLs", 3 ); append( sb, "", 0 ); append( sb, "urls", 2 ); append( sb, "list of urls to process", 3 ); append( sb, "", 0 ); append( sb, "useEmitter", 2 ); append( sb, "use the Emitter for generating the java files as opposed to the commandline wsdl2java tool", 3 ); append( sb, "", 0 ); append( sb, "username", 2 ); append( sb, "Username to access the WSDL-URI.", 3 ); append( sb, "", 0 ); append( sb, "verbose", 2 ); append( sb, "See what the tool is generating as it is generating it.", 3 ); append( sb, "", 0 ); append( sb, "wrapArrays", 2 ); append( sb, "(no description available)", 3 ); append( sb, "", 0 ); append( sb, "wsdlFiles", 2 ); append( sb, "List of wsdl files from sourceDirectory to process", 3 ); append( sb, "", 0 ); } } if ( getLog().isInfoEnabled() ) { getLog().info( sb.toString() ); } } /** *

Repeat a String n times to form a new string.

* * @param str String to repeat * @param repeat number of times to repeat str * @return String with repeated String * @throws NegativeArraySizeException if repeat < 0 * @throws NullPointerException if str is null */ private static String repeat( String str, int repeat ) { StringBuffer buffer = new StringBuffer( repeat * str.length() ); for ( int i = 0; i < repeat; i++ ) { buffer.append( str ); } return buffer.toString(); } private void append( StringBuffer sb, String description, int indent ) { for ( Iterator it = toLines( description, indent ).iterator(); it.hasNext(); ) { sb.append( it.next().toString() ).append( '\n' ); } } /** * Splits the specified text into lines of convenient display length. * * @param text The text to split into lines, must not be null. * @param indent The base indentation level of each line, must not be negative. * @return The sequence of display lines, never null. */ private List toLines( String text, int indent ) { List lines = new ArrayList(); String ind = repeat( "\t", indent ); String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" ); for ( int i = 0; i < plainLines.length; i++ ) { toLines( lines, ind + plainLines[i] ); } return lines; } /** * Adds the specified line to the output sequence, performing line wrapping if necessary. * * @param lines The sequence of display lines, must not be null. * @param line The line to add, must not be null. */ private void toLines( List lines, String line ) { int lineIndent = getIndentLevel( line ); StringBuffer buf = new StringBuffer( 256 ); String[] tokens = line.split( " +" ); for ( int i = 0; i < tokens.length; i++ ) { String token = tokens[i]; if ( i > 0 ) { if ( buf.length() + token.length() >= lineLength ) { lines.add( buf.toString() ); buf.setLength( 0 ); buf.append( repeat( " ", lineIndent * indentSize ) ); } else { buf.append( ' ' ); } } for ( int j = 0; j < token.length(); j++ ) { char c = token.charAt( j ); if ( c == '\t' ) { buf.append( repeat( " ", indentSize - buf.length() % indentSize ) ); } else if ( c == '\u00A0' ) { buf.append( ' ' ); } else { buf.append( c ); } } } lines.add( buf.toString() ); } /** * Gets the indentation level of the specified line. * * @param line The line whose indentation level should be retrieved, must not be null. * @return The indentation level of the line. */ private static int getIndentLevel( String line ) { int level = 0; for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ ) { level++; } for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ ) { if ( line.charAt( i ) == '\t' ) { level++; break; } } return level; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy