tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r400341 - in /incubator/tuscany/java/sca/tools: ./ src/main/java/org/apache/tuscany/tools/java2wsdl/generate/
Date Sat, 06 May 2006 17:13:10 GMT
Author: antelder
Date: Sat May  6 10:13:08 2006
New Revision: 400341

URL: http://svn.apache.org/viewcvs?rev=400341&view=rev
Log:
Apply patch for TUSCANY-103 from Venkatakrishnan. Thanks for the patch!

Removed:
    incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLDefaultGenerator.java
    incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWOM2WSDL11Writer.java
    incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWriterUtil.java
Modified:
    incubator/tuscany/java/sca/tools/pom.xml
    incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java
    incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java
    incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java
    incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLModel.java

Modified: incubator/tuscany/java/sca/tools/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/tools/pom.xml?rev=400341&r1=400340&r2=400341&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/pom.xml (original)
+++ incubator/tuscany/java/sca/tools/pom.xml Sat May  6 10:13:08 2006
@@ -158,5 +158,31 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                <excludes>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2OMBuilder.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java</exclude>
+                <exclude>**/org/apache/tuscany/tools/java2wsdl/generate/WSDLModel.java</exclude>
+                </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+
+    </build>
     
 </project>

Modified: incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java?rev=400341&r1=400340&r2=400341&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java
(original)
+++ incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java
Sat May  6 10:13:08 2006
@@ -1,4 +1,7 @@
-package org.apache.tuscany.tools.java2wsdl.generate;
+package org.apache.tuscany.tools.java2wsdl.generate; 
+
+import org.apache.ws.java2wsdl.utils.Java2WSDLOptionsValidator;
+import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOptionParser;
 
 /**
  * This class provides the tooling abstraction to Tuscany Java2WSDL and can be
@@ -9,9 +12,16 @@
 	/**
 	 * @param args
 	 */
-	public static void main(String[] args) {
-		Java2WSDLGeneratorFactory.getInstance().createGenerator().generateWSDL(
-				args);
+	public static void main(String[] args) 
+	{
+		//parse the cmd line args
+		Java2WSDLCommandLineOptionParser commandLineOptionParser = 
+														new Java2WSDLCommandLineOptionParser(args);
+        //  validate the arguments
+        validateCommandLineOptions(commandLineOptionParser);
+		
+		Java2WSDLGeneratorFactory.getInstance().createGenerator().
+												generateWSDL(commandLineOptionParser.getAllOptions());
 
 		// Uncomment the following statement to directly run the Axis2 tool
 		// without
@@ -21,4 +31,13 @@
 	private static void runAxis2Tool(String[] args) {
 		org.apache.axis2.wsdl.Java2WSDL.main(args);
 	}
+	
+	 private static void validateCommandLineOptions(Java2WSDLCommandLineOptionParser parser)
{
+	        if (parser.getAllOptions().size() == 0) {
+	        	org.apache.axis2.wsdl.Java2WSDL.printUsage();
+	        } else if (parser.getInvalidOptions(new Java2WSDLOptionsValidator()).size() >
0) {
+	        	org.apache.axis2.wsdl.Java2WSDL.printUsage();
+	        }
+
+	    }
 }

Modified: incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java?rev=400341&r1=400340&r2=400341&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java
(original)
+++ incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java
Sat May  6 10:13:08 2006
@@ -39,7 +39,7 @@
 	/**
 	 * Default Generator class name
 	 */
-	public static final String DEFAULT_GENERATOR_CLASSNAME = "org.apache.tuscany.tools.java2wsdl.generate.Java2WSDLDefaultGenerator";
+	public static final String DEFAULT_GENERATOR_CLASSNAME = "org.apache.tuscany.tools.java2wsdl.generate.Java2WSDLGeneratorImpl";
 
 	/**
 	 * list of generator classnames in a position that corresponds to their

Modified: incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java?rev=400341&r1=400340&r2=400341&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java
(original)
+++ incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java
Sat May  6 10:13:08 2006
@@ -3,33 +3,17 @@
  */
 package org.apache.tuscany.tools.java2wsdl.generate;
 
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
 import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Vector;
 
 import org.apache.axis2.wsdl.Java2WSDL;
-import org.apache.axis2.wsdl.builder.Java2WOMBuilder;
-import org.apache.axis2.wsdl.builder.Java2WSDLBuilder;
-import org.apache.axis2.wsdl.builder.SchemaGenerator;
-import org.apache.axis2.wsdl.codegen.CodeGenerationException;
-import org.apache.axis2.wsdl.i18n.CodegenMessages;
 import org.apache.axis2.wsdl.util.CommandLineOption;
 import org.apache.axis2.wsdl.util.CommandLineOptionParser;
 import org.apache.axis2.wsdl.util.Java2WSDLOptionsValidator;
-import org.apache.axis2.wsdl.util.CommandLineOptionConstants.Java2WSDLConstants;
-import org.apache.axis2.wsdl.writer.WOMWriter;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.wsdl.WSDLDescription;
-import org.apache.wsdl.impl.WSDLDescriptionImpl;
+import org.apache.ws.java2wsdl.Java2WSDLUtils;
 
 /**
  * This is an implementation of the Java2WSDLGenerator facade. This
@@ -50,9 +34,15 @@
  * it. These will be removed as and when the Axis2 code is fixed.
  * 
  */
-public class Java2WSDLGeneratorImpl extends Java2WSDLBuilder implements
-		Java2WSDLGenerator {
-	public static final String HTTP = "http://";
+public class Java2WSDLGeneratorImpl implements Java2WSDLGenerator 
+{
+	private List<WSDLGenListener> genPhaseListeners = new Vector<WSDLGenListener>();
+	private GenerationParameters genParams = null;
+	private Map<String, CommandLineOption> commandLineOptions = null;
+	private TuscanyJava2WSDLBuilder java2WsdlBuilder;
+	private OutputStream outputStream = null;
+	
+	/*public static final String HTTP = "http://";
 
 	public static final String WSDL_FILENAME_SUFFIX = ".wsdl";
 
@@ -64,23 +54,19 @@
 
 	public static final String DEFAULT_SCHEMA_TARGET_NAMESPACE_PREFIX = "stns";
 
-	private List<WSDLGenListener> genPhaseListeners = new Vector<WSDLGenListener>();
-
-	private Map<String, CommandLineOption> commandLineOptions = null;
-
 	private String sourceClassName = null;
 
-	private OutputStream outputStream = null;
+	
 
 	private ClassLoader classLoader;
 
 	private WSDLDescription wsdlDescription = null;
 
-	private WSDLModel wsdlModel = null;
-
-	public Java2WSDLGeneratorImpl() {
-		super(null, null, null);
+	private WSDLModel wsdlModel = null;*/
 
+	public Java2WSDLGeneratorImpl()
+	{
+		
 	}
 
 	private void multicastGenPhaseCompletionEvent(int genPhase) {
@@ -91,164 +77,36 @@
 		}
 	}
 
-	protected CommandLineOption loadOption(String shortOption,
-			String longOption, Map options) {
-		// short option gets precedence
-		CommandLineOption option = null;
-		if (longOption != null) {
-			option = (CommandLineOption) options.get(longOption);
-			if (option != null) {
-				return option;
-			}
-		}
-		if (shortOption != null) {
-			option = (CommandLineOption) options.get(shortOption);
-		}
-
-		return option;
-	}
-
-	private String getSimpleClassName(String qualifiedName) {
-		int index = qualifiedName.lastIndexOf(".");
-		if (index > 0) {
-			return qualifiedName.substring(index + 1, qualifiedName.length());
-		}
-		return qualifiedName;
-	}
-
-	private void initialize() throws Exception {
-		CommandLineOption option = null;
-
-		// get the input classname
-		option = loadOption(Java2WSDLConstants.CLASSNAME_OPTION,
-				Java2WSDLConstants.CLASSNAME_OPTION_LONG, commandLineOptions);
-		sourceClassName = option == null ? null : option.getOptionValue();
-		if (sourceClassName == null || sourceClassName.equals("")) {
-			throw new CodeGenerationException(CodegenMessages
-					.getMessage("java2wsdl.classIsMust"));
-		}
-
-		if (getOutputStream() == null) {
-			resolveOutputStream();
-		}
-
-		// create and initialize an instance of the Java2WSDLBuilder
-		resolveClassLoader4InputClasspath();
-
-		option = loadOption(Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_OPTION,
-				Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_OPTION_LONG,
-				commandLineOptions);
-		setSchemaTargetNamespace(option == null ? namespaceFromPackageName(sourceClassName)
-				+ "/schema"
-				: option.getOptionValue());
-
-		option = loadOption(
-				Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION,
-				Java2WSDLConstants.SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION_LONG,
-				commandLineOptions);
-		setSchemaTargetNamespacePrefix(option == null ? DEFAULT_SCHEMA_TARGET_NAMESPACE_PREFIX
-				: option.getOptionValue());
-
-		option = loadOption(Java2WSDLConstants.TARGET_NAMESPACE_OPTION,
-				Java2WSDLConstants.TARGET_NAMESPACE_OPTION_LONG,
-				commandLineOptions);
-		setTargetNamespace(option == null ? namespaceFromPackageName(sourceClassName)
-				: option.getOptionValue());
-
-		option = loadOption(Java2WSDLConstants.TARGET_NAMESPACE_PREFIX_OPTION,
-				Java2WSDLConstants.TARGET_NAMESPACE_PREFIX_OPTION_LONG,
-				commandLineOptions);
-		setTargetNamespacePrefix(option == null ? DEFAULT_TARGET_NAMESPACE_PREFIX
-				: option.getOptionValue());
-
-		option = loadOption(Java2WSDLConstants.SERVICE_NAME_OPTION,
-				Java2WSDLConstants.SERVICE_NAME_OPTION_LONG, commandLineOptions);
-		setServiceName(option == null ? getSimpleClassName(sourceClassName)
-				: option.getOptionValue());
-	}
-
-	protected void resolveOutputStream() throws Exception {
-		// create the output stream from the input name of the folder and file
-		// for the WSDL output
-		CommandLineOption option = loadOption(
-				Java2WSDLConstants.OUTPUT_LOCATION_OPTION,
-				Java2WSDLConstants.OUTPUT_LOCATION_OPTION_LONG,
-				commandLineOptions);
-		String outputFolderName = option == null ? System
-				.getProperty("user.dir") : option.getOptionValue();
-
-		option = loadOption(Java2WSDLConstants.OUTPUT_FILENAME_OPTION,
-				Java2WSDLConstants.OUTPUT_FILENAME_OPTION_LONG,
-				commandLineOptions);
-
-		String outputFileName = null;
-		// derive a file name from the class name if the filename is not
-		// specified
-		if (option == null) {
-			outputFileName = getSimpleClassName(sourceClassName)
-					+ WSDL_FILENAME_SUFFIX;
-		} else {
-			outputFileName = option.getOptionValue();
-		}
-
-		File outputFolder = new File(outputFolderName);
-		if (!outputFolder.exists()) {
-			outputFolder.mkdir();
-		} else if (!outputFolder.isDirectory()) {
-			throw new CodeGenerationException(CodegenMessages.getMessage(
-					"java2wsdl.notAFolder", outputFolderName));
-		}
-
-		// first create a file in the given location
-		File outputFile = new File(outputFolder, outputFileName);
-		try {
-			if (!outputFile.exists()) {
-				outputFile.createNewFile();
-			}
-			outputStream = new FileOutputStream(outputFile);
-		} catch (IOException e) {
-			throw new CodeGenerationException(e);
-		}
-
-	}
-
-	private void resolveClassLoader4InputClasspath() 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
-		CommandLineOption option = loadOption(
-				Java2WSDLConstants.CLASSPATH_OPTION,
-				Java2WSDLConstants.CLASSPATH_OPTION_LONG, commandLineOptions);
-
-		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++) {
-					String classPathEntry = classPathEntries[i];
-					// this should be a file(or a URL)
-					if (classPathEntry.startsWith(HTTP)) {
-						urls[i] = new URL(classPathEntry);
-					} else {
-						urls[i] = new File(classPathEntry).toURL();
-					}
-				}
-			} catch (MalformedURLException e) {
-				throw new CodeGenerationException(e);
-			}
-
-			classLoader = new URLClassLoader(urls, Thread.currentThread()
-					.getContextClassLoader());
-
-		} else {
-			classLoader = Thread.currentThread().getContextClassLoader();
-		}
-
-	}
-
-	protected boolean validateInputArgs(String[] args) {
+	private void initJava2WSDLBuilder() throws Exception 
+	{
+//		Now we are done with loading the basic values - time to create the builder
+        java2WsdlBuilder = new TuscanyJava2WSDLBuilder(genParams.getOutputFileStream(),
+        										genParams.getSourceClassName(),
+        										genParams.getClassLoader());
+        java2WsdlBuilder.setSchemaTargetNamespace(genParams.getSchemaTargetNamespace());
+        java2WsdlBuilder.setSchemaTargetNamespacePrefix(genParams.getSchemaTargetNamespacePrefix());
+        java2WsdlBuilder.setTargetNamespace(genParams.getTargetNamespace());
+        java2WsdlBuilder.setTargetNamespacePrefix(genParams.getTargetNamespacePrefix());
+        java2WsdlBuilder.setServiceName(genParams.getServiceName() == null ? 
+        		Java2WSDLUtils.getSimpleClassName(genParams.getSourceClassName()) : genParams.getServiceName());
+
+        if (genParams.getStyle() != null) 
+        {
+            java2WsdlBuilder.setStyle(genParams.getStyle());
+        }
+
+        if (genParams.getLocationUri() != null) {
+            java2WsdlBuilder.setLocationUri(genParams.getLocationUri());
+        }
+
+        if (genParams.getUse() != null) 
+        {
+            java2WsdlBuilder.setUse(genParams.getUse());
+        }
+	}
+        
+   	protected boolean validateInputArgs(String[] args) 
+	{
 		boolean isValid = true;
 		CommandLineOptionParser parser = new CommandLineOptionParser(args);
 		if (parser.getAllOptions().size() == 0) {
@@ -260,39 +118,34 @@
 			isValid = false;
 		}
 
-		if (isValid) {
+		if (isValid) 
+		{
 			commandLineOptions = parser.getAllOptions();
 		}
 
 		return isValid;
 	}
 
-	public boolean generateWSDLModel() throws Exception {
+	public boolean buildWSDLDocument() throws Exception 
+	{
 		boolean isComplete = true;
-		initialize();
-
-		SchemaGenerator schemaGenerator = new SchemaGenerator(getClassLoader(),
-				getSourceClassName(), getSchemaTargetNamespace(),
-				getSchemaTargetNamespacePrefix());
-
-		XmlSchema schema = schemaGenerator.generateSchema();
-
-		wsdlDescription = new Java2WOMBuilder(schemaGenerator.getTypeTable(),
-				schemaGenerator.getMethods(), schema, getServiceName(),
-				getTargetNamespace(), getTargetNamespacePrefix()).generateWOM();
+		initJava2WSDLBuilder();
+		java2WsdlBuilder.buildWSDL();
 
 		return isComplete;
 	}
 
-	public boolean serializeWSDLModel() throws Exception {
+	public boolean serializeWSDLDocument() throws Exception {
 		boolean isComplete = true;
 
-		// WOMWriter womWriter =
-		// WOMWriterFactory.createWriter(org.apache.wsdl.WSDLConstants.WSDL_1_1);
-		WOMWriter womWriter = new TuscanyWOM2WSDL11Writer();
-		womWriter.setdefaultWSDLPrefix(DEFAULT_PREFIX);
-
-		womWriter.writeWOM(wsdlDescription, getOutputStream());
+		if ( getOutputStream() == null )
+		{
+			setOutputStream(genParams.getOutputFileStream());
+		}
+		
+		java2WsdlBuilder.getWsdlDocument().serialize(getOutputStream());
+		getOutputStream().flush();
+		getOutputStream().close();;
 
 		return isComplete;
 	}
@@ -303,30 +156,29 @@
 	 * 
 	 * @see tuscany.tools.Java2WSDLGeneratorIfc#generateWSDL(java.lang.String[])
 	 */
-	public void generateWSDL(String[] args) {
-		try {
-			// if the argument input are found to be valid
-			if (validateInputArgs(args)) {
-				// multicast event for input args validation complete
-				multicastGenPhaseCompletionEvent(WSDLGenListener.INPUT_ARGS_VALIDATION);
-
-				// if the WSDL Model generation was successul
-				if (generateWSDLModel()) {
-					wsdlModel = new WSDLModel(
-							(WSDLDescriptionImpl) wsdlDescription);
-					// multicast event for generation of wsdl model
-					multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_CREATION);
-					// if the serialization of the generated (and fixed) model
-					// is successful
-					if (serializeWSDLModel()) {
-						// multicast event for writing of the WSDL Model to
-						// supplied output stream
-						multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_WRITING);
-					}
+	public void generateWSDL(Map commandLineOptions) 
+	{
+		try 
+		{
+			// load the user options into an easy to access abstraction
+			genParams = new GenerationParameters(commandLineOptions);
+			
+			// if the WSDL Model generation was successul
+			if ( buildWSDLDocument() ) 
+			{
+				// multicast event for generation of wsdl model
+				multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_CREATION);
+				// if the serialization of the generated (and fixed) model
+				// is successful
+				if (serializeWSDLDocument()) {
+					// multicast event for writing of the WSDL Model to
+					// supplied output stream
+					multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_WRITING);
 				}
-
 			}
-		} catch (Exception e) {
+		} 
+		catch (Exception e) 
+		{
 			e.printStackTrace();
 		}
 
@@ -334,6 +186,17 @@
 
 	}
 
+	public void generateWSDL(String[] args) 
+	{
+		// if the argument input are found to be valid
+		if (validateInputArgs(args)) 
+		{
+			//multicast event for input args validation complete
+			multicastGenPhaseCompletionEvent(WSDLGenListener.INPUT_ARGS_VALIDATION);
+			generateWSDL(commandLineOptions);
+		}
+	}
+	
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -371,15 +234,7 @@
 		commandLineOptions = cmdLineOpts;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see tuscany.tools.Java2WSDLGeneratorIfc#getWSDLDescription()
-	 */
-	public WSDLModel getWSDLModel() {
-		return wsdlModel;
-	}
-
+	
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -399,49 +254,20 @@
 		outputStream = outStream;
 	}
 
-	public void generateWSDL(Map commandLineOptions) {
-		// TODO Auto-generated method stub
-
-	}
-
-	public String getSourceClassName() {
-		return sourceClassName;
-	}
-
-	public void setSourceClassName(String sourceClassName) {
-		this.sourceClassName = sourceClassName;
+	
+	public TuscanyJava2WSDLBuilder getJava2WsdlBuilder()
+	{
+		return java2WsdlBuilder;
 	}
 
-	public ClassLoader getClassLoader() {
-		return classLoader;
+	public void setJava2WsdlBuilder(TuscanyJava2WSDLBuilder java2WsdlBuilder)
+	{
+		this.java2WsdlBuilder = java2WsdlBuilder;
 	}
 
-	public void setClassLoader(ClassLoader classLoader) {
-		this.classLoader = classLoader;
-	}
-
-	/**
-	 * create an xml namespace URI given a java package name. For example given
-	 * org.apache.tuscany.wsdl.java2wsdl the string
-	 * http://java2wsdl.wsdl.tuscany.apache.org is returned
-	 * 
-	 * @param packageName
-	 * @return
-	 */
-	private String namespaceFromPackageName(String packageName) {
-		StringBuffer strBuf = new StringBuffer(HTTP);
-		int prevIndex = packageName.length();
-		int currentIndex = packageName.lastIndexOf(PACKAGE_CLASS_DELIMITER);
-		while (currentIndex != -1) {
-			prevIndex = currentIndex;
-			currentIndex = packageName.lastIndexOf(PACKAGE_CLASS_DELIMITER,
-					prevIndex - 1);
-			strBuf.append(packageName.substring(currentIndex + 1, prevIndex));
-			if (currentIndex != -1) {
-				strBuf.append(PACKAGE_CLASS_DELIMITER);
-			}
-		}
-		return strBuf.toString();
+	public WSDLModel getWSDLModel()
+	{
+		// TODO Auto-generated method stub
+		return null;
 	}
-
 }

Modified: incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLModel.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLModel.java?rev=400341&r1=400340&r2=400341&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLModel.java
(original)
+++ incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLModel.java
Sat May  6 10:13:08 2006
@@ -1,11 +1,5 @@
 package org.apache.tuscany.tools.java2wsdl.generate;
 
-import java.util.Map;
-
-import org.apache.wsdl.extensions.ExtensionConstants;
-import org.apache.wsdl.extensions.Schema;
-import org.apache.wsdl.impl.WSDLDescriptionImpl;
-import org.w3c.dom.Element;
 
 /**
  * This class provides a higher level abstraction to parts of the WSDL model
@@ -13,35 +7,7 @@
  * when the Tuscany Java2WSDL is applying fixes to the model.
  * 
  */
-public class WSDLModel {
-
-	/**
-	 * the Axis2 description of the WSDL Model
-	 */
-	protected WSDLDescriptionImpl wsdlDescription = null;
-
-	public WSDLModel(WSDLDescriptionImpl desc) {
-		wsdlDescription = desc;
-	}
-
-	/**
-	 * provides access to the map of namespaces that form the attributes of the
-	 * wsdl:definition element
-	 * 
-	 * @return
-	 */
-	public Map getDefnNamespaceMap() {
-		return wsdlDescription.getNamespaces();
-	}
-
-	/**
-	 * provides access to the Schema type definitions fragment of the WSDL
-	 * 
-	 * @return
-	 */
-	public Element getSchemaElement() {
-		return ((Schema) wsdlDescription.getTypes().getFirstElement(
-				ExtensionConstants.SCHEMA)).getElement();
-	}
-
+public class WSDLModel 
+{
+	//this class is to be populated later after identifying requirements for it.
 }



Mime
View raw message