Examples of Java2WSDLCommandLineOption


Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

        classLoader = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader());
    }

    protected void initializeOtherParams() {
        // set the other parameters to the builder
        Java2WSDLCommandLineOption option =
            loadOption(SCHEMA_TARGET_NAMESPACE_OPTION, SCHEMA_TARGET_NAMESPACE_OPTION_LONG);
        schemaTargetNamespace = (option == null) ? null : option.getOptionValue();

        option = loadOption(SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION, SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION_LONG);
        schemaTargetNamespacePrefix = (option == null) ? null : option.getOptionValue();

        option = loadOption(TARGET_NAMESPACE_OPTION, TARGET_NAMESPACE_OPTION_LONG);
        targetNamespace = (option == null) ? null : option.getOptionValue();

        option = loadOption(TARGET_NAMESPACE_PREFIX_OPTION, TARGET_NAMESPACE_PREFIX_OPTION_LONG);
        targetNamespacePrefix = (option == null) ? null : option.getOptionValue();

        option = loadOption(SERVICE_NAME_OPTION, SERVICE_NAME_OPTION_LONG);
        serviceName = (option == null) ? Java2WSDLUtils.getSimpleClassName(sourceClassName) : option.getOptionValue();

        option = loadOption(STYLE_OPTION, STYLE_OPTION);
        style = (option == null) ? null : option.getOptionValue();

        option = loadOption(LOCATION_OPTION, LOCATION_OPTION);
        locationUri = (option == null) ? null : option.getOptionValue();

        option = loadOption(USE_OPTION, USE_OPTION);
        use = (option == null) ? null : option.getOptionValue();

        option = loadOption(ATTR_FORM_DEFAULT_OPTION, ATTR_FORM_DEFAULT_OPTION_LONG);
        attrFormDefault = (option == null) ? null : option.getOptionValue();

        option = loadOption(ELEMENT_FORM_DEFAULT_OPTION, ELEMENT_FORM_DEFAULT_OPTION_LONG);
        elementFormDefault = option == null ? null : option.getOptionValue();

        option = loadOption(TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION, TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION_LONG);
        extraClasses = option == null ? new ArrayList() : option.getOptionValues();

        option = loadOption(TuscanyJava2WSDLConstants.FACTORY_CLASSNAMES_OPTION, TuscanyJava2WSDLConstants.FACTORY_CLASSNAMES_OPTION_LONG);
        factoryClassNames = option == null ? new ArrayList() : option.getOptionValues();
    }
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

    protected Map createOptionsMap()
    {
    Map optionsMap = new Hashtable();
 
          optionsMap.put(Java2WSDLConstants.CLASSNAME_OPTION,
            new Java2WSDLCommandLineOption(Java2WSDLConstants.CLASSNAME_OPTION, new String[]{sourceClassName}));
       
    if ( targetLocation != null )
    {
        optionsMap.put(Java2WSDLConstants.OUTPUT_LOCATION_OPTION,
            new Java2WSDLCommandLineOption(Java2WSDLConstants.OUTPUT_LOCATION_OPTION, new String[]{targetLocation}));
    }
   
    if ( wsdlFilename != null )
    {
        optionsMap.put(Java2WSDLConstants.OUTPUT_FILENAME_OPTION,
            new Java2WSDLCommandLineOption(Java2WSDLConstants.OUTPUT_FILENAME_OPTION, new String[]{wsdlFilename}));
    }
 
    if ( classpaths != null && classpaths.length > 0 )
    {
        optionsMap.put(Java2WSDLConstants.CLASSPATH_OPTION,
            new Java2WSDLCommandLineOption(Java2WSDLConstants.CLASSPATH_OPTION, classpaths));
    }
 
    if ( serviceName != null  )
    {
        optionsMap.put(Java2WSDLConstants.SERVICE_NAME_OPTION,
            new Java2WSDLCommandLineOption(Java2WSDLConstants.SERVICE_NAME_OPTION, new String[]{serviceName}));
    }
   
     if ( bindingStyle != null  )
    {
        optionsMap.put(Java2WSDLConstants.STYLE_OPTION,
            new Java2WSDLCommandLineOption(Java2WSDLConstants.STYLE_OPTION, new String[]{bindingStyle}));
    }
 
    if ( bindingUse != null  )
    {
        optionsMap.put(Java2WSDLConstants.USE_OPTION,
            new Java2WSDLCommandLineOption(Java2WSDLConstants.USE_OPTION, new String[]{bindingUse}));
    }
 
    if ( soapAddress != null  )
    {
        optionsMap.put(Java2WSDLConstants.LOCATION_OPTION,
            new Java2WSDLCommandLineOption(Java2WSDLConstants.LOCATION_OPTION, new String[]{soapAddress}));
    }

     return optionsMap;
    }
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

    public Map fillOptionMap()  {

        Map optionMap = new HashMap();

        optionMap.put(Java2WSDLConstants .CLASSNAME_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants.CLASSNAME_OPTION ,
                        new String[]{getClassName() })
        );

        optionMap.put(Java2WSDLConstants.CLASSPATH_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants .CLASSPATH_OPTION ,
                        getClassPathList())
        );

        optionMap.put(Java2WSDLConstants .TARGET_NAMESPACE_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants .TARGET_NAMESPACE_OPTION ,
                        new String[]{getTargetNamespace() })
        );

        optionMap.put(Java2WSDLConstants .TARGET_NAMESPACE_PREFIX_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants .TARGET_NAMESPACE_PREFIX_OPTION ,
                        new String[]{getTargetNamespacePrefix()})
        );

        optionMap.put(Java2WSDLConstants .SCHEMA_TARGET_NAMESPACE_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants .SCHEMA_TARGET_NAMESPACE_OPTION ,
                        new String[]{getSchemaTargetNamespace() })
        );

        optionMap.put(Java2WSDLConstants .SERVICE_NAME_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants .SERVICE_NAME_OPTION ,
                        new String[]{getServiceName() })
        );

        optionMap.put(Java2WSDLConstants .SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants .SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION ,
                        new String[]{getSchemaTargetNamespacePrefix() })
        );

        optionMap.put(Java2WSDLConstants .OUTPUT_LOCATION_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants .OUTPUT_LOCATION_OPTION ,
                        new String[]{getOutputLocation()})
        );

        optionMap.put(Java2WSDLConstants .OUTPUT_FILENAME_OPTION ,
                new Java2WSDLCommandLineOption(Java2WSDLConstants .OUTPUT_FILENAME_OPTION ,
                        new String[]{getOutputWSDLName()})
        );

        return optionMap;
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

    }

    private void addToOptionMap(Map map, String option, String[] value) {
        if (value != null) {
            map.put(option,
                    new Java2WSDLCommandLineOption(option, value));
        }
    }
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

    }

    private void addToOptionMap(Map map, String option, ArrayList values) {
        if (values != null && !values.isEmpty()) {
            map.put(option,
                    new Java2WSDLCommandLineOption(option, values));
        }
    }
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

                try {
                    monitor.worked(1);
                    //fill the option map
                    Map optionsMap = new HashMap();
                    Java2WSDLCommandLineOption option = new Java2WSDLCommandLineOption(
                        CLASSNAME_OPTION,new String[]{javaSourceSelectionPage.getClassName()});
                    optionsMap.put(CLASSNAME_OPTION,option);
                   
                    option = new Java2WSDLCommandLineOption(
                        CLASSPATH_OPTION,javaSourceSelectionPage.getClassPathList());
                    optionsMap.put(CLASSPATH_OPTION,option);
                   
                    option = new Java2WSDLCommandLineOption(
                        TARGET_NAMESPACE_OPTION,
                        new String[]{java2wsdlOptionsPage.getTargetNamespace()});
                    optionsMap.put(TARGET_NAMESPACE_OPTION,option);
                   
                    option = new Java2WSDLCommandLineOption(
                        TARGET_NAMESPACE_PREFIX_OPTION,
                        new String[]{java2wsdlOptionsPage.getTargetNamespacePrefix()});
                    optionsMap.put(TARGET_NAMESPACE_PREFIX_OPTION,option);
                   
                    option = new Java2WSDLCommandLineOption(
                        SCHEMA_TARGET_NAMESPACE_OPTION,
                        new String[]{java2wsdlOptionsPage.getSchemaTargetNamespace()});
                    optionsMap.put(SCHEMA_TARGET_NAMESPACE_OPTION,option);
                   
                    option = new Java2WSDLCommandLineOption(
                        SERVICE_NAME_OPTION,new String[]{java2wsdlOptionsPage.getServiceName()});
                    optionsMap.put(SERVICE_NAME_OPTION,option);
                   
                    option = new Java2WSDLCommandLineOption(
                        SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION,
                        new String[]{java2wsdlOptionsPage.getSchemaTargetNamespacePrefix()});
                    optionsMap.put(SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION,option);
                   
                    option = new Java2WSDLCommandLineOption(
                        OUTPUT_LOCATION_OPTION,new String[]{java2wsdlOutputLocationPage.getOutputLocation()});
                    optionsMap.put(OUTPUT_LOCATION_OPTION,option);
                   
                    option = new Java2WSDLCommandLineOption(
                        OUTPUT_FILENAME_OPTION,new String[]{java2wsdlOutputLocationPage.getOutputWSDLName()});
                    optionsMap.put(OUTPUT_FILENAME_OPTION,option);
                   
                    monitor.worked(1);
                   
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

    public static final String WSDL_FILENAME_SUFFIX = ".wsdl";
    public static final String COMMA = ",";

    public Java2WSDLCodegenEngine(Map optionsMap) throws Exception {
        //create a new  Java2WSDLBuilder and populate it
        Java2WSDLCommandLineOption option = loadOption(Java2WSDLConstants.CLASSNAME_OPTION, Java2WSDLConstants.CLASSNAME_OPTION_LONG, optionsMap);
        String className = option == null ? null : option.getOptionValue();

        if (className == null || className.length() == 0) {
            throw new Exception("class name must be present!");
        }
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

        }
    }

    private FileOutputStream resolveOutputStream(String className, Map optionsMap) throws Exception
    {
        Java2WSDLCommandLineOption option = loadOption(Java2WSDLConstants.OUTPUT_LOCATION_OPTION,
                                                       Java2WSDLConstants.OUTPUT_LOCATION_OPTION_LONG, optionsMap);
        String outputFolderName = option == null ? System.getProperty("user.dir") : option.getOptionValue();

        File outputFolder;
        outputFolder = new File(outputFolderName);
        if (!outputFolder.exists()) {
            outputFolder.mkdirs();
        } else if (!outputFolder.isDirectory()) {
            throw new Exception("The specivied location " + outputFolderName + "is not a folder");
        }
       
        option = loadOption(Java2WSDLConstants.OUTPUT_FILENAME_OPTION,
                            Java2WSDLConstants.OUTPUT_FILENAME_OPTION_LONG, optionsMap);
        String outputFileName = option == null ? null : option.getOptionValue();
        //derive a file name from the class name if the filename is not specified
        if (outputFileName == null) {
            outputFileName = Java2WSDLUtils.getSimpleClassName(className) + WSDL_FILENAME_SUFFIX;
        }
   
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

   
    private ClassLoader resolveClassLoader(Map optionsMap) throws Exception
    {
        // if the class path is present, create a URL class loader with those
        //class path entries present. if not just take the  TCCL
        Java2WSDLCommandLineOption option = loadOption(Java2WSDLConstants.CLASSPATH_OPTION,
                Java2WSDLConstants.CLASSPATH_OPTION_LONG, optionsMap);

        ClassLoader classLoader;

        if (option != null) {
            ArrayList optionValues = option.getOptionValues();
            URL[] urls = new URL[optionValues.size()];
            String[] classPathEntries = (String[]) optionValues.toArray(new String[optionValues.size()]);

            try {
                for (int i = 0; i < classPathEntries.length; i++) {
View Full Code Here

Examples of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

    }

    private void configureJava2WSDLBuilder(Map optionsMap, String className) throws Exception
    {
        //set the other parameters to the builder
        Java2WSDLCommandLineOption option = loadOption(Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_OPTION,
                Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setSchemaTargetNamespace(option == null ? null : option.getOptionValue());

        option = loadOption(Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION,
                Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setSchemaTargetNamespacePrefix(option == null ? null : option.getOptionValue());

        option = loadOption(Java2WSDLConstants.TARGET_NAMESPACE_OPTION,
                Java2WSDLConstants.TARGET_NAMESPACE_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setTargetNamespace(option == null ? null : option.getOptionValue());

        option = loadOption(Java2WSDLConstants.TARGET_NAMESPACE_PREFIX_OPTION,
                Java2WSDLConstants.TARGET_NAMESPACE_PREFIX_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setTargetNamespacePrefix(option == null ? null : option.getOptionValue());

        option = loadOption(Java2WSDLConstants.SERVICE_NAME_OPTION,
                Java2WSDLConstants.SERVICE_NAME_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setServiceName(option == null ? Java2WSDLUtils.getSimpleClassName(className) : option.getOptionValue());

        option = loadOption(Java2WSDLConstants.STYLE_OPTION,
                Java2WSDLConstants.STYLE_OPTION, optionsMap);
        if (option != null) {
            java2WsdlBuilder.setStyle(option.getOptionValue());
        }

        option = loadOption(Java2WSDLConstants.LOCATION_OPTION,
                Java2WSDLConstants.LOCATION_OPTION, optionsMap);
        if (option != null) {
            java2WsdlBuilder.setLocationUri(option.getOptionValue());
        }

        option = loadOption(Java2WSDLConstants.USE_OPTION,
                Java2WSDLConstants.USE_OPTION, optionsMap);
        if (option != null) {
            java2WsdlBuilder.setUse(option.getOptionValue());
        }
       
        option = loadOption(Java2WSDLConstants.ATTR_FORM_DEFAULT_OPTION,
                Java2WSDLConstants.ATTR_FORM_DEFAULT_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setAttrFormDefault(option == null ? null : option.getOptionValue());
       
        option = loadOption(Java2WSDLConstants.ELEMENT_FORM_DEFAULT_OPTION,
                Java2WSDLConstants.ELEMENT_FORM_DEFAULT_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setElementFormDefault(option == null ? null : option.getOptionValue());
       
        option = loadOption(Java2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION,
                            Java2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setExtraClasses(option == null ? new ArrayList() : option.getOptionValues());
       
        option = loadOption(Java2WSDLConstants.NAMESPACE_GENERATOR_OPTION,
                            Java2WSDLConstants.NAMESPACE_GENERATOR_OPTION_LONG, optionsMap);
        if ( option != null ) {
            java2WsdlBuilder.setNsGenClassName(option.getOptionValue());
        }
       
        option = loadOption(Java2WSDLConstants.SCHEMA_GENERATOR_OPTION,
                            Java2WSDLConstants.SCHEMA_GENERATOR_OPTION_LONG, optionsMap);
        if ( option != null ) {
            java2WsdlBuilder.setSchemaGenClassName(option.getOptionValue());
        }

        option = loadOption(Java2WSDLConstants.JAVA_PKG_2_NSMAP_OPTION,
                            Java2WSDLConstants.JAVA_PKG_2_NSMAP_OPTION_LONG, optionsMap);
        java2WsdlBuilder.setPkg2nsMap(loadJavaPkg2NamespaceMap(option));

        option = loadOption(Java2WSDLConstants.WSDL_VERSION_OPTION,
                           Java2WSDLConstants.WSDL_VERSION_OPTION_LONG,
                           optionsMap);
        if (option != null) {
            String optionValue = option.getOptionValue();
            if (Java2WSDLConstants.WSDL_VERSION_2.equals(optionValue) ||
                    Java2WSDLConstants.WSDL_VERSION_2_OPTIONAL.equals(optionValue)) {
                //users can say either 2.0 or 2 - we  just set it to the constant
                java2WsdlBuilder.setWSDLVersion(Java2WSDLConstants.WSDL_VERSION_2);
            } //ignore the other cases - they'll be taken as 1.1
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.