Package org.apache.ws.java2wsdl.utils

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


        getSchemaLocationMap().put(optionValue.substring(1, optionValue.indexOf(COMMA)),
                optionValue.substring(optionValue.indexOf(COMMA) + 1, optionValue.length() - 1));
    }

    protected void loadSchemaLocationMap() throws Exception {
        Java2WSDLCommandLineOption option = loadOption(IMPORT_XSD_OPTION, IMPORT_XSD_OPTION_LONG);

        if (option != null) {
            ArrayList optionValues = option.getOptionValues();

            for (int count = 0; count < optionValues.size(); ++count) {
                addToSchemaLocationMap(((String) optionValues.get(count)).trim());
            }
        }
View Full Code Here


        }
    }

    protected void resolveClassLoader4InputClasspath() throws Exception {
        URL[] urls = null;
        Java2WSDLCommandLineOption option = loadOption(CLASSPATH_OPTION, CLASSPATH_OPTION_LONG);

        if (option != null) {
            ArrayList optionValues = option.getOptionValues();
            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

        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

    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

    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

    initializeOtherParams();
  }
 
  private Java2WSDLCommandLineOption loadOption(String shortOption, String longOption) {
        //short option gets precedence
        Java2WSDLCommandLineOption option = null;
        if (longOption != null) {
            option = (Java2WSDLCommandLineOption) cmdLineOptions.get(longOption);
            if (option != null) {
                return option;
            }
View Full Code Here

        return option;
    }
 
  protected void initializeSourceClassName() throws Exception
  {
    Java2WSDLCommandLineOption option =
      loadOption(CLASSNAME_OPTION, CLASSNAME_OPTION_LONG);
        sourceClassName = option == null ? null : option.getOptionValue();

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

   * @throws Exception
   */
  protected void resolveFileOutputStream() throws Exception
  {
    File outputFolder;
    Java2WSDLCommandLineOption  option = loadOption(OUTPUT_LOCATION_OPTION,
              OUTPUT_LOCATION_OPTION_LONG);
      String outputFolderName = option == null ? System.getProperty("user.dir") : option.getOptionValue();

      outputFolder = new File(outputFolderName);
      if (!outputFolder.exists()) {
          outputFolder.mkdirs();
      } else if (!outputFolder.isDirectory()) {
          throw new Exception("The specified location " + outputFolderName + "is not a folder");
      }
     
      option = loadOption(OUTPUT_FILENAME_OPTION,
                OUTPUT_FILENAME_OPTION_LONG);
        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(sourceClassName) + WSDL_FILENAME_SUFFIX;
        }
View Full Code Here

       
    }
   
    protected void loadSchemaLocationMap() throws Exception
    {
        Java2WSDLCommandLineOption option = loadOption(IMPORT_XSD_OPTION, IMPORT_XSD_OPTION_LONG);
               
        if (option != null)
        {
            ArrayList optionValues = option.getOptionValues();
           
            for ( int count = 0 ; count < optionValues.size() ; ++count )
            {
                addToSchemaLocationMap(((String)optionValues.get(count)).trim());
            }
View Full Code Here

        }
    }
 
  protected void resolveClassLoader4InputClasspath() throws Exception
  {
        Java2WSDLCommandLineOption option =
            loadOption(CLASSPATH_OPTION, CLASSPATH_OPTION_LONG);
           
    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

TOP

Related Classes of org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption

Copyright © 2018 www.massapicom. 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.