From 195774c489a1a671aca514b0afa88332bf9c6ee3 Mon Sep 17 00:00:00 2001 From: lresende Date: Tue, 10 Nov 2009 19:20:12 +0000 Subject: Moving SDO tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834617 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sdo/util/metadata/JavaMetaData.java | 90 +++++ .../tuscany/sdo/util/metadata/MetadataFactory.java | 77 +++++ .../sdo/util/metadata/SDOMetaDataGroup.java | 87 +++++ .../tuscany/sdo/util/metadata/TypeMetaData.java | 65 ++++ .../tuscany/sdo/util/metadata/XSDMetaData.java | 66 ++++ .../sdo/util/metadata/impl/JavaMetaDataImpl.java | 267 +++++++++++++++ .../util/metadata/impl/MetadataFactoryImpl.java | 367 +++++++++++++++++++++ .../util/metadata/impl/SDOMetaDataGroupImpl.java | 285 ++++++++++++++++ .../sdo/util/metadata/impl/TypeMetaDataImpl.java | 203 ++++++++++++ .../sdo/util/metadata/impl/XSDMetaDataImpl.java | 203 ++++++++++++ 10 files changed, 1710 insertions(+) create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/JavaMetaData.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/MetadataFactory.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/SDOMetaDataGroup.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/TypeMetaData.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/XSDMetaData.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/JavaMetaDataImpl.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/MetadataFactoryImpl.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java create mode 100644 sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java (limited to 'sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata') diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/JavaMetaData.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/JavaMetaData.java new file mode 100644 index 0000000000..f24b166f77 --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/JavaMetaData.java @@ -0,0 +1,90 @@ +/** + * + * 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.metadata; + +import java.io.Serializable; + +/** + * + * A representation of the model object 'Java Meta Data'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @extends Serializable + * @generated + */ +public interface JavaMetaData extends Serializable +{ + /** + * Returns the value of the 'Factory Interface' attribute. + * + *

+ * If the meaning of the 'Factory Interface' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Factory Interface' attribute. + * @see #setFactoryInterface(String) + * @generated + */ + String getFactoryInterface(); + + /** + * Sets the value of the '{@link org.apache.tuscany.sdo.util.metadata.JavaMetaData#getFactoryInterface Factory Interface}' attribute. + * + * + * @param value the new value of the 'Factory Interface' attribute. + * @see #getFactoryInterface() + * @generated + */ + void setFactoryInterface(String value); + + /** + * Returns the value of the 'Type Interface' attribute. + * + *

+ * If the meaning of the 'Type Interface' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Type Interface' attribute. + * @see #setTypeInterface(String) + * @generated + */ + String getTypeInterface(); + + /** + * Sets the value of the '{@link org.apache.tuscany.sdo.util.metadata.JavaMetaData#getTypeInterface Type Interface}' attribute. + * + * + * @param value the new value of the 'Type Interface' attribute. + * @see #getTypeInterface() + * @generated + */ + void setTypeInterface(String value); + +} // JavaMetaData diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/MetadataFactory.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/MetadataFactory.java new file mode 100644 index 0000000000..1f540afa2c --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/MetadataFactory.java @@ -0,0 +1,77 @@ +/** + * + * 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.metadata; + + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @generated + */ +public interface MetadataFactory +{ + + /** + * The singleton instance of the factory. + * + * + * @generated + */ + MetadataFactory INSTANCE = org.apache.tuscany.sdo.util.metadata.impl.MetadataFactoryImpl.init(); + + /** + * Returns a new object of class 'Java Meta Data'. + * + * + * @return a new object of class 'Java Meta Data'. + * @generated + */ + JavaMetaData createJavaMetaData(); + + /** + * Returns a new object of class 'SDO Meta Data Group'. + * + * + * @return a new object of class 'SDO Meta Data Group'. + * @generated + */ + SDOMetaDataGroup createSDOMetaDataGroup(); + + /** + * Returns a new object of class 'Type Meta Data'. + * + * + * @return a new object of class 'Type Meta Data'. + * @generated + */ + TypeMetaData createTypeMetaData(); + + /** + * Returns a new object of class 'XSD Meta Data'. + * + * + * @return a new object of class 'XSD Meta Data'. + * @generated + */ + XSDMetaData createXSDMetaData(); + +} //MetadataFactory diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/SDOMetaDataGroup.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/SDOMetaDataGroup.java new file mode 100644 index 0000000000..5657f26ca5 --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/SDOMetaDataGroup.java @@ -0,0 +1,87 @@ +/** + * + * 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.metadata; + +import java.io.Serializable; + +import java.util.List; + +/** + * + * A representation of the model object 'SDO Meta Data Group'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @extends Serializable + * @generated + */ +public interface SDOMetaDataGroup extends Serializable +{ + /** + * Returns the value of the 'Java Meta Data' containment reference list. + * The list contents are of type {@link org.apache.tuscany.sdo.util.metadata.JavaMetaData}. + * + *

+ * If the meaning of the 'Java Meta Data' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Java Meta Data' containment reference list. + * @generated + */ + List getJavaMetaData(); + + /** + * Returns the value of the 'Xsd Meta Data' containment reference list. + * The list contents are of type {@link org.apache.tuscany.sdo.util.metadata.XSDMetaData}. + * + *

+ * If the meaning of the 'Xsd Meta Data' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Xsd Meta Data' containment reference list. + * @generated + */ + List getXsdMetaData(); + + /** + * Returns the value of the 'Type Meta Data' containment reference list. + * The list contents are of type {@link org.apache.tuscany.sdo.util.metadata.TypeMetaData}. + * + *

+ * If the meaning of the 'Type Meta Data' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Type Meta Data' containment reference list. + * @generated + */ + List getTypeMetaData(); + +} // SDOMetaDataGroup diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/TypeMetaData.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/TypeMetaData.java new file mode 100644 index 0000000000..c3d67a8318 --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/TypeMetaData.java @@ -0,0 +1,65 @@ +/** + * + * 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.metadata; + +import java.io.Serializable; + +/** + * + * A representation of the model object 'Type Meta Data'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @extends Serializable + * @generated + */ +public interface TypeMetaData extends Serializable +{ + /** + * Returns the value of the 'Location' attribute. + * + *

+ * If the meaning of the 'Location' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Location' attribute. + * @see #setLocation(String) + * @generated + */ + String getLocation(); + + /** + * Sets the value of the '{@link org.apache.tuscany.sdo.util.metadata.TypeMetaData#getLocation Location}' attribute. + * + * + * @param value the new value of the 'Location' attribute. + * @see #getLocation() + * @generated + */ + void setLocation(String value); + +} // TypeMetaData diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/XSDMetaData.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/XSDMetaData.java new file mode 100644 index 0000000000..09bffece71 --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/XSDMetaData.java @@ -0,0 +1,66 @@ +/** + * + * 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.metadata; + +import java.io.Serializable; + +/** + * + * A representation of the model object 'XSD Meta Data'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @extends Serializable + * @generated + */ +public interface XSDMetaData extends Serializable +{ + /** + * Returns the value of the 'Location' attribute. + * + *

+ * If the meaning of the 'Location' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Location' attribute. + * @see #setLocation(String) + * @generated + */ + String getLocation(); + + /** + * Sets the value of the '{@link org.apache.tuscany.sdo.util.metadata.XSDMetaData#getLocation Location}' attribute. + * + * + * @param value the new value of the 'Location' attribute. + * @see #getLocation() + * @generated + */ + void setLocation(String value); + +} // XSDMetaData diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/JavaMetaDataImpl.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/JavaMetaDataImpl.java new file mode 100644 index 0000000000..8a6dce6161 --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/JavaMetaDataImpl.java @@ -0,0 +1,267 @@ +/** + * + * 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.metadata.impl; + +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.metadata.JavaMetaData; +import org.apache.tuscany.sdo.util.metadata.MetadataFactory; + +/** + * + * An implementation of the model object 'Java Meta Data'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class JavaMetaDataImpl extends DataObjectBase implements JavaMetaData +{ + /** + * The feature id for the 'Factory Interface' attribute. + * + * + * @generated + * @ordered + */ + public final static int FACTORY_INTERFACE = 0; + + /** + * The feature id for the 'Type Interface' attribute. + * + * + * @generated + * @ordered + */ + public final static int TYPE_INTERFACE = 1; + + /** + * This represents the number of properties for this type. + * + * + * @generated + * @ordered + */ + + public final static int SDO_PROPERTY_COUNT = 2; + + /** + * The default value of the '{@link #getFactoryInterface() Factory Interface}' attribute. + * + * + * @see #getFactoryInterface() + * @generated + * @ordered + */ + protected static final String FACTORY_INTERFACE_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getFactoryInterface() Factory Interface}' attribute. + * + * + * @see #getFactoryInterface() + * @generated + * @ordered + */ + protected String factoryInterface = FACTORY_INTERFACE_DEFAULT_; + + /** + * The default value of the '{@link #getTypeInterface() Type Interface}' attribute. + * + * + * @see #getTypeInterface() + * @generated + * @ordered + */ + protected static final String TYPE_INTERFACE_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getTypeInterface() Type Interface}' attribute. + * + * + * @see #getTypeInterface() + * @generated + * @ordered + */ + protected String typeInterface = TYPE_INTERFACE_DEFAULT_; + + /** + * + * + * @generated + */ + protected JavaMetaDataImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getStaticType() + { + return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getJavaMetaData(); + } + + /** + * + * + * @generated + */ + public String getFactoryInterface() + { + return factoryInterface; + } + /** + * + * + * @generated + */ + public void setFactoryInterface(String newFactoryInterface) + { + String oldFactoryInterface = factoryInterface; + factoryInterface = newFactoryInterface; + if (isNotifying()) + notify(ChangeKind.SET, FACTORY_INTERFACE, oldFactoryInterface, factoryInterface); + } + + /** + * + * + * @generated + */ + public String getTypeInterface() + { + return typeInterface; + } + /** + * + * + * @generated + */ + public void setTypeInterface(String newTypeInterface) + { + String oldTypeInterface = typeInterface; + typeInterface = newTypeInterface; + if (isNotifying()) + notify(ChangeKind.SET, TYPE_INTERFACE, oldTypeInterface, typeInterface); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case FACTORY_INTERFACE: + return getFactoryInterface(); + case TYPE_INTERFACE: + return getTypeInterface(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case FACTORY_INTERFACE: + setFactoryInterface((String)newValue); + return; + case TYPE_INTERFACE: + setTypeInterface((String)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case FACTORY_INTERFACE: + setFactoryInterface(FACTORY_INTERFACE_DEFAULT_); + return; + case TYPE_INTERFACE: + setTypeInterface(TYPE_INTERFACE_DEFAULT_); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case FACTORY_INTERFACE: + return FACTORY_INTERFACE_DEFAULT_ == null ? factoryInterface != null : !FACTORY_INTERFACE_DEFAULT_.equals(factoryInterface); + case TYPE_INTERFACE: + return TYPE_INTERFACE_DEFAULT_ == null ? typeInterface != null : !TYPE_INTERFACE_DEFAULT_.equals(typeInterface); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (factoryInterface: "); + result.append(factoryInterface); + result.append(", typeInterface: "); + result.append(typeInterface); + result.append(')'); + return result.toString(); + } + +} //JavaMetaDataImpl diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/MetadataFactoryImpl.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/MetadataFactoryImpl.java new file mode 100644 index 0000000000..a4ea322549 --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/MetadataFactoryImpl.java @@ -0,0 +1,367 @@ +/** + * + * 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.metadata.impl; + +import commonj.sdo.DataObject; +import commonj.sdo.Property; +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.SDOFactory; + +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.util.SDOUtil; + +import org.apache.tuscany.sdo.util.metadata.*; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class MetadataFactoryImpl extends FactoryBase implements MetadataFactory +{ + + /** + * The package namespace URI. + * + * + * @generated + */ + public static final String NAMESPACE_URI = "org.apache.tuscany.sdo/metadata"; + + /** + * The package namespace name. + * + * + * @generated + */ + public static final String NAMESPACE_PREFIX = "metadata"; + public static final int JAVA_META_DATA = 1; + public static final int SDO_META_DATA_GROUP = 2; + public static final int TYPE_META_DATA = 3; + public static final int XSD_META_DATA = 4; + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public MetadataFactoryImpl() + { + super(NAMESPACE_URI, NAMESPACE_PREFIX); + } + + /** + * + * + * @generated + */ + public DataObject create(int typeNumber) + { + switch (typeNumber) + { + case JAVA_META_DATA: return (DataObject)createJavaMetaData(); + case SDO_META_DATA_GROUP: return (DataObject)createSDOMetaDataGroup(); + case TYPE_META_DATA: return (DataObject)createTypeMetaData(); + case XSD_META_DATA: return (DataObject)createXSDMetaData(); + default: + return super.create(typeNumber); + } + } + + /** + * + * + * @generated + */ + public JavaMetaData createJavaMetaData() + { + JavaMetaDataImpl javaMetaData = new JavaMetaDataImpl(); + return javaMetaData; + } + /** + * + * + * @generated + */ + public SDOMetaDataGroup createSDOMetaDataGroup() + { + SDOMetaDataGroupImpl sdoMetaDataGroup = new SDOMetaDataGroupImpl(); + return sdoMetaDataGroup; + } + /** + * + * + * @generated + */ + public TypeMetaData createTypeMetaData() + { + TypeMetaDataImpl typeMetaData = new TypeMetaDataImpl(); + return typeMetaData; + } + /** + * + * + * @generated + */ + public XSDMetaData createXSDMetaData() + { + XSDMetaDataImpl xsdMetaData = new XSDMetaDataImpl(); + return xsdMetaData; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type javaMetaDataType = null; + + public Type getJavaMetaData() + { + return javaMetaDataType; + } + + protected Type sdoMetaDataGroupType = null; + + public Type getSDOMetaDataGroup() + { + return sdoMetaDataGroupType; + } + + protected Type typeMetaDataType = null; + + public Type getTypeMetaData() + { + return typeMetaDataType; + } + + protected Type xsdMetaDataType = null; + + public Type getXSDMetaData() + { + return xsdMetaDataType; + } + + + private static boolean isInited = false; + + public static MetadataFactoryImpl init() + { + if (isInited) return (MetadataFactoryImpl)FactoryBase.getStaticFactory(MetadataFactoryImpl.NAMESPACE_URI); + MetadataFactoryImpl theMetadataFactoryImpl = new MetadataFactoryImpl(); + isInited = true; + + // Initialize simple dependencies + SDOUtil.registerStaticTypes(SDOFactory.class); + SDOUtil.registerStaticTypes(ModelFactory.class); + + // Create package meta-data objects + theMetadataFactoryImpl.createMetaData(); + + // Initialize created meta-data + theMetadataFactoryImpl.initializeMetaData(); + + // Mark meta-data to indicate it can't be changed + //theMetadataFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? + + return theMetadataFactoryImpl; + } + + private boolean isCreated = false; + + public void createMetaData() + { + if (isCreated) return; + isCreated = true; + + + javaMetaDataType = createType(false, JAVA_META_DATA); + createProperty(true, javaMetaDataType, JavaMetaDataImpl.FACTORY_INTERFACE); + createProperty(true, javaMetaDataType, JavaMetaDataImpl.TYPE_INTERFACE); + + sdoMetaDataGroupType = createType(false, SDO_META_DATA_GROUP); + createProperty(false, sdoMetaDataGroupType, SDOMetaDataGroupImpl.JAVA_META_DATA); + createProperty(false, sdoMetaDataGroupType, SDOMetaDataGroupImpl.XSD_META_DATA); + createProperty(false, sdoMetaDataGroupType, SDOMetaDataGroupImpl.TYPE_META_DATA); + + typeMetaDataType = createType(false, TYPE_META_DATA); + createProperty(true, typeMetaDataType, TypeMetaDataImpl.LOCATION); + + xsdMetaDataType = createType(false, XSD_META_DATA); + createProperty(true, xsdMetaDataType, XSDMetaDataImpl.LOCATION); + } + + private boolean isInitialized = false; + + public void initializeMetaData() + { + if (isInitialized) return; + isInitialized = true; + + // Obtain other dependent packages + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + Property property = null; + + // Add supertypes to classes + + // Initialize classes and features; add operations and parameters + initializeType(javaMetaDataType, JavaMetaData.class, "JavaMetaData"); + + property = (Property)javaMetaDataType.getProperties().get(JavaMetaDataImpl.FACTORY_INTERFACE); + initializeProperty(property, theModelPackageImpl.getString(), "factoryInterface", null, 0, 1, JavaMetaData.class, false, false, false); + + property = (Property)javaMetaDataType.getProperties().get(JavaMetaDataImpl.TYPE_INTERFACE); + initializeProperty(property, theModelPackageImpl.getString(), "typeInterface", null, 0, 1, JavaMetaData.class, false, false, false); + + initializeType(sdoMetaDataGroupType, SDOMetaDataGroup.class, "SDOMetaDataGroup"); + + property = (Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.JAVA_META_DATA); + initializeProperty(property, this.getJavaMetaData(), "javaMetaData", null, 0, -1, SDOMetaDataGroup.class, false, false, false, true , null); + + property = (Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.XSD_META_DATA); + initializeProperty(property, this.getXSDMetaData(), "xsdMetaData", null, 0, -1, SDOMetaDataGroup.class, false, false, false, true , null); + + property = (Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.TYPE_META_DATA); + initializeProperty(property, this.getTypeMetaData(), "typeMetaData", null, 0, -1, SDOMetaDataGroup.class, false, false, false, true , null); + + initializeType(typeMetaDataType, TypeMetaData.class, "TypeMetaData"); + + property = (Property)typeMetaDataType.getProperties().get(TypeMetaDataImpl.LOCATION); + initializeProperty(property, theModelPackageImpl.getString(), "location", null, 1, 1, TypeMetaData.class, false, false, false); + + initializeType(xsdMetaDataType, XSDMetaData.class, "XSDMetaData"); + + property = (Property)xsdMetaDataType.getProperties().get(XSDMetaDataImpl.LOCATION); + initializeProperty(property, theModelPackageImpl.getString(), "location", null, 1, 1, XSDMetaData.class, false, false, false); + + createXSDMetaData(theModelPackageImpl); + } + + protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl) + { + super.initXSD(); + + Property property = null; + + property = createGlobalProperty + ("sdoMetaDataGroup", + this.getSDOMetaDataGroup(), + new String[] + { + "kind", "element", + "name", "sdoMetaDataGroup", + "namespace", "##targetNamespace" + }); + + addXSDMapping + (javaMetaDataType, + new String[] + { + "name", "JavaMetaData", + "kind", "empty" + }); + + addXSDMapping + ((Property)javaMetaDataType.getProperties().get(JavaMetaDataImpl.FACTORY_INTERFACE), + new String[] + { + "kind", "attribute", + "name", "factoryInterface" + }); + + addXSDMapping + ((Property)javaMetaDataType.getProperties().get(JavaMetaDataImpl.TYPE_INTERFACE), + new String[] + { + "kind", "attribute", + "name", "typeInterface" + }); + + addXSDMapping + (sdoMetaDataGroupType, + new String[] + { + "name", "SDOMetaDataGroup", + "kind", "elementOnly" + }); + + addXSDMapping + ((Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.JAVA_META_DATA), + new String[] + { + "kind", "element", + "name", "javaMetaData" + }); + + addXSDMapping + ((Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.XSD_META_DATA), + new String[] + { + "kind", "element", + "name", "xsdMetaData" + }); + + addXSDMapping + ((Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.TYPE_META_DATA), + new String[] + { + "kind", "element", + "name", "typeMetaData" + }); + + addXSDMapping + (typeMetaDataType, + new String[] + { + "name", "TypeMetaData", + "kind", "empty" + }); + + addXSDMapping + ((Property)typeMetaDataType.getProperties().get(TypeMetaDataImpl.LOCATION), + new String[] + { + "kind", "attribute", + "name", "location" + }); + + addXSDMapping + (xsdMetaDataType, + new String[] + { + "name", "XSDMetaData", + "kind", "empty" + }); + + addXSDMapping + ((Property)xsdMetaDataType.getProperties().get(XSDMetaDataImpl.LOCATION), + new String[] + { + "kind", "attribute", + "name", "location" + }); + + } + +} //MetadataFactoryImpl diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java new file mode 100644 index 0000000000..43746399fc --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java @@ -0,0 +1,285 @@ +/** + * + * 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.metadata.impl; + +import commonj.sdo.Type; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.metadata.JavaMetaData; +import org.apache.tuscany.sdo.util.metadata.MetadataFactory; +import org.apache.tuscany.sdo.util.metadata.SDOMetaDataGroup; +import org.apache.tuscany.sdo.util.metadata.TypeMetaData; +import org.apache.tuscany.sdo.util.metadata.XSDMetaData; + +/** + * + * An implementation of the model object 'SDO Meta Data Group'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class SDOMetaDataGroupImpl extends DataObjectBase implements SDOMetaDataGroup +{ + /** + * The feature id for the 'Java Meta Data' containment reference list. + * + * + * @generated + * @ordered + */ + public final static int JAVA_META_DATA = 0; + + /** + * The feature id for the 'Xsd Meta Data' containment reference list. + * + * + * @generated + * @ordered + */ + public final static int XSD_META_DATA = 1; + + /** + * The feature id for the 'Type Meta Data' containment reference list. + * + * + * @generated + * @ordered + */ + public final static int TYPE_META_DATA = 2; + + /** + * This represents the number of properties for this type. + * + * + * @generated + * @ordered + */ + + public final static int SDO_PROPERTY_COUNT = 3; + + /** + * The cached value of the '{@link #getJavaMetaData() Java Meta Data}' containment reference list. + * + * + * @see #getJavaMetaData() + * @generated + * @ordered + */ + + protected List javaMetaData = null; + + /** + * The cached value of the '{@link #getXsdMetaData() Xsd Meta Data}' containment reference list. + * + * + * @see #getXsdMetaData() + * @generated + * @ordered + */ + + protected List xsdMetaData = null; + + /** + * The cached value of the '{@link #getTypeMetaData() Type Meta Data}' containment reference list. + * + * + * @see #getTypeMetaData() + * @generated + * @ordered + */ + + protected List typeMetaData = null; + + /** + * + * + * @generated + */ + protected SDOMetaDataGroupImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getStaticType() + { + return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getSDOMetaDataGroup(); + } + + /** + * + * + * @generated + */ + public List getJavaMetaData() + { + if (javaMetaData == null) + { + javaMetaData = createPropertyList(ListKind.CONTAINMENT, JavaMetaData.class, JAVA_META_DATA); + } + return javaMetaData; + } + /** + * + * + * @generated + */ + public List getXsdMetaData() + { + if (xsdMetaData == null) + { + xsdMetaData = createPropertyList(ListKind.CONTAINMENT, XSDMetaData.class, XSD_META_DATA); + } + return xsdMetaData; + } + /** + * + * + * @generated + */ + public List getTypeMetaData() + { + if (typeMetaData == null) + { + typeMetaData = createPropertyList(ListKind.CONTAINMENT, TypeMetaData.class, TYPE_META_DATA); + } + return typeMetaData; + } + /** + * + * + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case JAVA_META_DATA: + return removeFromList(getJavaMetaData(), otherEnd, changeContext); + case XSD_META_DATA: + return removeFromList(getXsdMetaData(), otherEnd, changeContext); + case TYPE_META_DATA: + return removeFromList(getTypeMetaData(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case JAVA_META_DATA: + return getJavaMetaData(); + case XSD_META_DATA: + return getXsdMetaData(); + case TYPE_META_DATA: + return getTypeMetaData(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case JAVA_META_DATA: + getJavaMetaData().clear(); + getJavaMetaData().addAll((Collection)newValue); + return; + case XSD_META_DATA: + getXsdMetaData().clear(); + getXsdMetaData().addAll((Collection)newValue); + return; + case TYPE_META_DATA: + getTypeMetaData().clear(); + getTypeMetaData().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case JAVA_META_DATA: + getJavaMetaData().clear(); + return; + case XSD_META_DATA: + getXsdMetaData().clear(); + return; + case TYPE_META_DATA: + getTypeMetaData().clear(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case JAVA_META_DATA: + return javaMetaData != null && !javaMetaData.isEmpty(); + case XSD_META_DATA: + return xsdMetaData != null && !xsdMetaData.isEmpty(); + case TYPE_META_DATA: + return typeMetaData != null && !typeMetaData.isEmpty(); + } + return super.isSet(propertyIndex); + } + +} //SDOMetaDataGroupImpl diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java new file mode 100644 index 0000000000..66d7f8625f --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java @@ -0,0 +1,203 @@ +/** + * + * 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.metadata.impl; + +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.metadata.MetadataFactory; +import org.apache.tuscany.sdo.util.metadata.TypeMetaData; + +/** + * + * An implementation of the model object 'Type Meta Data'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class TypeMetaDataImpl extends DataObjectBase implements TypeMetaData +{ + /** + * The feature id for the 'Location' attribute. + * + * + * @generated + * @ordered + */ + public final static int LOCATION = 0; + + /** + * This represents the number of properties for this type. + * + * + * @generated + * @ordered + */ + + public final static int SDO_PROPERTY_COUNT = 1; + + /** + * The default value of the '{@link #getLocation() Location}' attribute. + * + * + * @see #getLocation() + * @generated + * @ordered + */ + protected static final String LOCATION_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getLocation() Location}' attribute. + * + * + * @see #getLocation() + * @generated + * @ordered + */ + protected String location = LOCATION_DEFAULT_; + + /** + * + * + * @generated + */ + protected TypeMetaDataImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getStaticType() + { + return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getTypeMetaData(); + } + + /** + * + * + * @generated + */ + public String getLocation() + { + return location; + } + /** + * + * + * @generated + */ + public void setLocation(String newLocation) + { + String oldLocation = location; + location = newLocation; + if (isNotifying()) + notify(ChangeKind.SET, LOCATION, oldLocation, location); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case LOCATION: + return getLocation(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case LOCATION: + setLocation((String)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case LOCATION: + setLocation(LOCATION_DEFAULT_); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case LOCATION: + return LOCATION_DEFAULT_ == null ? location != null : !LOCATION_DEFAULT_.equals(location); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (location: "); + result.append(location); + result.append(')'); + return result.toString(); + } + +} //TypeMetaDataImpl diff --git a/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java new file mode 100644 index 0000000000..7a04d6b99c --- /dev/null +++ b/sdo-java/tags/1.1/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java @@ -0,0 +1,203 @@ +/** + * + * 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.metadata.impl; + +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.metadata.MetadataFactory; +import org.apache.tuscany.sdo.util.metadata.XSDMetaData; + +/** + * + * An implementation of the model object 'XSD Meta Data'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class XSDMetaDataImpl extends DataObjectBase implements XSDMetaData +{ + /** + * The feature id for the 'Location' attribute. + * + * + * @generated + * @ordered + */ + public final static int LOCATION = 0; + + /** + * This represents the number of properties for this type. + * + * + * @generated + * @ordered + */ + + public final static int SDO_PROPERTY_COUNT = 1; + + /** + * The default value of the '{@link #getLocation() Location}' attribute. + * + * + * @see #getLocation() + * @generated + * @ordered + */ + protected static final String LOCATION_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getLocation() Location}' attribute. + * + * + * @see #getLocation() + * @generated + * @ordered + */ + protected String location = LOCATION_DEFAULT_; + + /** + * + * + * @generated + */ + protected XSDMetaDataImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getStaticType() + { + return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getXSDMetaData(); + } + + /** + * + * + * @generated + */ + public String getLocation() + { + return location; + } + /** + * + * + * @generated + */ + public void setLocation(String newLocation) + { + String oldLocation = location; + location = newLocation; + if (isNotifying()) + notify(ChangeKind.SET, LOCATION, oldLocation, location); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case LOCATION: + return getLocation(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case LOCATION: + setLocation((String)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case LOCATION: + setLocation(LOCATION_DEFAULT_); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case LOCATION: + return LOCATION_DEFAULT_ == null ? location != null : !LOCATION_DEFAULT_.equals(location); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (location: "); + result.append(location); + result.append(')'); + return result.toString(); + } + +} //XSDMetaDataImpl -- cgit v1.2.3