You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/04/02 18:10:48 UTC

svn commit: r524824 - in /incubator/tuscany/java/sca/scdl4j/idl: ./ src/main/java/org/apache/tuscany/sca/idl/ src/main/java/org/apache/tuscany/sca/idl/impl/ src/main/java/org/apache/tuscany/sca/idl/util/

Author: rfeng
Date: Mon Apr  2 09:10:47 2007
New Revision: 524824

URL: http://svn.apache.org/viewvc?view=rev&rev=524824
Log:
Add DataType and other XML-related metadata

Added:
    incubator/tuscany/java/sca/scdl4j/idl/.checkstyle
    incubator/tuscany/java/sca/scdl4j/idl/.pmd
    incubator/tuscany/java/sca/scdl4j/idl/.ruleset
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/DataType.java   (with props)
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/DataTypeImpl.java   (with props)
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/ElementInfo.java   (with props)
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/TypeInfo.java   (with props)
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/WrapperInfo.java   (with props)
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/XMLType.java   (with props)
Modified:
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Interface.java
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Operation.java
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/InterfaceImpl.java
    incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/OperationImpl.java

Added: incubator/tuscany/java/sca/scdl4j/idl/.checkstyle
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/.checkstyle?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/.checkstyle (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/.checkstyle Mon Apr  2 09:10:47 2007
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<fileset-config file-format-version="1.2.0" simple-config="true">
+    <fileset name="all" enabled="true" check-config-name="Tuscany Checks" local="false">
+        <file-match-pattern match-pattern="." include-pattern="true"/>
+    </fileset>
+</fileset-config>

Added: incubator/tuscany/java/sca/scdl4j/idl/.pmd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/.pmd?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/.pmd (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/.pmd Mon Apr  2 09:10:47 2007
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pmd><useProjectRuleSet>true</useProjectRuleSet><rules/><includeDerivedFiles>false</includeDerivedFiles></pmd>
\ No newline at end of file

Added: incubator/tuscany/java/sca/scdl4j/idl/.ruleset
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/.ruleset?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/.ruleset (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/.ruleset Mon Apr  2 09:10:47 2007
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<ruleset name="pmd-eclipse">
+  <description>PMD Plugin preferences rule set</description>
+  
+  
+  <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
+  <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
+  <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
+<!--<rule ref="rulesets/basic.xml/EmptyCatchBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyIfStmt"/>-->
+  <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
+<!--<rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySwitchStatements"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyTryBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyWhileStmt"/>-->
+  <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
+  <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
+<!--<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>-->
+  <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
+  <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
+  <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
+  <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
+  <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
+<!--<rule ref="rulesets/basic.xml/UselessOverridingMethod"/>-->
+  
+<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>-->
+
+<!--<rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>-->
+<!--<rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>-->
+<!--<rule ref="rulesets/clone.xml/ProperCloneImplementation"/>-->
+  
+<!--<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>-->
+<!--<rule ref="rulesets/codesize.xml/TooManyFields"/>-->
+
+<rule ref="rulesets/controversial.xml/AssignmentInOperand"/>
+<!--<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/DontImportSun"/>-->
+<!--<rule ref="rulesets/controversial.xml/NullAssignment"/>-->
+<!--<rule ref="rulesets/controversial.xml/OnlyOneReturn"/>-->
+<!--<rule ref="rulesets/controversial.xml/SingularField"/>-->
+<!--<rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>-->
+<!--<rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>-->
+<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
+<!--<rule ref="rulesets/controversial.xml/UnusedModifier"/>-->
+
+<!--<rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>-->
+<!--<rule ref="rulesets/coupling.xml/ExcessiveImports"/>-->
+<!--<rule ref="rulesets/coupling.xml/LooseCoupling"/>-->
+
+<!--<rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>-->
+<!--<rule ref="rulesets/design.xml/AccessorClassGeneration"/>-->
+<!--<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
+<rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/>
+<!--<rule ref="rulesets/design.xml/AvoidReassigningParameters"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
+<!--<rule ref="rulesets/design.xml/BadComparison"/>-->
+<!--<rule ref="rulesets/design.xml/CloseConnection"/>-->
+<!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>-->
+<!--<rule ref="rulesets/design.xml/ConfusingTernary"/>-->
+<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+<!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
+<!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>-->
+<rule ref="rulesets/design.xml/IdempotentOperations"/>
+<!--<rule ref="rulesets/design.xml/ImmutableField"/>-->
+<!--<rule ref="rulesets/design.xml/InstantiationToGetClass"/>-->
+<!--<rule ref="rulesets/design.xml/MissingBreakInSwitch"/>-->
+<!--<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
+<!--<rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>-->
+<!--<rule ref="rulesets/design.xml/NonStaticInitializer"/>-->
+<rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
+<rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>
+<rule ref="rulesets/design.xml/SimplifyConditional"/>
+<!--<rule ref="rulesets/design.xml/SwitchDensity"/>-->
+<!--<rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>-->
+<!--<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>-->
+<!--<rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>-->
+<!--<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>-->
+<!--<rule ref="rulesets/design.xml/UseSingleton"/>-->
+
+<!--<rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>-->
+<!--<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>-->
+
+<!--<rule ref="rulesets/imports.xml/DuplicateImports"/>-->
+<!--<rule ref="rulesets/imports.xml/DontImportJavaLang"/>-->
+<!--<rule ref="rulesets/imports.xml/UnusedImports"/>-->
+<!--<rule ref="rulesets/imports.xml/ImportFromSamePackage"/>-->
+
+<!--<rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>-->
+<!--<rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>-->
+
+<!--<rule ref="rulesets/junit.xml/JUnitStaticSuite"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitSpelling"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>-->
+<!--<rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>-->
+<!--<rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>-->
+
+  <!--<rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/LogBlockWithoutIf"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/SystemPrintln"/>-->
+  <!--<rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>-->
+  <!--<rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>-->
+  
+  <!--<rule ref="rulesets/naming.xml/ShortVariable"/>-->
+  <!--<rule ref="rulesets/naming.xml/LongVariable"/>-->
+  <!--<rule ref="rulesets/naming.xml/ShortMethodName"/>-->
+  <!--<rule ref="rulesets/naming.xml/VariableNamingConventions"/>-->
+  <!--<rule ref="rulesets/naming.xml/MethodNamingConventions"/>-->
+  <!--<rule ref="rulesets/naming.xml/ClassNamingConventions"/>-->
+  <!--<rule ref="rulesets/naming.xml/AbstractNaming"/>-->
+  <!--<rule ref="rulesets/naming.xml/AvoidDollarSigns"/>-->
+  <!--<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>-->
+  <!--<rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>-->
+  <!--<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>-->
+  <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>-->
+  <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>-->
+  <!--<rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>-->
+  <!--<rule ref="rulesets/naming.xml/NoPackage"/>-->
+  <!--<rule ref="rulesets/naming.xml/PackageCase"/>-->
+
+  <!--<rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>-->
+
+  <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>-->
+ 
+  <!--<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>-->
+  <!--<rule ref="rulesets/strings.xml/StringInstantiation"/>-->
+  <!--<rule ref="rulesets/strings.xml/StringToString"/>-->
+  <!--<rule ref="rulesets/strings.xml/AvoidConcatenatingNonLiteralsInStringBuffer"/>-->
+  <!--<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>-->
+  
+  <!--<rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>-->
+  <!--<rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>-->
+  
+  <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
+  <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
+  <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
+  <!--<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>-->
+  
+</ruleset>

Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/DataType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/DataType.java?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/DataType.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/DataType.java Mon Apr  2 09:10:47 2007
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.sca.idl;
+
+
+/**
+ * Representation of the type of data associated with an operation. Data is
+ * represented in two forms: the physical form used by the runtime and a logical
+ * form used by the assembly. The physical form is a Java Type because the
+ * runtime is written in Java. This may be the same form used by the application
+ * but it may not; for example, an application that is performing stream
+ * processing may want a physical form such as an
+ * {@link java.io.InputStream InputStream} to semantially operate on application
+ * data such as a purchase order. The logical description is that used by the
+ * assembly model and is an identifier into some well-known type space; examples
+ * may be a Java type represented by its Class or an XML type represented by its
+ * QName. Every data type may also contain metadata describing the expected
+ * data; for example, it could specify a preferred data binding technology or
+ * the size of a typical instance.
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface DataType<L> extends Cloneable {
+    /**
+     * Set the java type for the data
+     * @param cls
+     */
+    void setPhysical(Class cls);
+
+    /**
+     * Returns the physical type used by the runtime.
+     * 
+     * @return the physical type used by the runtime
+     */
+    Class getPhysical();
+
+    /**
+     * Returns the logical identifier used by the assembly. The type of this
+     * value identifies the logical type system in use. Known values are:
+     * <ul>
+     * <li>a java.lang.reflect.Type identifies a Java type by name and
+     * ClassLoader; this includes Java Classes as they are specializations of
+     * Type</li>
+     * <li>a javax.xml.namespace.QName identifies an XML type by local name and
+     * namespace</li>
+     * </ul>
+     * 
+     * @return the logical type name
+     */
+    L getLogical();
+
+    /**
+     * @return
+     */
+    String getDataBinding();
+
+    /**
+     * @param dataBinding the dataBinding to set
+     */
+    void setDataBinding(String dataBinding);
+
+    /**
+     * @return
+     * @throws CloneNotSupportedException
+     */
+    Object clone() throws CloneNotSupportedException;
+
+    /**
+     * @param logical the logical to set
+     */
+    void setLogical(L logical);
+
+}

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/DataType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/DataType.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Interface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Interface.java?view=diff&rev=524824&r1=524823&r2=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Interface.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Interface.java Mon Apr  2 09:10:47 2007
@@ -21,38 +21,43 @@
 import java.util.List;
 
 /**
- * Represents a service interface.
- * This interface will typically be extended to support concrete interface type systems, such as
- * Java interfaces, WSDL 1.1 portTypes and WSDL 2.0 interfaces.
+ * Represents a service interface. This interface will typically be extended to
+ * support concrete interface type systems, such as Java interfaces, WSDL 1.1
+ * portTypes and WSDL 2.0 interfaces.
  */
 public interface Interface {
 
     /**
-     * Returns true if the interface is a remotable interface.. 
+     * Returns true if the interface is a remotable interface..
+     * 
      * @return true if the interface is a remotable interface
      */
     boolean isRemotable();
 
     /**
-    * Sets whether the interface is a remotable or local interface. 
-    * @param remotable indicates whether the interface is remotable or local
+     * Sets whether the interface is a remotable or local interface.
+     * 
+     * @param remotable indicates whether the interface is remotable or local
      */
     void setRemotable(boolean remotable);
 
     /**
      * Returns the operations defined on this interface.
+     * 
      * @return the operations defined on this interface
      */
     List<Operation> getOperations();
-    
+
     /**
      * Returns true if the model element is unresolved.
+     * 
      * @return true if the model element is unresolved.
      */
     boolean isUnresolved();
-    
+
     /**
      * Sets whether the model element is unresolved.
+     * 
      * @param unresolved whether the model element is unresolved
      */
     void setUnresolved(boolean unresolved);

Modified: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Operation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Operation.java?view=diff&rev=524824&r1=524823&r2=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Operation.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/Operation.java Mon Apr  2 09:10:47 2007
@@ -18,34 +18,60 @@
  */
 package org.apache.tuscany.sca.idl;
 
+import java.util.List;
 
 /**
  * Represents an operation on a service interface.
  */
 public interface Operation {
-	
-	/**
-	 * Returns the name of the operation.
-	 * @return the name of the operation
-	 */
-	String getName();
-	
-	/**
-	 * Sets the name of the operation.
-	 * @param name the name of the operation
-	 */
-	void setName(String name);
+
+    /**
+     * Returns the name of the operation.
+     * 
+     * @return the name of the operation
+     */
+    String getName();
+
+    /**
+     * Sets the name of the operation.
+     * 
+     * @param name the name of the operation
+     */
+    void setName(String name);
 
     /**
      * Returns true if the model element is unresolved.
+     * 
      * @return true if the model element is unresolved.
      */
     boolean isUnresolved();
-    
+
     /**
      * Sets whether the model element is unresolved.
+     * 
      * @param unresolved whether the model element is unresolved
      */
     void setUnresolved(boolean unresolved);
+
+    /**
+     * Get the data type that represents the input of this operation. The logic type is 
+     * a list of data types and each element represents a parameter
+     * 
+     * @return the inputType
+     */
+    DataType<List<DataType>> getInputType();
+
+    /**
+     * Get the data type for the output
+     * 
+     * @return the outputType
+     */
+    DataType getOutputType();
+
+    /**
+     * Get a list of data types to represent the faults/exceptions
+     * @return the faultTypes
+     */
+    List<DataType> getFaultTypes();
 
 }

Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/DataTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/DataTypeImpl.java?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/DataTypeImpl.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/DataTypeImpl.java Mon Apr  2 09:10:47 2007
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.sca.idl.impl;
+
+import org.apache.tuscany.sca.idl.DataType;
+
+/**
+ * Representation of the type of data associated with an operation. Data is
+ * represented in two forms: the physical form used by the runtime and a logical
+ * form used by the assembly. The physical form is a Java Type because the
+ * runtime is written in Java. This may be the same form used by the application
+ * but it may not; for example, an application that is performing stream
+ * processing may want a physical form such as an
+ * {@link java.io.InputStream InputStream} to semantially operate on application
+ * data such as a purchase order. The logical description is that used by the
+ * assembly model and is an identifier into some well-known type space; examples
+ * may be a Java type represented by its Class or an XML type represented by its
+ * QName. Every data type may also contain metadata describing the expected
+ * data; for example, it could specify a preferred data binding technology or
+ * the size of a typical instance.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DataTypeImpl<L> implements DataType<L> {
+    private boolean unresolved = true;
+    private String dataBinding;
+    private Class physical;
+    private L logical;
+
+    /**
+     * Construct a data type specifying the physical and logical types.
+     * 
+     * @param physical the physical class used by the runtime
+     * @param logical the logical type
+     * @see #getLogical()
+     */
+    public DataTypeImpl(Class physical, L logical) {
+        this.physical = physical;
+        this.logical = logical;
+    }
+
+    public DataTypeImpl(String dataBinding, Class physical, L logical) {
+        this.dataBinding = dataBinding;
+        this.physical = physical;
+        this.logical = logical;
+    }
+
+    /**
+     * Returns the physical type used by the runtime.
+     * 
+     * @return the physical type used by the runtime
+     */
+    public Class getPhysical() {
+        return physical;
+    }
+
+    /**
+     * Returns the logical identifier used by the assembly. The type of this
+     * value identifies the logical type system in use. Known values are:
+     * <ul>
+     * <li>a java.lang.reflect.Type identifies a Java type by name and
+     * ClassLoader; this includes Java Classes as they are specializations of
+     * Type</li>
+     * <li>a javax.xml.namespace.QName identifies an XML type by local name and
+     * namespace</li>
+     * </ul>
+     * 
+     * @return the logical type name
+     */
+    public L getLogical() {
+        return logical;
+    }
+
+    public String getDataBinding() {
+        return dataBinding;
+    }
+
+    /**
+     * @param dataBinding the dataBinding to set
+     */
+    public void setDataBinding(String dataBinding) {
+        this.dataBinding = dataBinding;
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append(physical).append(" ").append(dataBinding).append(" ").append(logical);
+        return sb.toString();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        DataTypeImpl copy = (DataTypeImpl)super.clone();
+        return copy;
+    }
+
+    /**
+     * @param logical the logical to set
+     */
+    public void setLogical(L logical) {
+        this.logical = logical;
+    }
+
+    @Override
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ((dataBinding == null) ? 0 : dataBinding.hashCode());
+        result = PRIME * result + ((logical == null) ? 0 : logical.hashCode());
+        result = PRIME * result + ((physical == null) ? 0 : physical.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final DataTypeImpl other = (DataTypeImpl)obj;
+        if (dataBinding == null) {
+            if (other.dataBinding != null) {
+                return false;
+            }
+        } else if (!dataBinding.equals(other.dataBinding)) {
+            return false;
+        }
+        if (logical == null) {
+            if (other.logical != null) {
+                return false;
+            }
+        } else if (!logical.equals(other.logical)) {
+            return false;
+        }
+        if (physical == null) {
+            if (other.physical != null) {
+                return false;
+            }
+        } else if (!physical.equals(other.physical)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * @return the unresolved
+     */
+    public boolean isUnresolved() {
+        return unresolved;
+    }
+
+    /**
+     * @param unresolved the unresolved to set
+     */
+    public void setUnresolved(boolean unresolved) {
+        this.unresolved = unresolved;
+    }
+
+    /**
+     * @param physical the physical to set
+     */
+    public void setPhysical(Class physical) {
+        this.physical = physical;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/DataTypeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/DataTypeImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/InterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/InterfaceImpl.java?view=diff&rev=524824&r1=524823&r2=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/InterfaceImpl.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/InterfaceImpl.java Mon Apr  2 09:10:47 2007
@@ -26,33 +26,33 @@
 
 /**
  * Represents a service interface.
- *
- *  @version $Rev$ $Date$
+ * 
+ * @version $Rev$ $Date$
  */
 public class InterfaceImpl implements Interface {
-	
-	private boolean remotable;
-	private List<Operation> operations = new ArrayList<Operation>();
-	private boolean unresolved = false;
-
-	public boolean isRemotable() {
-		return remotable;
-	}
-
-	public void setRemotable(boolean local) {
-		this.remotable = local;
-	}
-
-	public List<Operation> getOperations() {
-		return operations;
-	}
-
-	public boolean isUnresolved() {
-		return unresolved;
-	}
-
-	public void setUnresolved(boolean undefined) {
-		this.unresolved = undefined;
-	}
+
+    private boolean remotable;
+    private List<Operation> operations = new ArrayList<Operation>();
+    private boolean unresolved;
+
+    public boolean isRemotable() {
+        return remotable;
+    }
+
+    public void setRemotable(boolean local) {
+        this.remotable = local;
+    }
+
+    public List<Operation> getOperations() {
+        return operations;
+    }
+
+    public boolean isUnresolved() {
+        return unresolved;
+    }
+
+    public void setUnresolved(boolean undefined) {
+        this.unresolved = undefined;
+    }
 
 }

Modified: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/OperationImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/OperationImpl.java?view=diff&rev=524824&r1=524823&r2=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/OperationImpl.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/impl/OperationImpl.java Mon Apr  2 09:10:47 2007
@@ -18,32 +18,80 @@
  */
 package org.apache.tuscany.sca.idl.impl;
 
+import java.util.List;
+
+import org.apache.tuscany.sca.idl.DataType;
 import org.apache.tuscany.sca.idl.Operation;
 
 /**
  * Represents an operation on a service interface.
- *
- *  @version $Rev$ $Date$
+ * 
+ * @version $Rev$ $Date$
  */
 public class OperationImpl implements Operation {
-	
-	private String name;
-	private boolean unresolved = false;
-	
-	public String getName() {
-		return name;
-	}
-	
-	public void setName(String name) {
-		this.name = name;
-	}
-	
-	public boolean isUnresolved() {
-		return unresolved;
-	}
-
-	public void setUnresolved(boolean undefined) {
-		this.unresolved = undefined;
-	}
+
+    private String name;
+    private boolean unresolved;
+    private DataType outputType;
+    private DataType<List<DataType>> inputType;
+    private List<DataType> faultTypes;    
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public boolean isUnresolved() {
+        return unresolved;
+    }
+
+    public void setUnresolved(boolean undefined) {
+        this.unresolved = undefined;
+    }
+
+    /**
+     * @return the faultTypes
+     */
+    public List<DataType> getFaultTypes() {
+        return faultTypes;
+    }
+
+    /**
+     * @param faultTypes the faultTypes to set
+     */
+    public void setFaultTypes(List<DataType> faultTypes) {
+        this.faultTypes = faultTypes;
+    }
+
+    /**
+     * @return the inputType
+     */
+    public DataType<List<DataType>> getInputType() {
+        return inputType;
+    }
+
+    /**
+     * @param inputType the inputType to set
+     */
+    public void setInputType(DataType<List<DataType>> inputType) {
+        this.inputType = inputType;
+    }
+
+    /**
+     * @return the outputType
+     */
+    public DataType getOutputType() {
+        return outputType;
+    }
+
+    /**
+     * @param outputType the outputType to set
+     */
+    public void setOutputType(DataType outputType) {
+        this.outputType = outputType;
+    }
 
 }

Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/ElementInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/ElementInfo.java?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/ElementInfo.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/ElementInfo.java Mon Apr  2 09:10:47 2007
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.idl.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An abstraction of XML schema elements
+ */
+public class ElementInfo {
+    private final QName name;
+    private final TypeInfo type;
+
+    /**
+     * @param name
+     * @param type
+     */
+    public ElementInfo(QName name, TypeInfo type) {
+        super();
+        this.name = name;
+        this.type = type;
+    }
+
+    /**
+     * @return the name
+     */
+    public QName getQName() {
+        return name;
+    }
+
+    /**
+     * @return the type
+     */
+    public TypeInfo getType() {
+        return type;
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append("Element: ").append(name).append(" ").append(type);
+        return sb.toString();
+    }
+}

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/ElementInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/ElementInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/TypeInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/TypeInfo.java?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/TypeInfo.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/TypeInfo.java Mon Apr  2 09:10:47 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.idl.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An abstraction of XML schema types
+ */
+public class TypeInfo {
+    private QName name;
+
+    private boolean isSimpleType;
+
+    private TypeInfo baseType;
+
+    /**
+     * @param name
+     * @param isSimpleType
+     */
+    public TypeInfo(QName name, boolean isSimpleType, TypeInfo baseType) {
+        super();
+        this.name = name;
+        this.isSimpleType = isSimpleType;
+        this.baseType = baseType;
+    }
+
+    /**
+     * @return the isSimpleType
+     */
+    public boolean isSimpleType() {
+        return isSimpleType;
+    }
+
+    /**
+     * @return the name
+     */
+    public QName getQName() {
+        return name;
+    }
+
+    /**
+     * @return the baseType
+     */
+    public TypeInfo getBaseType() {
+        return baseType;
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append("Type: ").append(name);
+        return sb.toString();
+    }
+
+}

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/TypeInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/TypeInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/WrapperInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/WrapperInfo.java?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/WrapperInfo.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/WrapperInfo.java Mon Apr  2 09:10:47 2007
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.idl.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.idl.DataType;
+import org.apache.tuscany.sca.idl.impl.DataTypeImpl;
+
+/**
+ * The "Wrapper Style" WSDL operation is defined by The Java API for XML-Based
+ * Web Services (JAX-WS) 2.0 specification, section 2.3.1.2 Wrapper Style. <p/>
+ * A WSDL operation qualifies for wrapper style mapping only if the following
+ * criteria are met:
+ * <ul>
+ * <li>(i) The operation’s input and output messages (if present) each contain
+ * only a single part
+ * <li>(ii) The input message part refers to a global element declaration whose
+ * localname is equal to the operation name
+ * <li>(iii) The output message part refers to a global element declaration
+ * <li>(iv) The elements referred to by the input and output message parts
+ * (henceforth referred to as wrapper elements) are both complex types defined
+ * using the xsd:sequence compositor
+ * <li>(v) The wrapper elements only contain child elements, they must not
+ * contain other structures such as wildcards (element or attribute),
+ * xsd:choice, substitution groups (element references are not permitted) or
+ * attributes; furthermore, they must not be nillable.
+ * </ul>
+ * 
+ * @version $Rev$ $Date$
+ */
+public class WrapperInfo {
+    private ElementInfo inputWrapperElement;
+
+    private ElementInfo outputWrapperElement;
+
+    private List<ElementInfo> inputChildElements;
+
+    private List<ElementInfo> outputChildElements;
+
+    private DataType<List<DataType<XMLType>>> unwrappedInputType;
+
+    private DataType<XMLType> unwrappedOutputType;
+
+    private String dataBinding;
+
+    public WrapperInfo(String dataBinding,
+                       ElementInfo inputWrapperElement,
+                       ElementInfo outputWrapperElement,
+                       List<ElementInfo> inputElements,
+                       List<ElementInfo> outputElements) {
+        super();
+        this.dataBinding = dataBinding;
+        this.inputWrapperElement = inputWrapperElement;
+        this.outputWrapperElement = outputWrapperElement;
+        this.inputChildElements = inputElements;
+        this.outputChildElements = outputElements;
+    }
+
+    /**
+     * @return the inputElements
+     */
+    public List<ElementInfo> getInputChildElements() {
+        return inputChildElements;
+    }
+
+    /**
+     * @return the inputWrapperElement
+     */
+    public ElementInfo getInputWrapperElement() {
+        return inputWrapperElement;
+    }
+
+    /**
+     * @return the outputElements
+     */
+    public List<ElementInfo> getOutputChildElements() {
+        return outputChildElements;
+    }
+
+    /**
+     * @return the outputWrapperElement
+     */
+    public ElementInfo getOutputWrapperElement() {
+        return outputWrapperElement;
+    }
+
+    /**
+     * @return the unwrappedInputType
+     */
+    public DataType<List<DataType<XMLType>>> getUnwrappedInputType() {
+        if (unwrappedInputType == null) {
+            List<DataType<XMLType>> childTypes = new ArrayList<DataType<XMLType>>();
+            for (ElementInfo element : getInputChildElements()) {
+                DataType<XMLType> type = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
+                childTypes.add(type);
+            }
+            unwrappedInputType = new DataTypeImpl<List<DataType<XMLType>>>("idl:unwrapped.input", Object[].class,
+                                                                           childTypes);
+        }
+        return unwrappedInputType;
+    }
+
+    /**
+     * @return the unwrappedOutputType
+     */
+    public DataType<XMLType> getUnwrappedOutputType() {
+        if (unwrappedOutputType == null) {
+            List<ElementInfo> elements = getOutputChildElements();
+            if (elements != null && elements.size() > 0) {
+                if (elements.size() > 1) {
+                    // We don't support output with multiple parts
+                    throw new IllegalArgumentException("Multi-part output is not supported");
+                }
+                ElementInfo element = elements.get(0);
+
+                unwrappedOutputType = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
+            }
+        }
+        return unwrappedOutputType;
+    }
+}

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/WrapperInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/WrapperInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/XMLType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/XMLType.java?view=auto&rev=524824
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/XMLType.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/XMLType.java Mon Apr  2 09:10:47 2007
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.idl.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * The metadata for an XML element or type
+ */
+public class XMLType {
+    public static final XMLType UNKNOWN = new XMLType(null, null);
+    protected QName element;
+    protected QName type;
+
+    /**
+     * @param element
+     */
+    public XMLType(ElementInfo element) {
+        super();
+        this.element = element.getQName();
+        if (element.getType() != null) {
+            this.type = element.getType().getQName();
+        }
+    }
+
+    /**
+     * @param element
+     */
+    public XMLType(TypeInfo type) {
+        this.element = null;
+        this.type = type.getQName();
+    }
+
+    public XMLType(QName element, QName type) {
+        this.element = element;
+        this.type = type;
+    }
+
+    /**
+     * @return the type
+     */
+    public QName getTypeName() {
+        return type;
+    }
+
+    public boolean isElement() {
+        return element != null;
+    }
+
+    public QName getElementName() {
+        return element;
+    }
+
+    public static XMLType getType(QName type) {
+        return new XMLType(null, type);
+    }
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ((element == null) ? 0 : element.hashCode());
+        result = PRIME * result + ((type == null) ? 0 : type.hashCode());
+        return result;
+    }
+
+    /**
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final XMLType other = (XMLType)obj;
+        if (element == null) {
+            if (other.element != null) {
+                return false;
+            }
+        } else if (!element.equals(other.element)) {
+            return false;
+        }
+        if (type == null) {
+            if (other.type != null) {
+                return false;
+            }
+        } else if (!type.equals(other.type)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "Element: " + element + " Type: " + type;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/XMLType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/sca/idl/util/XMLType.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org