You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2008/03/31 16:55:48 UTC

svn commit: r643011 [4/23] - in /incubator/tuscany/branches/sdo-1.1-incubating: ./ distribution/src/main/assembly/ distribution/src/main/release/bin/ distribution/src/main/release/bin/samples/ impl/src/main/java/org/apache/tuscany/sdo/helper/ impl/src/...

Modified: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/internal/impl/InternalFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/internal/impl/InternalFactoryImpl.java?rev=643011&r1=643010&r2=643011&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/internal/impl/InternalFactoryImpl.java (original)
+++ incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/internal/impl/InternalFactoryImpl.java Mon Mar 31 07:55:36 2008
@@ -1,296 +1,296 @@
-/**
- *
- *  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.sdo.model.internal.impl;
-
-import commonj.sdo.helper.HelperContext;
-import org.apache.tuscany.sdo.helper.TypeHelperImpl;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Property;
-import commonj.sdo.Type;
-
-import org.apache.tuscany.sdo.impl.FactoryBase;
-
-import org.apache.tuscany.sdo.model.internal.*;
-import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the commonj.sdo.internal model factory.
- * This model is generated from sdoInternal.xsd, in the tuscany-sdo-impl project.
- * Until the SDO code generator supports regen/merge, follow the following steps to regenerate this model:
- *   1. Regenerate the model into a temporary directory:
- *         XSD2JavaGenerator -generateBuiltIn http://www.apache.org/tuscany/commonj.sdo.internal -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.internal <tuscany-sdo-impl-dir>/src/main/resources/xml/sdoInternal.xsd
- *   2. Delete all the createXXXFromString() and convertXXXToString() methods in the newly generated InternalFactoryImpl and
- *      replace them with the ones from this file (resolve any missing imports).
- *   3. Comment out all simple depedencies (SDOUtil.registerStaticTypes calls) in the init() method.
- *   4. Make sure the top of each generated file contains the ASF License.      
- *   5. Move this JavaDoc comment into the newly generated ModelFactoryImpl class.
- * <!-- end-user-doc -->
- * @generated
- */
-public class InternalFactoryImpl extends FactoryBase implements InternalFactory
-{
-
-  /**
-   * The package namespace URI.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public static final String NAMESPACE_URI = "http://www.apache.org/tuscany/commonj.sdo.internal";
-
-  /**
-   * The package namespace name.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public static final String NAMESPACE_PREFIX = "internal";
-
-  /**
-   * The version of the generator pattern used to generate this class.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public static final String PATTERN_VERSION = "1.2";
-  
-  public static final int BASE64_BYTES = 1;	
-  public static final int QNAME = 2;
-  
-  /**
-   * Creates an instance of the factory.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public InternalFactoryImpl()
-  {
-    super(NAMESPACE_URI, NAMESPACE_PREFIX, "org.apache.tuscany.sdo.model.internal");
-  }
-
-  /**
-   * Registers the Factory instance so that it is available within the supplied scope.
-   * @argument scope a HelperContext instance that will make the types supported by this Factory available.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public void register(HelperContext scope) 
-  {
-    if(scope == null) {
-      throw new IllegalArgumentException("Scope can not be null");
-    }
-    
-    //Register dependent packages with provided scope
-    
-    // Initialize this package   
-    TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
-    th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
-  }
-  
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public DataObject create(int typeNumber)
-  {
-    switch (typeNumber)
-    {
-      default:
-        return super.create(typeNumber);
-    }
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public Object createFromString(int typeNumber, String initialValue)
-  {
-    switch (typeNumber)
-    {
-      case BASE64_BYTES:
-        return createBase64BytesFromString(initialValue);
-      case QNAME:
-        return createQNameFromString(initialValue);
-      default:
-        throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");
-    }
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public String convertToString(int typeNumber, Object instanceValue)
-  {
-    switch (typeNumber)
-    {
-      case BASE64_BYTES:
-        return convertBase64BytesToString(instanceValue);
-      case QNAME:
-        return convertQNameToString(instanceValue);
-      default:
-        throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");
-    }
-  }
-  
-  // Following creates and initializes SDO metadata for the supported types.		
-  protected Type base64BytesType = null;
-
-  public Type getBase64Bytes()
-  {
-    return base64BytesType;
-  }
-    
-  protected Type qNameType = null;
-
-  public Type getQName()
-  {
-    return qNameType;
-  }
-  
-
-  private static InternalFactoryImpl instance = null; 
-  public static InternalFactoryImpl init()
-  {
-    if (instance != null ) return instance;
-    instance = new InternalFactoryImpl();
-
-    // Initialize dependent packages
-    
-    // Create package meta-data objects
-    instance.createMetaData();
-
-    // Initialize created meta-data
-    instance.initializeMetaData();
-    
-    // Mark meta-data to indicate it can't be changed
-    //theInternalFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
-
-    return instance;
-  }
-  
-  private boolean isCreated = false;
-
-  public void createMetaData()
-  {
-    if (isCreated) return;
-    isCreated = true;
-
-    // Create data types
-    base64BytesType = createType(true, BASE64_BYTES );
-    qNameType = createType(true, QNAME );
-  }
-  
-  private boolean isInitialized = false;
-
-  public void initializeMetaData()
-  {
-    if (isInitialized) return;
-    isInitialized = true;
-    Property property = null;
-
-    // Add supertypes to types
-
-    // Initialize types and properties
-    // Initialize data types
-    initializeType(base64BytesType, byte[].class, "Base64Bytes", true, false);
-    setInstanceProperty (base64BytesType, "commonj.sdo/java", "instanceClass", "byte[]");
-
-    initializeType(qNameType, String.class, "QName", true, false);
-    setInstanceProperty (qNameType, "commonj.sdo/java", "instanceClass", "java.lang.String");
-
-    createXSDMetaData();
-  }
-    
-  protected void createXSDMetaData()
-  {
-    super.initXSD();
-    
-    Property property = null;
-    
-
-    addXSDMapping
-      (base64BytesType,
-       new String[] 
-       {
-       "name", "Base64Bytes"
-       });
-
-    addXSDMapping
-      (qNameType,
-       new String[] 
-       {
-       "name", "QName"
-       });
-
-  }
-    
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated NOT
-   */
-  public byte[] createBase64BytesFromString(String initialValue)
-  {
-      return XMLTypeFactory.eINSTANCE.createBase64Binary(initialValue);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated NOT
-   */
-  public String convertBase64BytesToString(Object instanceValue)
-  {
-      if (instanceValue instanceof byte[]) {
-          return XMLTypeFactory.eINSTANCE.convertBase64Binary((byte[])instanceValue);
-        } else {
-          return XMLTypeFactory.eINSTANCE.convertBase64Binary(instanceValue.toString().getBytes());
-      }
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public String createQNameFromString(String initialValue)
-  {
-    return (String)super.createFromString(QNAME, initialValue);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public String convertQNameToString(Object instanceValue)
-  {
-    return super.convertToString(QNAME, instanceValue);
-  }
-
-} //InternalFactoryImpl
+/**
+ *
+ *  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.sdo.model.internal.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.internal.*;
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the commonj.sdo.internal model factory.
+ * This model is generated from sdoInternal.xsd, in the tuscany-sdo-impl project.
+ * Until the SDO code generator supports regen/merge, follow the following steps to regenerate this model:
+ *   1. Regenerate the model into a temporary directory:
+ *         XSD2JavaGenerator -generateBuiltIn http://www.apache.org/tuscany/commonj.sdo.internal -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.internal <tuscany-sdo-impl-dir>/src/main/resources/xml/sdoInternal.xsd
+ *   2. Delete all the createXXXFromString() and convertXXXToString() methods in the newly generated InternalFactoryImpl and
+ *      replace them with the ones from this file (resolve any missing imports).
+ *   3. Comment out all simple depedencies (SDOUtil.registerStaticTypes calls) in the init() method.
+ *   4. Make sure the top of each generated file contains the ASF License.      
+ *   5. Move this JavaDoc comment into the newly generated ModelFactoryImpl class.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class InternalFactoryImpl extends FactoryBase implements InternalFactory
+{
+
+  /**
+   * The package namespace URI.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String NAMESPACE_URI = "http://www.apache.org/tuscany/commonj.sdo.internal";
+
+  /**
+   * The package namespace name.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String NAMESPACE_PREFIX = "internal";
+
+  /**
+   * The version of the generator pattern used to generate this class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String PATTERN_VERSION = "1.2";
+  
+  public static final int BASE64_BYTES = 1;	
+  public static final int QNAME = 2;
+  
+  /**
+   * Creates an instance of the factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public InternalFactoryImpl()
+  {
+    super(NAMESPACE_URI, NAMESPACE_PREFIX, "org.apache.tuscany.sdo.model.internal");
+  }
+
+  /**
+   * Registers the Factory instance so that it is available within the supplied scope.
+   * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void register(HelperContext scope) 
+  {
+    if(scope == null) {
+      throw new IllegalArgumentException("Scope can not be null");
+    }
+    
+    //Register dependent packages with provided scope
+    
+    // Initialize this package   
+    TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+    th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+  }
+  
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public DataObject create(int typeNumber)
+  {
+    switch (typeNumber)
+    {
+      default:
+        return super.create(typeNumber);
+    }
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Object createFromString(int typeNumber, String initialValue)
+  {
+    switch (typeNumber)
+    {
+      case BASE64_BYTES:
+        return createBase64BytesFromString(initialValue);
+      case QNAME:
+        return createQNameFromString(initialValue);
+      default:
+        throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");
+    }
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String convertToString(int typeNumber, Object instanceValue)
+  {
+    switch (typeNumber)
+    {
+      case BASE64_BYTES:
+        return convertBase64BytesToString(instanceValue);
+      case QNAME:
+        return convertQNameToString(instanceValue);
+      default:
+        throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");
+    }
+  }
+  
+  // Following creates and initializes SDO metadata for the supported types.		
+  protected Type base64BytesType = null;
+
+  public Type getBase64Bytes()
+  {
+    return base64BytesType;
+  }
+    
+  protected Type qNameType = null;
+
+  public Type getQName()
+  {
+    return qNameType;
+  }
+  
+
+  private static InternalFactoryImpl instance = null; 
+  public static InternalFactoryImpl init()
+  {
+    if (instance != null ) return instance;
+    instance = new InternalFactoryImpl();
+
+    // Initialize dependent packages
+    
+    // Create package meta-data objects
+    instance.createMetaData();
+
+    // Initialize created meta-data
+    instance.initializeMetaData();
+    
+    // Mark meta-data to indicate it can't be changed
+    //theInternalFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+    return instance;
+  }
+  
+  private boolean isCreated = false;
+
+  public void createMetaData()
+  {
+    if (isCreated) return;
+    isCreated = true;
+
+    // Create data types
+    base64BytesType = createType(true, BASE64_BYTES );
+    qNameType = createType(true, QNAME );
+  }
+  
+  private boolean isInitialized = false;
+
+  public void initializeMetaData()
+  {
+    if (isInitialized) return;
+    isInitialized = true;
+    Property property = null;
+
+    // Add supertypes to types
+
+    // Initialize types and properties
+    // Initialize data types
+    initializeType(base64BytesType, byte[].class, "Base64Bytes", true, false);
+    setInstanceProperty (base64BytesType, "commonj.sdo/java", "instanceClass", "byte[]");
+
+    initializeType(qNameType, String.class, "QName", true, false);
+    setInstanceProperty (qNameType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+    createXSDMetaData();
+  }
+    
+  protected void createXSDMetaData()
+  {
+    super.initXSD();
+    
+    Property property = null;
+    
+
+    addXSDMapping
+      (base64BytesType,
+       new String[] 
+       {
+       "name", "Base64Bytes"
+       });
+
+    addXSDMapping
+      (qNameType,
+       new String[] 
+       {
+       "name", "QName"
+       });
+
+  }
+    
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated NOT
+   */
+  public byte[] createBase64BytesFromString(String initialValue)
+  {
+      return XMLTypeFactory.eINSTANCE.createBase64Binary(initialValue);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated NOT
+   */
+  public String convertBase64BytesToString(Object instanceValue)
+  {
+      if (instanceValue instanceof byte[]) {
+          return XMLTypeFactory.eINSTANCE.convertBase64Binary((byte[])instanceValue);
+        } else {
+          return XMLTypeFactory.eINSTANCE.convertBase64Binary(instanceValue.toString().getBytes());
+      }
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String createQNameFromString(String initialValue)
+  {
+    return (String)super.createFromString(QNAME, initialValue);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String convertQNameToString(Object instanceValue)
+  {
+    return super.convertToString(QNAME, instanceValue);
+  }
+
+} //InternalFactoryImpl

Propchange: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/internal/impl/InternalFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java?rev=643011&r1=643010&r2=643011&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java (original)
+++ incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java Mon Mar 31 07:55:36 2008
@@ -1,61 +1,61 @@
-/**
- *
- *  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.sdo.model.xml;
-
-import commonj.sdo.helper.HelperContext;
-
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @generated
- */
-public interface XMLFactory
-{
-
-  /**
-   * The singleton instance of the factory.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  XMLFactory INSTANCE = org.apache.tuscany.sdo.model.xml.impl.XMLFactoryImpl.init();
-
-  /**
-   * Returns a new object of class '<em>Info</em>'.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return a new object of class '<em>Info</em>'.
-   * @generated
-   */
-  XMLInfo createXMLInfo();
-
-  /**
-   * Registers the types supported by this Factory within the supplied scope.argument
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @param scope an instance of HelperContext used to manage the scoping of types.
-   * @generated
-   */
-  public void register(HelperContext scope);
-   
-} //XMLFactory
+/**
+ *
+ *  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.sdo.model.xml;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface XMLFactory
+{
+
+  /**
+   * The singleton instance of the factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  XMLFactory INSTANCE = org.apache.tuscany.sdo.model.xml.impl.XMLFactoryImpl.init();
+
+  /**
+   * Returns a new object of class '<em>Info</em>'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return a new object of class '<em>Info</em>'.
+   * @generated
+   */
+  XMLInfo createXMLInfo();
+
+  /**
+   * Registers the types supported by this Factory within the supplied scope.argument
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param scope an instance of HelperContext used to manage the scoping of types.
+   * @generated
+   */
+  public void register(HelperContext scope);
+   
+} //XMLFactory

Propchange: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java?rev=643011&r1=643010&r2=643011&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java (original)
+++ incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java Mon Mar 31 07:55:36 2008
@@ -1,92 +1,92 @@
-/**
- *
- *  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.sdo.model.xml;
-
-import java.io.Serializable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Info</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- *   <li>{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}</li>
- * </ul>
- * </p>
- *
- * @extends Serializable
- * @generated
- */
-public interface XMLInfo extends Serializable
-{
-  /**
-   * Returns the value of the '<em><b>Xml Element</b></em>' attribute.
-   * <!-- begin-user-doc -->
-   * <p>
-   * If the meaning of the '<em>Xml Element</em>' attribute isn't clear,
-   * there really should be more of a description here...
-   * </p>
-   * <!-- end-user-doc -->
-   * @return the value of the '<em>Xml Element</em>' attribute.
-   * @see #isSetXmlElement()
-   * @see #unsetXmlElement()
-   * @see #setXmlElement(boolean)
-   * @generated
-   */
-  boolean isXmlElement();
-
-  /**
-   * Sets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @param value the new value of the '<em>Xml Element</em>' attribute.
-   * @see #isSetXmlElement()
-   * @see #unsetXmlElement()
-   * @see #isXmlElement()
-   * @generated
-   */
-  void setXmlElement(boolean value);
-
-  /**
-   * Unsets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @see #isSetXmlElement()
-   * @see #isXmlElement()
-   * @see #setXmlElement(boolean)
-   * @generated
-   */
-  void unsetXmlElement();
-
-  /**
-   * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute is set.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return whether the value of the '<em>Xml Element</em>' attribute is set.
-   * @see #unsetXmlElement()
-   * @see #isXmlElement()
-   * @see #setXmlElement(boolean)
-   * @generated
-   */
-  boolean isSetXmlElement();
-
-} // XMLInfo
+/**
+ *
+ *  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.sdo.model.xml;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Info</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface XMLInfo extends Serializable
+{
+  /**
+   * Returns the value of the '<em><b>Xml Element</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Xml Element</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Xml Element</em>' attribute.
+   * @see #isSetXmlElement()
+   * @see #unsetXmlElement()
+   * @see #setXmlElement(boolean)
+   * @generated
+   */
+  boolean isXmlElement();
+
+  /**
+   * Sets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Xml Element</em>' attribute.
+   * @see #isSetXmlElement()
+   * @see #unsetXmlElement()
+   * @see #isXmlElement()
+   * @generated
+   */
+  void setXmlElement(boolean value);
+
+  /**
+   * Unsets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #isSetXmlElement()
+   * @see #isXmlElement()
+   * @see #setXmlElement(boolean)
+   * @generated
+   */
+  void unsetXmlElement();
+
+  /**
+   * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute is set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return whether the value of the '<em>Xml Element</em>' attribute is set.
+   * @see #unsetXmlElement()
+   * @see #isXmlElement()
+   * @see #setXmlElement(boolean)
+   * @generated
+   */
+  boolean isSetXmlElement();
+
+} // XMLInfo

Propchange: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java?rev=643011&r1=643010&r2=643011&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java (original)
+++ incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java Mon Mar 31 07:55:36 2008
@@ -1,341 +1,341 @@
-/**
- *
- *  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.sdo.model.xml.impl;
-
-import commonj.sdo.helper.HelperContext;
-import org.apache.tuscany.sdo.helper.TypeHelperImpl;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Property;
-import commonj.sdo.Type;
-
-import org.apache.tuscany.sdo.impl.FactoryBase;
-
-import org.apache.tuscany.sdo.model.ModelFactory;
-
-import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
-
-import org.apache.tuscany.sdo.model.internal.InternalFactory;
-
-import org.apache.tuscany.sdo.model.internal.impl.InternalFactoryImpl;
-
-import org.apache.tuscany.sdo.model.xml.*;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the commonj.sdo/xml model factory.
- * This model is generated from sdoXML.xsd, in the sdo-api project.
- * Until the SDO code generator supports name conflicts and regen/merge, follow the following steps to regenerate this model:
- *   1. Regenerate the model into a temporary directory:
- *         XSD2JavaGenerator -generateBuiltIn commonj.sdo/xml -prefix XML -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.xml <sdo-api-dir>/src/main/resources/xml/sdoXML.xsd
- *   2. Make sure the top of each generated file contains the ASF License.      
- *   3. Move this JavaDoc comment into the newly generated XMLFactoryImpl class.
- * <!-- end-user-doc -->
- * @generated
- */
-public class XMLFactoryImpl extends FactoryBase implements XMLFactory
-{
-
-  /**
-   * The package namespace URI.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public static final String NAMESPACE_URI = "commonj.sdo/xml";
-
-  /**
-   * The package namespace name.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public static final String NAMESPACE_PREFIX = "sdoXML";
-
-  /**
-   * The version of the generator pattern used to generate this class.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public static final String PATTERN_VERSION = "1.2";
-  
-  public static final int XML_INFO = 1;
-  
-  /**
-   * Creates an instance of the factory.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public XMLFactoryImpl()
-  {
-    super(NAMESPACE_URI, NAMESPACE_PREFIX, "org.apache.tuscany.sdo.model.xml");
-  }
-
-  /**
-   * Registers the Factory instance so that it is available within the supplied scope.
-   * @argument scope a HelperContext instance that will make the types supported by this Factory available.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public void register(HelperContext scope) 
-  {
-    if(scope == null) {
-      throw new IllegalArgumentException("Scope can not be null");
-    }
-    
-    //Register dependent packages with provided scope
-    ModelFactory.INSTANCE.register(scope);
-    InternalFactory.INSTANCE.register(scope);
-    
-    // Initialize this package   
-    TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
-    th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
-  }
-  
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public DataObject create(int typeNumber)
-  {
-    switch (typeNumber)
-    {
-      case XML_INFO: return (DataObject)createXMLInfo();
-      default:
-        return super.create(typeNumber);
-    }
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public XMLInfo createXMLInfo()
-  {
-    XMLInfoImpl xmlInfo = new XMLInfoImpl();
-    return xmlInfo;
-  }
-  
-  // Following creates and initializes SDO metadata for the supported types.			
-  protected Type xmlInfoType = null;
-
-  public Type getXMLInfo()
-  {
-    return xmlInfoType;
-  }
-  
-
-  private static XMLFactoryImpl instance = null; 
-  public static XMLFactoryImpl init()
-  {
-    if (instance != null ) return instance;
-    instance = new XMLFactoryImpl();
-
-    // Initialize dependent packages
-    ModelFactory ModelFactoryInstance = ModelFactory.INSTANCE;
-    InternalFactory InternalFactoryInstance = InternalFactory.INSTANCE;
-    
-    // Create package meta-data objects
-    instance.createMetaData();
-
-    // Initialize created meta-data
-    instance.initializeMetaData();
-    
-    // Mark meta-data to indicate it can't be changed
-    //theXMLFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
-
-    return instance;
-  }
-  
-  private boolean isCreated = false;
-
-  public void createMetaData()
-  {
-    if (isCreated) return;
-    isCreated = true;	
-
-    // Create types and their properties
-    xmlInfoType = createType(false, XML_INFO);
-    createProperty(true, xmlInfoType,XMLInfoImpl.INTERNAL_XML_ELEMENT); 
-  }
-  
-  private boolean isInitialized = false;
-
-  public void initializeMetaData()
-  {
-    if (isInitialized) return;
-    isInitialized = true;
-
-    // Obtain other dependent packages
-    ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)ModelFactory.INSTANCE;
-    InternalFactoryImpl theInternalPackageImpl = (InternalFactoryImpl)InternalFactory.INSTANCE;
-    Property property = null;
-
-    // Add supertypes to types
-
-    // Initialize types and properties
-    initializeType(xmlInfoType, XMLInfo.class, "XMLInfo", false);
-    property = getLocalProperty(xmlInfoType, 0);
-    initializeProperty(property, theModelPackageImpl.getBoolean(), "xmlElement", null, 0, 1, XMLInfo.class, false, true, false);
-
-    createXSDMetaData(theModelPackageImpl, theInternalPackageImpl);
-  }
-    
-  protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl, InternalFactoryImpl theInternalPackageImpl)
-  {
-    super.initXSD();
-    
-    Property property = null;
-    
-
-    property = createGlobalProperty
-      ("aliasName",
-      theModelPackageImpl.getString(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "aliasName",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("dataType",
-      theInternalPackageImpl.getQName(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "dataType",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("many",
-      theModelPackageImpl.getBoolean(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "many",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("name",
-      theModelPackageImpl.getString(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "name",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("oppositeProperty",
-      theModelPackageImpl.getString(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "oppositeProperty",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("propertyType",
-      theInternalPackageImpl.getQName(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "propertyType",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("readOnly",
-      theModelPackageImpl.getBoolean(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "readOnly",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("sequence",
-      theModelPackageImpl.getBoolean(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "sequence",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("string",
-      theModelPackageImpl.getBoolean(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "string",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    property = createGlobalProperty
-      ("xmlElement",
-      theModelPackageImpl.getBoolean(),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "xmlElement",
-       "namespace", "##targetNamespace"
-       },
-       IS_ATTRIBUTE);
-                
-    addXSDMapping
-      (xmlInfoType,
-       new String[] 
-       {
-       "name", "XMLInfo",
-       "kind", "empty"
-       });
-
-    addXSDMapping
-      (getProperty(xmlInfoType, XMLInfoImpl.INTERNAL_XML_ELEMENT),
-       new String[]
-       {
-       "kind", "attribute",
-       "name", "xmlElement"
-       });
-
-  }
-    
-} //XMLFactoryImpl
+/**
+ *
+ *  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.sdo.model.xml.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.model.internal.InternalFactory;
+
+import org.apache.tuscany.sdo.model.internal.impl.InternalFactoryImpl;
+
+import org.apache.tuscany.sdo.model.xml.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the commonj.sdo/xml model factory.
+ * This model is generated from sdoXML.xsd, in the sdo-api project.
+ * Until the SDO code generator supports name conflicts and regen/merge, follow the following steps to regenerate this model:
+ *   1. Regenerate the model into a temporary directory:
+ *         XSD2JavaGenerator -generateBuiltIn commonj.sdo/xml -prefix XML -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.xml <sdo-api-dir>/src/main/resources/xml/sdoXML.xsd
+ *   2. Make sure the top of each generated file contains the ASF License.      
+ *   3. Move this JavaDoc comment into the newly generated XMLFactoryImpl class.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class XMLFactoryImpl extends FactoryBase implements XMLFactory
+{
+
+  /**
+   * The package namespace URI.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String NAMESPACE_URI = "commonj.sdo/xml";
+
+  /**
+   * The package namespace name.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String NAMESPACE_PREFIX = "sdoXML";
+
+  /**
+   * The version of the generator pattern used to generate this class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String PATTERN_VERSION = "1.2";
+  
+  public static final int XML_INFO = 1;
+  
+  /**
+   * Creates an instance of the factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public XMLFactoryImpl()
+  {
+    super(NAMESPACE_URI, NAMESPACE_PREFIX, "org.apache.tuscany.sdo.model.xml");
+  }
+
+  /**
+   * Registers the Factory instance so that it is available within the supplied scope.
+   * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void register(HelperContext scope) 
+  {
+    if(scope == null) {
+      throw new IllegalArgumentException("Scope can not be null");
+    }
+    
+    //Register dependent packages with provided scope
+    ModelFactory.INSTANCE.register(scope);
+    InternalFactory.INSTANCE.register(scope);
+    
+    // Initialize this package   
+    TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+    th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+  }
+  
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public DataObject create(int typeNumber)
+  {
+    switch (typeNumber)
+    {
+      case XML_INFO: return (DataObject)createXMLInfo();
+      default:
+        return super.create(typeNumber);
+    }
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public XMLInfo createXMLInfo()
+  {
+    XMLInfoImpl xmlInfo = new XMLInfoImpl();
+    return xmlInfo;
+  }
+  
+  // Following creates and initializes SDO metadata for the supported types.			
+  protected Type xmlInfoType = null;
+
+  public Type getXMLInfo()
+  {
+    return xmlInfoType;
+  }
+  
+
+  private static XMLFactoryImpl instance = null; 
+  public static XMLFactoryImpl init()
+  {
+    if (instance != null ) return instance;
+    instance = new XMLFactoryImpl();
+
+    // Initialize dependent packages
+    ModelFactory ModelFactoryInstance = ModelFactory.INSTANCE;
+    InternalFactory InternalFactoryInstance = InternalFactory.INSTANCE;
+    
+    // Create package meta-data objects
+    instance.createMetaData();
+
+    // Initialize created meta-data
+    instance.initializeMetaData();
+    
+    // Mark meta-data to indicate it can't be changed
+    //theXMLFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+    return instance;
+  }
+  
+  private boolean isCreated = false;
+
+  public void createMetaData()
+  {
+    if (isCreated) return;
+    isCreated = true;	
+
+    // Create types and their properties
+    xmlInfoType = createType(false, XML_INFO);
+    createProperty(true, xmlInfoType,XMLInfoImpl.INTERNAL_XML_ELEMENT); 
+  }
+  
+  private boolean isInitialized = false;
+
+  public void initializeMetaData()
+  {
+    if (isInitialized) return;
+    isInitialized = true;
+
+    // Obtain other dependent packages
+    ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)ModelFactory.INSTANCE;
+    InternalFactoryImpl theInternalPackageImpl = (InternalFactoryImpl)InternalFactory.INSTANCE;
+    Property property = null;
+
+    // Add supertypes to types
+
+    // Initialize types and properties
+    initializeType(xmlInfoType, XMLInfo.class, "XMLInfo", false);
+    property = getLocalProperty(xmlInfoType, 0);
+    initializeProperty(property, theModelPackageImpl.getBoolean(), "xmlElement", null, 0, 1, XMLInfo.class, false, true, false);
+
+    createXSDMetaData(theModelPackageImpl, theInternalPackageImpl);
+  }
+    
+  protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl, InternalFactoryImpl theInternalPackageImpl)
+  {
+    super.initXSD();
+    
+    Property property = null;
+    
+
+    property = createGlobalProperty
+      ("aliasName",
+      theModelPackageImpl.getString(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "aliasName",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("dataType",
+      theInternalPackageImpl.getQName(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "dataType",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("many",
+      theModelPackageImpl.getBoolean(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "many",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("name",
+      theModelPackageImpl.getString(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "name",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("oppositeProperty",
+      theModelPackageImpl.getString(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "oppositeProperty",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("propertyType",
+      theInternalPackageImpl.getQName(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "propertyType",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("readOnly",
+      theModelPackageImpl.getBoolean(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "readOnly",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("sequence",
+      theModelPackageImpl.getBoolean(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "sequence",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("string",
+      theModelPackageImpl.getBoolean(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "string",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    property = createGlobalProperty
+      ("xmlElement",
+      theModelPackageImpl.getBoolean(),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "xmlElement",
+       "namespace", "##targetNamespace"
+       },
+       IS_ATTRIBUTE);
+                
+    addXSDMapping
+      (xmlInfoType,
+       new String[] 
+       {
+       "name", "XMLInfo",
+       "kind", "empty"
+       });
+
+    addXSDMapping
+      (getProperty(xmlInfoType, XMLInfoImpl.INTERNAL_XML_ELEMENT),
+       new String[]
+       {
+       "kind", "attribute",
+       "name", "xmlElement"
+       });
+
+  }
+    
+} //XMLFactoryImpl

Propchange: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java?rev=643011&r1=643010&r2=643011&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java (original)
+++ incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java Mon Mar 31 07:55:36 2008
@@ -1,256 +1,256 @@
-/**
- *
- *  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.sdo.model.xml.impl;
-
-import commonj.sdo.Type;
-
-import org.apache.tuscany.sdo.impl.DataObjectBase;
-
-import org.apache.tuscany.sdo.model.xml.XMLFactory;
-import org.apache.tuscany.sdo.model.xml.XMLInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Info</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- *   <li>{@link org.apache.tuscany.sdo.model.xml.impl.XMLInfoImpl#isXmlElement <em>Xml Element</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class XMLInfoImpl extends DataObjectBase implements XMLInfo
-{
-
-  public final static int XML_ELEMENT = 0;
-
-  public final static int SDO_PROPERTY_COUNT = 1;
-
-  public final static int EXTENDED_PROPERTY_COUNT = 0;
-
-
-  /**
-   * The internal feature id for the '<em><b>Xml Element</b></em>' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */ 
-  public final static int INTERNAL_XML_ELEMENT = 0;
-
-  /**
-   * The number of properties for this type.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  public final static int INTERNAL_PROPERTY_COUNT = 1;
-
-  protected int internalConvertIndex(int internalIndex)
-  {
-    switch (internalIndex)
-    {
-      case INTERNAL_XML_ELEMENT: return XML_ELEMENT;
-    }
-    return super.internalConvertIndex(internalIndex);
-  }
-
-
-  /**
-   * The default value of the '{@link #isXmlElement() <em>Xml Element</em>}' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @see #isXmlElement()
-   * @generated
-   * @ordered
-   */
-  protected static final boolean XML_ELEMENT_DEFAULT_ = false;
-
-  /**
-   * The cached value of the '{@link #isXmlElement() <em>Xml Element</em>}' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @see #isXmlElement()
-   * @generated
-   * @ordered
-   */
-  protected boolean xmlElement = XML_ELEMENT_DEFAULT_;
-
-  /**
-   * This is true if the Xml Element attribute has been set.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  protected boolean xmlElement_set_ = false;
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public XMLInfoImpl()
-  {
-    super();
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public Type getStaticType()
-  {
-    return ((XMLFactoryImpl)XMLFactory.INSTANCE).getXMLInfo();
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public boolean isXmlElement()
-  {
-    return xmlElement;
-  }
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public void setXmlElement(boolean newXmlElement)
-  {
-    boolean oldXmlElement = xmlElement;
-    xmlElement = newXmlElement;
-    boolean oldXmlElement_set_ = xmlElement_set_;
-    xmlElement_set_ = true;
-    if (isNotifying())
-      notify(ChangeKind.SET, INTERNAL_XML_ELEMENT, oldXmlElement, xmlElement, !oldXmlElement_set_);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public void unsetXmlElement()
-  {
-    boolean oldXmlElement = xmlElement;
-    boolean oldXmlElement_set_ = xmlElement_set_;
-    xmlElement = XML_ELEMENT_DEFAULT_;
-    xmlElement_set_ = false;
-    if (isNotifying())
-      notify(ChangeKind.UNSET, INTERNAL_XML_ELEMENT, oldXmlElement, XML_ELEMENT_DEFAULT_, oldXmlElement_set_);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public boolean isSetXmlElement()
-  {
-    return xmlElement_set_;
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public Object get(int propertyIndex, boolean resolve)
-  {
-    switch (propertyIndex)
-    {
-      case XML_ELEMENT:
-        return isXmlElement() ? Boolean.TRUE : Boolean.FALSE;
-    }
-    return super.get(propertyIndex, resolve);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public void set(int propertyIndex, Object newValue)
-  {
-    switch (propertyIndex)
-    {
-      case XML_ELEMENT:
-        setXmlElement(((Boolean)newValue).booleanValue());
-        return;
-    }
-    super.set(propertyIndex, newValue);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public void unset(int propertyIndex)
-  {
-    switch (propertyIndex)
-    {
-      case XML_ELEMENT:
-        unsetXmlElement();
-        return;
-    }
-    super.unset(propertyIndex);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public boolean isSet(int propertyIndex)
-  {
-    switch (propertyIndex)
-    {
-      case XML_ELEMENT:
-        return isSetXmlElement();
-    }
-    return super.isSet(propertyIndex);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public String toString()
-  {
-    if (isProxy(this)) return super.toString();
-
-    StringBuffer result = new StringBuffer(super.toString());
-    result.append(" (xmlElement: ");
-    if (xmlElement_set_) result.append(xmlElement); else result.append("<unset>");
-    result.append(')');
-    return result.toString();
-  }
-
-} //XMLInfoImpl
+/**
+ *
+ *  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.sdo.model.xml.impl;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.xml.XMLFactory;
+import org.apache.tuscany.sdo.model.xml.XMLInfo;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Info</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ *   <li>{@link org.apache.tuscany.sdo.model.xml.impl.XMLInfoImpl#isXmlElement <em>Xml Element</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class XMLInfoImpl extends DataObjectBase implements XMLInfo
+{
+
+  public final static int XML_ELEMENT = 0;
+
+  public final static int SDO_PROPERTY_COUNT = 1;
+
+  public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+  /**
+   * The internal feature id for the '<em><b>Xml Element</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */ 
+  public final static int INTERNAL_XML_ELEMENT = 0;
+
+  /**
+   * The number of properties for this type.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+  protected int internalConvertIndex(int internalIndex)
+  {
+    switch (internalIndex)
+    {
+      case INTERNAL_XML_ELEMENT: return XML_ELEMENT;
+    }
+    return super.internalConvertIndex(internalIndex);
+  }
+
+
+  /**
+   * The default value of the '{@link #isXmlElement() <em>Xml Element</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #isXmlElement()
+   * @generated
+   * @ordered
+   */
+  protected static final boolean XML_ELEMENT_DEFAULT_ = false;
+
+  /**
+   * The cached value of the '{@link #isXmlElement() <em>Xml Element</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #isXmlElement()
+   * @generated
+   * @ordered
+   */
+  protected boolean xmlElement = XML_ELEMENT_DEFAULT_;
+
+  /**
+   * This is true if the Xml Element attribute has been set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  protected boolean xmlElement_set_ = false;
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public XMLInfoImpl()
+  {
+    super();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Type getStaticType()
+  {
+    return ((XMLFactoryImpl)XMLFactory.INSTANCE).getXMLInfo();
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isXmlElement()
+  {
+    return xmlElement;
+  }
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void setXmlElement(boolean newXmlElement)
+  {
+    boolean oldXmlElement = xmlElement;
+    xmlElement = newXmlElement;
+    boolean oldXmlElement_set_ = xmlElement_set_;
+    xmlElement_set_ = true;
+    if (isNotifying())
+      notify(ChangeKind.SET, INTERNAL_XML_ELEMENT, oldXmlElement, xmlElement, !oldXmlElement_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unsetXmlElement()
+  {
+    boolean oldXmlElement = xmlElement;
+    boolean oldXmlElement_set_ = xmlElement_set_;
+    xmlElement = XML_ELEMENT_DEFAULT_;
+    xmlElement_set_ = false;
+    if (isNotifying())
+      notify(ChangeKind.UNSET, INTERNAL_XML_ELEMENT, oldXmlElement, XML_ELEMENT_DEFAULT_, oldXmlElement_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSetXmlElement()
+  {
+    return xmlElement_set_;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Object get(int propertyIndex, boolean resolve)
+  {
+    switch (propertyIndex)
+    {
+      case XML_ELEMENT:
+        return isXmlElement() ? Boolean.TRUE : Boolean.FALSE;
+    }
+    return super.get(propertyIndex, resolve);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void set(int propertyIndex, Object newValue)
+  {
+    switch (propertyIndex)
+    {
+      case XML_ELEMENT:
+        setXmlElement(((Boolean)newValue).booleanValue());
+        return;
+    }
+    super.set(propertyIndex, newValue);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unset(int propertyIndex)
+  {
+    switch (propertyIndex)
+    {
+      case XML_ELEMENT:
+        unsetXmlElement();
+        return;
+    }
+    super.unset(propertyIndex);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSet(int propertyIndex)
+  {
+    switch (propertyIndex)
+    {
+      case XML_ELEMENT:
+        return isSetXmlElement();
+    }
+    return super.isSet(propertyIndex);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String toString()
+  {
+    if (isProxy(this)) return super.toString();
+
+    StringBuffer result = new StringBuffer(super.toString());
+    result.append(" (xmlElement: ");
+    if (xmlElement_set_) result.append(xmlElement); else result.append("<unset>");
+    result.append(')');
+    return result.toString();
+  }
+
+} //XMLInfoImpl

Propchange: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java?rev=643011&r1=643010&r2=643011&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java (original)
+++ incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java Mon Mar 31 07:55:36 2008
@@ -1,92 +1,92 @@
-/**
- *
- *  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.sdo.util;
-
-import java.util.Comparator;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sdo.util.resource.RecordedEventXMLStreamReader;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.ecore.xml.type.internal.QName;
-
-/**
- * StAX Deserializer. The instance isn't thread-safe, however it's safe to use the instance any times on the same thread.
- */
-public class StreamDeserializer implements XMLStreamConstants {
-    protected XMLStreamReader reader;
-
-    protected final XMLStreamReader play(RecordedEventXMLStreamReader.Tag tag) {
-        return tag.play(reader);
-    }
-
-    protected String nameSpace, name;
-
-    protected final boolean typedXSI() {
-        name = reader.getAttributeValue(ExtendedMetaData.XSI_URI, XMLResource.TYPE);
-        if (name == null)
-            return false;
-        int index = name.indexOf(':');
-        if (index == -1)
-            nameSpace = reader.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX); // may be XMLConstants.NULL_NS_URI
-        else {
-            nameSpace = reader.getNamespaceURI(name.substring(0, index));
-            name = name.substring(++index);
-        }
-        return true;
-    }
-
-    static protected Object value(Object type, String literal, NamespaceContext nameSpaces) {
-        Object value = EcoreUtil.createFromString((EDataType) type, literal);
-        if (!(value instanceof QName))
-            return value;
-        QName qName = (QName) value;
-        qName.setNamespaceURI(nameSpaces.getNamespaceURI(qName.getPrefix()));
-        return value;
-    }
-
-    static public class Attribute {
-        public String name, value;
-    }
-
-    static public final class QualifiedAttribute extends Attribute {
-        public String nameSpace;
-    }
-
-    static protected final Comparator EQUAL_NULL = new Comparator() {
-        public int compare(Object v, Object NULL) {
-            return v == null || v.equals(null) ? 0 : 1;
-        }
-    }, EQUAL = new Comparator() {
-        public int compare(Object v, Object value) {
-            return value.equals(v) ? 0 : -1;
-        }
-    }, SAME = new Comparator() {
-        public int compare(Object v, Object value) {
-            return value == v ? 0 : -1;
-        }
-    };
-}
+/**
+ *
+ *  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.sdo.util;
+
+import java.util.Comparator;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sdo.util.resource.RecordedEventXMLStreamReader;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xml.type.internal.QName;
+
+/**
+ * StAX Deserializer. The instance isn't thread-safe, however it's safe to use the instance any times on the same thread.
+ */
+public class StreamDeserializer implements XMLStreamConstants {
+    protected XMLStreamReader reader;
+
+    protected final XMLStreamReader play(RecordedEventXMLStreamReader.Tag tag) {
+        return tag.play(reader);
+    }
+
+    protected String nameSpace, name;
+
+    protected final boolean typedXSI() {
+        name = reader.getAttributeValue(ExtendedMetaData.XSI_URI, XMLResource.TYPE);
+        if (name == null)
+            return false;
+        int index = name.indexOf(':');
+        if (index == -1)
+            nameSpace = reader.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX); // may be XMLConstants.NULL_NS_URI
+        else {
+            nameSpace = reader.getNamespaceURI(name.substring(0, index));
+            name = name.substring(++index);
+        }
+        return true;
+    }
+
+    static protected Object value(Object type, String literal, NamespaceContext nameSpaces) {
+        Object value = EcoreUtil.createFromString((EDataType) type, literal);
+        if (!(value instanceof QName))
+            return value;
+        QName qName = (QName) value;
+        qName.setNamespaceURI(nameSpaces.getNamespaceURI(qName.getPrefix()));
+        return value;
+    }
+
+    static public class Attribute {
+        public String name, value;
+    }
+
+    static public final class QualifiedAttribute extends Attribute {
+        public String nameSpace;
+    }
+
+    static protected final Comparator EQUAL_NULL = new Comparator() {
+        public int compare(Object v, Object NULL) {
+            return v == null || v.equals(null) ? 0 : 1;
+        }
+    }, EQUAL = new Comparator() {
+        public int compare(Object v, Object value) {
+            return value.equals(v) ? 0 : -1;
+        }
+    }, SAME = new Comparator() {
+        public int compare(Object v, Object value) {
+            return value == v ? 0 : -1;
+        }
+    };
+}

Propchange: incubator/tuscany/branches/sdo-1.1-incubating/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java
------------------------------------------------------------------------------
    svn:eol-style = native



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