Fields Summary |
---|
protected static final int | SERVER_OPTField SERVER_OPT |
protected static final int | SKELETON_DEPLOY_OPTField SKELETON_DEPLOY_OPT |
protected static final int | NAMESPACE_OPTField NAMESPACE_OPT |
protected static final int | NAMESPACE_FILE_OPTField NAMESPACE_FILE_OPT |
protected static final int | OUTPUT_OPTField OUTPUT_OPT |
protected static final int | SCOPE_OPTField SCOPE_OPT |
protected static final int | TEST_OPTField TEST_OPT |
protected static final int | BUILDFILE_OPTField BUILDFILE_OPT |
protected static final int | PACKAGE_OPTField PACKAGE_OPT |
protected static final int | ALL_OPTField ALL_OPT |
protected static final int | TYPEMAPPING_OPTField TYPEMAPPING_OPT |
protected static final int | FACTORY_CLASS_OPTField FACTORY_CLASS_OPT |
protected static final int | HELPER_CLASS_OPTField HELPER_CLASS_OPT |
protected static final int | USERNAME_OPTField USERNAME_OPT |
protected static final int | PASSWORD_OPTField PASSWORD_OPT |
protected static final int | CLASSPATH_OPT |
protected boolean | bPackageOptField bPackageOpt |
protected static final int | NS_INCLUDE_OPTField namespace include |
protected static final int | NS_EXCLUDE_OPTFiled namespace exclude |
protected static final int | IMPL_CLASS_OPTField IMPL_CLASS_OPT |
protected static final int | ALLOW_INVALID_URL_OPTField ALLOW_INVALID_URL_OPT |
protected static final int | WRAP_ARRAYS_OPTWrap arrays option |
private org.apache.axis.wsdl.toJava.Emitter | emitterField emitter |
protected static final org.apache.axis.utils.CLOptionDescriptor[] | optionsDefine the understood options. Each CLOptionDescriptor contains:
- The "long" version of the option. Eg, "help" means that "--help" will
be recognised.
- The option flags, governing the option's argument(s).
- The "short" version of the option. Eg, 'h' means that "-h" will be
recognised.
- A description of the option for the usage message |
Methods Summary |
---|
protected org.apache.axis.wsdl.gen.Parser | createParser()Instantiate an extension of the Parser
return new Emitter();
|
public static void | main(java.lang.String[] args)Main
Run the WSDL2Java emitter with the specified command-line arguments
WSDL2Java wsdl2java = new WSDL2Java();
wsdl2java.run(args);
|
protected void | parseOption(org.apache.axis.utils.CLOption option)Parse an option
switch (option.getId()) {
case FACTORY_CLASS_OPT:
emitter.setFactory(option.getArgument());
break;
case HELPER_CLASS_OPT:
emitter.setHelperWanted(true);
break;
case SKELETON_DEPLOY_OPT:
emitter.setSkeletonWanted(
JavaUtils.isTrueExplicitly(option.getArgument(0)));
// --skeletonDeploy assumes --server-side, so fall thru
case SERVER_OPT:
emitter.setServerSide(true);
break;
case NAMESPACE_OPT:
String namespace = option.getArgument(0);
String packageName = option.getArgument(1);
emitter.getNamespaceMap().put(namespace, packageName);
break;
case NAMESPACE_FILE_OPT:
emitter.setNStoPkg(option.getArgument());
break;
case PACKAGE_OPT:
bPackageOpt = true;
emitter.setPackageName(option.getArgument());
break;
case OUTPUT_OPT:
emitter.setOutputDir(option.getArgument());
break;
case SCOPE_OPT:
String arg = option.getArgument();
// Provide 'null' default, prevents logging internal error.
// we have something different to report here.
Scope scope = Scope.getScope(arg, null);
if (scope != null) {
emitter.setScope(scope);
} else {
System.err.println(Messages.getMessage("badScope00", arg));
}
break;
case TEST_OPT:
emitter.setTestCaseWanted(true);
break;
case BUILDFILE_OPT:
emitter.setBuildFileWanted(true);
break;
case ALL_OPT:
emitter.setAllWanted(true);
break;
case TYPEMAPPING_OPT:
String tmValue = option.getArgument();
if (tmValue.equals("1.0")) {
emitter.setTypeMappingVersion("1.0");
} else if (tmValue.equals("1.1")) {
emitter.setTypeMappingVersion("1.1");
} else if (tmValue.equals("1.2")) {
emitter.setTypeMappingVersion("1.2");
} else if (tmValue.equals("1.3")) {
emitter.setTypeMappingVersion("1.3");
} else {
System.out.println(
Messages.getMessage("badTypeMappingOption00"));
}
break;
case USERNAME_OPT:
emitter.setUsername(option.getArgument());
break;
case PASSWORD_OPT:
emitter.setPassword(option.getArgument());
break;
case CLASSPATH_OPT:
ClassUtils.setDefaultClassLoader(ClassUtils.createClassLoader(
option.getArgument(),
this.getClass().getClassLoader()));
break;
case NS_INCLUDE_OPT:
NamespaceSelector include = new NamespaceSelector();
include.setNamespace(option.getArgument());
emitter.getNamespaceIncludes().add(include);
break;
case NS_EXCLUDE_OPT:
NamespaceSelector exclude = new NamespaceSelector();
exclude.setNamespace(option.getArgument());
emitter.getNamespaceExcludes().add(exclude);
break;
case IMPL_CLASS_OPT:
emitter.setImplementationClassName(option.getArgument());
break;
case ALLOW_INVALID_URL_OPT:
emitter.setAllowInvalidURL(true);
break;
case WRAP_ARRAYS_OPT:
emitter.setWrapArrays(true);
break;
default :
super.parseOption(option);
}
|
protected void | validateOptions()validateOptions
This method is invoked after the options are set to validate
the option settings.
super.validateOptions();
// validate argument combinations
if (emitter.isSkeletonWanted() && !emitter.isServerSide()) {
System.out.println(Messages.getMessage("badSkeleton00"));
printUsage();
}
if (!emitter.getNamespaceMap().isEmpty() && bPackageOpt) {
System.out.println(Messages.getMessage("badpackage00"));
printUsage();
}
|