diff --git a/commons/src/main/java/org/soluvas/commons/CommonsException.java b/commons/src/main/java/org/soluvas/commons/CommonsException.java index e7e8ddbed..81e548843 100644 --- a/commons/src/main/java/org/soluvas/commons/CommonsException.java +++ b/commons/src/main/java/org/soluvas/commons/CommonsException.java @@ -11,7 +11,6 @@ public class CommonsException extends RuntimeException { * */ public CommonsException() { - // TODO Auto-generated constructor stub } /** @@ -19,7 +18,6 @@ public CommonsException() { */ public CommonsException(String message) { super(message); - // TODO Auto-generated constructor stub } /** @@ -27,7 +25,6 @@ public CommonsException(String message) { */ public CommonsException(Throwable cause) { super(cause); - // TODO Auto-generated constructor stub } /** @@ -36,7 +33,14 @@ public CommonsException(Throwable cause) { */ public CommonsException(String message, Throwable cause) { super(message, cause); - // TODO Auto-generated constructor stub + } + + /** + * @param message + * @param cause + */ + public CommonsException(Throwable cause, String message, Object... args) { + super(String.format(message, args), cause); } } diff --git a/commons/src/main/java/org/soluvas/commons/CommonsPackage.java b/commons/src/main/java/org/soluvas/commons/CommonsPackage.java index 4068cb279..bcba2d32c 100644 --- a/commons/src/main/java/org/soluvas/commons/CommonsPackage.java +++ b/commons/src/main/java/org/soluvas/commons/CommonsPackage.java @@ -1601,7 +1601,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getUnit() * @generated */ - int UNIT = 40; + int UNIT = 41; /** @@ -1612,7 +1612,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getList() * @generated */ - int LIST = 41; + int LIST = 42; /** * The meta object id for the 'Map' data type. @@ -1622,7 +1622,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getMap() * @generated */ - int MAP = 42; + int MAP = 43; /** * The meta object id for the 'Set' data type. @@ -1632,7 +1632,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getSet() * @generated */ - int SET = 43; + int SET = 44; /** * The meta object id for the 'Collection' data type. @@ -1642,7 +1642,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getCollection() * @generated */ - int COLLECTION = 44; + int COLLECTION = 45; /** * The meta object id for the 'Multimap' data type. @@ -1652,7 +1652,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getMultimap() * @generated */ - int MULTIMAP = 45; + int MULTIMAP = 46; /** * The meta object id for the 'Navigable Map' data type. @@ -1662,7 +1662,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getNavigableMap() * @generated */ - int NAVIGABLE_MAP = 46; + int NAVIGABLE_MAP = 47; /** * The meta object id for the 'Queue' data type. @@ -1672,7 +1672,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getQueue() * @generated */ - int QUEUE = 47; + int QUEUE = 48; /** * The meta object id for the 'Multiset' data type. @@ -1682,7 +1682,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getMultiset() * @generated */ - int MULTISET = 48; + int MULTISET = 49; /** @@ -1693,7 +1693,7 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getSerializable() * @generated */ - int SERIALIZABLE = 49; + int SERIALIZABLE = 50; /** @@ -1704,7 +1704,49 @@ public interface CommonsPackage extends EPackage { * @see org.soluvas.commons.impl.CommonsPackageImpl#getBundle() * @generated */ - int BUNDLE = 50; + int BUNDLE = 51; + + + /** + * The meta object id for the 'Big Money Provider' data type. + * + * + * @see org.joda.money.BigMoneyProvider + * @see org.soluvas.commons.impl.CommonsPackageImpl#getBigMoneyProvider() + * @generated + */ + int BIG_MONEY_PROVIDER = 52; + + /** + * The meta object id for the 'Quantity' data type. + * + * + * @see javax.measure.quantity.Quantity + * @see org.soluvas.commons.impl.CommonsPackageImpl#getQuantity() + * @generated + */ + int QUANTITY = 40; + + /** + * The meta object id for the 'Measurable' data type. + * + * + * @see javax.measure.Measurable + * @see org.soluvas.commons.impl.CommonsPackageImpl#getMeasurable() + * @generated + */ + int MEASURABLE = 53; + + + /** + * The meta object id for the 'Big Decimal' data type. + * + * + * @see java.math.BigDecimal + * @see org.soluvas.commons.impl.CommonsPackageImpl#getBigDecimal() + * @generated + */ + int BIG_DECIMAL = 54; /** @@ -2654,7 +2696,7 @@ public interface CommonsPackage extends EPackage { * * @return the meta object for data type 'Unit'. * @see javax.measure.unit.Unit - * @model instanceClass="javax.measure.unit.Unit" + * @model instanceClass="javax.measure.unit.Unit" typeParameters="Q" QBounds="org.soluvas.commons.Quantity" * @generated */ EDataType getUnit(); @@ -2769,6 +2811,50 @@ public interface CommonsPackage extends EPackage { */ EDataType getBundle(); + /** + * Returns the meta object for data type '{@link org.joda.money.BigMoneyProvider Big Money Provider}'. + * + * + * @return the meta object for data type 'Big Money Provider'. + * @see org.joda.money.BigMoneyProvider + * @model instanceClass="org.joda.money.BigMoneyProvider" + * @generated + */ + EDataType getBigMoneyProvider(); + + /** + * Returns the meta object for data type '{@link javax.measure.quantity.Quantity Quantity}'. + * + * + * @return the meta object for data type 'Quantity'. + * @see javax.measure.quantity.Quantity + * @model instanceClass="javax.measure.quantity.Quantity" + * @generated + */ + EDataType getQuantity(); + + /** + * Returns the meta object for data type '{@link javax.measure.Measurable Measurable}'. + * + * + * @return the meta object for data type 'Measurable'. + * @see javax.measure.Measurable + * @model instanceClass="javax.measure.Measurable" typeParameters="Q" QBounds="org.soluvas.commons.Quantity" + * @generated + */ + EDataType getMeasurable(); + + /** + * Returns the meta object for data type '{@link java.math.BigDecimal Big Decimal}'. + * + * + * @return the meta object for data type 'Big Decimal'. + * @see java.math.BigDecimal + * @model instanceClass="java.math.BigDecimal" + * @generated + */ + EDataType getBigDecimal(); + /** * Returns the factory that creates the instances of the model. * @@ -3693,6 +3779,46 @@ interface Literals { */ EDataType BUNDLE = eINSTANCE.getBundle(); + /** + * The meta object literal for the 'Big Money Provider' data type. + * + * + * @see org.joda.money.BigMoneyProvider + * @see org.soluvas.commons.impl.CommonsPackageImpl#getBigMoneyProvider() + * @generated + */ + EDataType BIG_MONEY_PROVIDER = eINSTANCE.getBigMoneyProvider(); + + /** + * The meta object literal for the 'Quantity' data type. + * + * + * @see javax.measure.quantity.Quantity + * @see org.soluvas.commons.impl.CommonsPackageImpl#getQuantity() + * @generated + */ + EDataType QUANTITY = eINSTANCE.getQuantity(); + + /** + * The meta object literal for the 'Measurable' data type. + * + * + * @see javax.measure.Measurable + * @see org.soluvas.commons.impl.CommonsPackageImpl#getMeasurable() + * @generated + */ + EDataType MEASURABLE = eINSTANCE.getMeasurable(); + + /** + * The meta object literal for the 'Big Decimal' data type. + * + * + * @see java.math.BigDecimal + * @see org.soluvas.commons.impl.CommonsPackageImpl#getBigDecimal() + * @generated + */ + EDataType BIG_DECIMAL = eINSTANCE.getBigDecimal(); + } } //CommonsPackage diff --git a/commons/src/main/java/org/soluvas/commons/EmfUtils.java b/commons/src/main/java/org/soluvas/commons/EmfUtils.java index 106c52a82..46d898b3f 100644 --- a/commons/src/main/java/org/soluvas/commons/EmfUtils.java +++ b/commons/src/main/java/org/soluvas/commons/EmfUtils.java @@ -27,12 +27,12 @@ public class EmfUtils { public static EPackage getEPackage(Class pkg) { try { - Field eInstanceField = pkg.getDeclaredField("eINSTANCE"); - EPackage ePackage = (EPackage) eInstanceField.get(pkg); + final Field eInstanceField = pkg.getDeclaredField("eINSTANCE"); + final EPackage ePackage = (EPackage) eInstanceField.get(pkg); return ePackage; } catch (Exception e) { - Throwables.propagate(e); - return null; + throw new CommonsException(e, "Cannot get EPackage for %s", + pkg.getName()); } } diff --git a/commons/src/main/java/org/soluvas/commons/impl/CommonsFactoryImpl.java b/commons/src/main/java/org/soluvas/commons/impl/CommonsFactoryImpl.java index 4f2dd1a51..2275b14c3 100644 --- a/commons/src/main/java/org/soluvas/commons/impl/CommonsFactoryImpl.java +++ b/commons/src/main/java/org/soluvas/commons/impl/CommonsFactoryImpl.java @@ -3,6 +3,7 @@ package org.soluvas.commons.impl; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Collection; import java.util.List; import java.util.Map; @@ -10,6 +11,8 @@ import java.util.Queue; import java.util.Set; +import javax.measure.Measurable; +import javax.measure.quantity.Quantity; import javax.measure.unit.Unit; import org.eclipse.emf.ecore.EClass; @@ -18,15 +21,16 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.joda.money.BigMoneyProvider; import org.joda.money.CurrencyUnit; import org.joda.time.DateTime; -import org.soluvas.commons.*; import org.soluvas.commons.Added; import org.soluvas.commons.AddedMany; import org.soluvas.commons.AppManifest; import org.soluvas.commons.AttributeNotification; import org.soluvas.commons.AttributeSet; import org.soluvas.commons.AttributeUnset; +import org.soluvas.commons.CategoryInfo; import org.soluvas.commons.CommonsFactory; import org.soluvas.commons.CommonsPackage; import org.soluvas.commons.EClassStatus; @@ -85,17 +89,17 @@ public CommonsFactoryImpl() { @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { - case CommonsPackage.APP_MANIFEST: return (EObject)createAppManifest(); - case CommonsPackage.PERSON_INFO: return (EObject)createPersonInfo(); - case CommonsPackage.WEB_ADDRESS: return (EObject)createWebAddress(); - case CommonsPackage.ADDED: return (EObject)createAdded(); - case CommonsPackage.ATTRIBUTE_SET: return (EObject)createAttributeSet(); - case CommonsPackage.ATTRIBUTE_UNSET: return (EObject)createAttributeUnset(); - case CommonsPackage.REMOVED: return (EObject)createRemoved(); - case CommonsPackage.ATTRIBUTE_NOTIFICATION: return (EObject)createAttributeNotification(); - case CommonsPackage.ADDED_MANY: return (EObject)createAddedMany(); - case CommonsPackage.REMOVED_MANY: return (EObject)createRemovedMany(); - case CommonsPackage.CATEGORY_INFO: return (EObject)createCategoryInfo(); + case CommonsPackage.APP_MANIFEST: return createAppManifest(); + case CommonsPackage.PERSON_INFO: return createPersonInfo(); + case CommonsPackage.WEB_ADDRESS: return createWebAddress(); + case CommonsPackage.ADDED: return createAdded(); + case CommonsPackage.ATTRIBUTE_SET: return createAttributeSet(); + case CommonsPackage.ATTRIBUTE_UNSET: return createAttributeUnset(); + case CommonsPackage.REMOVED: return createRemoved(); + case CommonsPackage.ATTRIBUTE_NOTIFICATION: return createAttributeNotification(); + case CommonsPackage.ADDED_MANY: return createAddedMany(); + case CommonsPackage.REMOVED_MANY: return createRemovedMany(); + case CommonsPackage.CATEGORY_INFO: return createCategoryInfo(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -121,6 +125,8 @@ public Object createFromString(EDataType eDataType, String initialValue) { return createDateTimeFromString(eDataType, initialValue); case CommonsPackage.CURRENCY_UNIT: return createCurrencyUnitFromString(eDataType, initialValue); + case CommonsPackage.QUANTITY: + return createQuantityFromString(eDataType, initialValue); case CommonsPackage.UNIT: return createUnitFromString(eDataType, initialValue); case CommonsPackage.LIST: @@ -141,6 +147,12 @@ public Object createFromString(EDataType eDataType, String initialValue) { return createMultisetFromString(eDataType, initialValue); case CommonsPackage.SERIALIZABLE: return createSerializableFromString(eDataType, initialValue); + case CommonsPackage.BIG_MONEY_PROVIDER: + return createBigMoneyProviderFromString(eDataType, initialValue); + case CommonsPackage.MEASURABLE: + return createMeasurableFromString(eDataType, initialValue); + case CommonsPackage.BIG_DECIMAL: + return createBigDecimalFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } @@ -166,6 +178,8 @@ public String convertToString(EDataType eDataType, Object instanceValue) { return convertDateTimeToString(eDataType, instanceValue); case CommonsPackage.CURRENCY_UNIT: return convertCurrencyUnitToString(eDataType, instanceValue); + case CommonsPackage.QUANTITY: + return convertQuantityToString(eDataType, instanceValue); case CommonsPackage.UNIT: return convertUnitToString(eDataType, instanceValue); case CommonsPackage.LIST: @@ -186,6 +200,12 @@ public String convertToString(EDataType eDataType, Object instanceValue) { return convertMultisetToString(eDataType, instanceValue); case CommonsPackage.SERIALIZABLE: return convertSerializableToString(eDataType, instanceValue); + case CommonsPackage.BIG_MONEY_PROVIDER: + return convertBigMoneyProviderToString(eDataType, instanceValue); + case CommonsPackage.MEASURABLE: + return convertMeasurableToString(eDataType, instanceValue); + case CommonsPackage.BIG_DECIMAL: + return convertBigDecimalToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } @@ -312,6 +332,7 @@ public RemovedMany createRemovedMany() { * * @generated */ + @Override public CategoryInfo createCategoryInfo() { CategoryInfoImpl categoryInfo = new CategoryInfoImpl(); return categoryInfo; @@ -436,19 +457,17 @@ public String convertCurrencyUnitToString(EDataType eDataType, Object instanceVa /** * * - * @generated */ - public Unit createUnitFromString(EDataType eDataType, String initialValue) { - return (Unit)super.createFromString(eDataType, initialValue); + public Unit createUnitFromString(EDataType eDataType, String initialValue) { + return initialValue != null ? (Unit)Unit.valueOf(initialValue) : null; } /** * * - * @generated */ public String convertUnitToString(EDataType eDataType, Object instanceValue) { - return super.convertToString(eDataType, instanceValue); + return instanceValue != null ? instanceValue.toString() : null; } /** @@ -613,6 +632,76 @@ public String convertSerializableToString(EDataType eDataType, Object instanceVa return super.convertToString(eDataType, instanceValue); } + /** + * + * + * @generated + */ + public BigMoneyProvider createBigMoneyProviderFromString(EDataType eDataType, String initialValue) { + return (BigMoneyProvider)super.createFromString(eDataType, initialValue); + } + + /** + * + * + * @generated + */ + public String convertBigMoneyProviderToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(eDataType, instanceValue); + } + + /** + * + * + * @generated + */ + public Quantity createQuantityFromString(EDataType eDataType, String initialValue) { + return (Quantity)super.createFromString(eDataType, initialValue); + } + + /** + * + * + * @generated + */ + public String convertQuantityToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(eDataType, instanceValue); + } + + /** + * + * + * @generated + */ + public Measurable createMeasurableFromString(EDataType eDataType, String initialValue) { + return (Measurable)super.createFromString(initialValue); + } + + /** + * + * + * @generated + */ + public String convertMeasurableToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(instanceValue); + } + + /** + * + * + */ + public BigDecimal createBigDecimalFromString(EDataType eDataType, String initialValue) { + return initialValue != null ? new BigDecimal(initialValue) : null; + } + + /** + * + * + */ + public String convertBigDecimalToString(EDataType eDataType, Object instanceValue) { + return instanceValue != null ? instanceValue.toString() : null; + } + /** * * diff --git a/commons/src/main/java/org/soluvas/commons/impl/CommonsPackageImpl.java b/commons/src/main/java/org/soluvas/commons/impl/CommonsPackageImpl.java index b3b657abd..a0533af1a 100644 --- a/commons/src/main/java/org/soluvas/commons/impl/CommonsPackageImpl.java +++ b/commons/src/main/java/org/soluvas/commons/impl/CommonsPackageImpl.java @@ -3,6 +3,7 @@ package org.soluvas.commons.impl; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Collection; import java.util.List; import java.util.Map; @@ -10,6 +11,8 @@ import java.util.Queue; import java.util.Set; +import javax.measure.Measurable; +import javax.measure.quantity.Quantity; import javax.measure.unit.Unit; import org.eclipse.emf.ecore.EAttribute; @@ -23,6 +26,7 @@ import org.eclipse.emf.ecore.ETypeParameter; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.joda.money.BigMoneyProvider; import org.joda.money.CurrencyUnit; import org.joda.time.DateTime; import org.osgi.framework.Bundle; @@ -434,6 +438,34 @@ public class CommonsPackageImpl extends EPackageImpl implements CommonsPackage { */ private EDataType bundleEDataType = null; + /** + * + * + * @generated + */ + private EDataType bigMoneyProviderEDataType = null; + + /** + * + * + * @generated + */ + private EDataType quantityEDataType = null; + + /** + * + * + * @generated + */ + private EDataType measurableEDataType = null; + + /** + * + * + * @generated + */ + private EDataType bigDecimalEDataType = null; + /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -1452,6 +1484,42 @@ public EDataType getBundle() { return bundleEDataType; } + /** + * + * + * @generated + */ + public EDataType getBigMoneyProvider() { + return bigMoneyProviderEDataType; + } + + /** + * + * + * @generated + */ + public EDataType getQuantity() { + return quantityEDataType; + } + + /** + * + * + * @generated + */ + public EDataType getMeasurable() { + return measurableEDataType; + } + + /** + * + * + * @generated + */ + public EDataType getBigDecimal() { + return bigDecimalEDataType; + } + /** * * @@ -1607,6 +1675,7 @@ public void createPackageContents() { // Create data types dateTimeEDataType = createEDataType(DATE_TIME); currencyUnitEDataType = createEDataType(CURRENCY_UNIT); + quantityEDataType = createEDataType(QUANTITY); unitEDataType = createEDataType(UNIT); listEDataType = createEDataType(LIST); mapEDataType = createEDataType(MAP); @@ -1618,6 +1687,9 @@ public void createPackageContents() { multisetEDataType = createEDataType(MULTISET); serializableEDataType = createEDataType(SERIALIZABLE); bundleEDataType = createEDataType(BUNDLE); + bigMoneyProviderEDataType = createEDataType(BIG_MONEY_PROVIDER); + measurableEDataType = createEDataType(MEASURABLE); + bigDecimalEDataType = createEDataType(BIG_DECIMAL); } /** @@ -1664,6 +1736,7 @@ public void initializePackageContents() { ETypeParameter objectsNotificationEClass_T = addETypeParameter(objectsNotificationEClass, "T"); ETypeParameter eObjectLinkedEClass_T = addETypeParameter(eObjectLinkedEClass, "T"); ETypeParameter parentableEClass_P = addETypeParameter(parentableEClass, "P"); + ETypeParameter unitEDataType_Q = addETypeParameter(unitEDataType, "Q"); addETypeParameter(listEDataType, "T"); addETypeParameter(mapEDataType, "K"); addETypeParameter(mapEDataType, "V"); @@ -1675,6 +1748,7 @@ public void initializePackageContents() { addETypeParameter(navigableMapEDataType, "V"); addETypeParameter(queueEDataType, "T"); addETypeParameter(multisetEDataType, "T"); + ETypeParameter measurableEDataType_Q = addETypeParameter(measurableEDataType, "Q"); // Set bounds for type parameters EGenericType g1 = createEGenericType(this.getIdentifiable()); @@ -1701,6 +1775,10 @@ public void initializePackageContents() { objectsNotificationEClass_T.getEBounds().add(g1); g1 = createEGenericType(theEcorePackage.getEObject()); eObjectLinkedEClass_T.getEBounds().add(g1); + g1 = createEGenericType(this.getQuantity()); + unitEDataType_Q.getEBounds().add(g1); + g1 = createEGenericType(this.getQuantity()); + measurableEDataType_Q.getEBounds().add(g1); // Add supertypes to classes appManifestEClass.getESuperTypes().add(this.getPositionable()); @@ -1944,6 +2022,7 @@ public void initializePackageContents() { // Initialize data types initEDataType(dateTimeEDataType, DateTime.class, "DateTime", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(currencyUnitEDataType, CurrencyUnit.class, "CurrencyUnit", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(quantityEDataType, Quantity.class, "Quantity", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(unitEDataType, Unit.class, "Unit", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(listEDataType, List.class, "List", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(mapEDataType, Map.class, "Map", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); @@ -1955,6 +2034,9 @@ public void initializePackageContents() { initEDataType(multisetEDataType, Multiset.class, "Multiset", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(serializableEDataType, Serializable.class, "Serializable", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(bundleEDataType, Bundle.class, "Bundle", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(bigMoneyProviderEDataType, BigMoneyProvider.class, "BigMoneyProvider", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(measurableEDataType, Measurable.class, "Measurable", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(bigDecimalEDataType, BigDecimal.class, "BigDecimal", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); diff --git a/commons/src/main/java/org/soluvas/commons/tenant/TenantUtils.java b/commons/src/main/java/org/soluvas/commons/tenant/TenantUtils.java index 7a75bb440..9442807a6 100644 --- a/commons/src/main/java/org/soluvas/commons/tenant/TenantUtils.java +++ b/commons/src/main/java/org/soluvas/commons/tenant/TenantUtils.java @@ -16,6 +16,7 @@ import com.google.common.base.Function; import com.google.common.base.Optional; +import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.base.Supplier; @@ -118,7 +119,9 @@ public static T getSupplied(BundleContext bundleContext, TenantRef tenant, @ * @return */ public static TenantRef getTenant(@Nonnull final CommandSession session) { - final BundleContext bundleContext = FrameworkUtil.getBundle(TenantUtils.class).getBundleContext(); + final BundleContext bundleContext = Preconditions.checkNotNull( + FrameworkUtil.getBundle(TenantUtils.class).getBundleContext(), + "Cannot get bundleContext for %s", TenantUtils.class.getName()); final ServiceReference serviceLookupRef = bundleContext.getServiceReference(ServiceLookup.class); final ServiceLookup svcLookup = bundleContext.getService(serviceLookupRef); try { diff --git a/commons/src/main/resources/org/soluvas/commons/commons.ecore b/commons/src/main/resources/org/soluvas/commons/commons.ecore index 4f6107b92..dcb61e5c4 100644 --- a/commons/src/main/resources/org/soluvas/commons/commons.ecore +++ b/commons/src/main/resources/org/soluvas/commons/commons.ecore @@ -55,7 +55,12 @@ - + + + + + +
@@ -503,4 +508,11 @@ + + + + + + + diff --git a/commons/src/main/resources/org/soluvas/commons/commons.ecorediag b/commons/src/main/resources/org/soluvas/commons/commons.ecorediag index 490cbd696..c0f8c41ee 100644 --- a/commons/src/main/resources/org/soluvas/commons/commons.ecorediag +++ b/commons/src/main/resources/org/soluvas/commons/commons.ecorediag @@ -26,7 +26,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -85,7 +85,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -124,7 +124,7 @@ - + @@ -148,35 +148,35 @@ - + - + - + - + - + @@ -196,7 +196,7 @@ - + @@ -216,7 +216,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -256,7 +256,7 @@ - + @@ -276,7 +276,7 @@ - + @@ -296,14 +296,14 @@ - + - + @@ -323,14 +323,14 @@ - + - + @@ -346,7 +346,7 @@ - + @@ -374,7 +374,7 @@ - + @@ -406,7 +406,7 @@ - + @@ -417,7 +417,7 @@ - + @@ -428,7 +428,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -483,7 +483,7 @@ - + @@ -502,7 +502,7 @@ - + @@ -518,7 +518,7 @@ - + @@ -534,7 +534,7 @@ - + @@ -550,7 +550,7 @@ - + @@ -566,7 +566,7 @@ - + @@ -582,7 +582,7 @@ - + @@ -598,7 +598,7 @@ - + @@ -614,7 +614,7 @@ - + @@ -634,7 +634,7 @@ - + @@ -662,7 +662,7 @@ - + @@ -681,7 +681,7 @@ - + @@ -700,7 +700,7 @@ - + @@ -716,7 +716,7 @@ - + @@ -732,7 +732,7 @@ - + @@ -752,7 +752,7 @@ - + @@ -772,7 +772,7 @@ - + @@ -788,7 +788,7 @@ - + @@ -804,7 +804,7 @@ - + @@ -820,7 +820,28 @@ - + + + + + + + + + + + + + + + + + + + + + + @@ -852,9 +873,9 @@ - + - + @@ -884,7 +905,7 @@ - + @@ -1036,7 +1057,7 @@ - + @@ -1076,9 +1097,9 @@ - + - + diff --git a/data/pom.xml b/data/pom.xml index f01c2dd3b..c734f0b96 100644 --- a/data/pom.xml +++ b/data/pom.xml @@ -22,6 +22,10 @@ org.soluvas.json + + org.osgi + org.osgi.core + org.neo4j neo4j-cypher diff --git a/data/src/main/java/org/soluvas/data/AttributeSemantic.java b/data/src/main/java/org/soluvas/data/AttributeSemantic.java new file mode 100644 index 000000000..2736ae73a --- /dev/null +++ b/data/src/main/java/org/soluvas/data/AttributeSemantic.java @@ -0,0 +1,289 @@ +/** + */ +package org.soluvas.data; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Attribute Semantic', + * and utility methods for working with them. + * + * @see org.soluvas.data.DataPackage#getAttributeSemantic() + * @model + * @generated + */ +public enum AttributeSemantic implements Enumerator { + /** + * The 'Equal' literal object. + * + * + * @see #EQUAL_VALUE + * @generated + * @ordered + */ + EQUAL(0, "equal", "equal"), + + /** + * The 'Less than' literal object. + * + * + * @see #LESS_THAN_VALUE + * @generated + * @ordered + */ + LESS_THAN(1, "less_than", "less_than"), + + /** + * The 'Less than or equal' literal object. + * + * + * @see #LESS_THAN_OR_EQUAL_VALUE + * @generated + * @ordered + */ + LESS_THAN_OR_EQUAL(2, "less_than_or_equal", "lessThanOrEqual"), + + /** + * The 'Greater than' literal object. + * + * + * @see #GREATER_THAN_VALUE + * @generated + * @ordered + */ + GREATER_THAN(3, "greater_than", "greater_than"), + + /** + * The 'Greater than or equal' literal object. + * + * + * @see #GREATER_THAN_OR_EQUAL_VALUE + * @generated + * @ordered + */ + GREATER_THAN_OR_EQUAL(4, "greater_than_or_equal", "equalOrGreaterThan"); + + /** + * The 'Equal' literal value. + * + *

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

+ * + * @see #EQUAL + * @model name="equal" + * @generated + * @ordered + */ + public static final int EQUAL_VALUE = 0; + + /** + * The 'Less than' literal value. + * + *

+ * If the meaning of 'Less than' literal object isn't clear, + * there really should be more of a description here... + *

+ * + * @see #LESS_THAN + * @model name="less_than" + * @generated + * @ordered + */ + public static final int LESS_THAN_VALUE = 1; + + /** + * The 'Less than or equal' literal value. + * + *

+ * If the meaning of 'Less than or equal' literal object isn't clear, + * there really should be more of a description here... + *

+ * + * @see #LESS_THAN_OR_EQUAL + * @model name="less_than_or_equal" literal="lessThanOrEqual" + * @generated + * @ordered + */ + public static final int LESS_THAN_OR_EQUAL_VALUE = 2; + + /** + * The 'Greater than' literal value. + * + *

+ * If the meaning of 'Greater than' literal object isn't clear, + * there really should be more of a description here... + *

+ * + * @see #GREATER_THAN + * @model name="greater_than" + * @generated + * @ordered + */ + public static final int GREATER_THAN_VALUE = 3; + + /** + * The 'Greater than or equal' literal value. + * + *

+ * If the meaning of 'Greater than or equal' literal object isn't clear, + * there really should be more of a description here... + *

+ * + * @see #GREATER_THAN_OR_EQUAL + * @model name="greater_than_or_equal" literal="equalOrGreaterThan" + * @generated + * @ordered + */ + public static final int GREATER_THAN_OR_EQUAL_VALUE = 4; + + /** + * An array of all the 'Attribute Semantic' enumerators. + * + * + * @generated + */ + private static final AttributeSemantic[] VALUES_ARRAY = + new AttributeSemantic[] { + EQUAL, + LESS_THAN, + LESS_THAN_OR_EQUAL, + GREATER_THAN, + GREATER_THAN_OR_EQUAL, + }; + + /** + * A public read-only list of all the 'Attribute Semantic' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Attribute Semantic' literal with the specified literal value. + * + * + * @generated + */ + public static AttributeSemantic get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + AttributeSemantic result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Attribute Semantic' literal with the specified name. + * + * + * @generated + */ + public static AttributeSemantic getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + AttributeSemantic result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Attribute Semantic' literal with the specified integer value. + * + * + * @generated + */ + public static AttributeSemantic get(int value) { + switch (value) { + case EQUAL_VALUE: return EQUAL; + case LESS_THAN_VALUE: return LESS_THAN; + case LESS_THAN_OR_EQUAL_VALUE: return LESS_THAN_OR_EQUAL; + case GREATER_THAN_VALUE: return GREATER_THAN; + case GREATER_THAN_OR_EQUAL_VALUE: return GREATER_THAN_OR_EQUAL; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private AttributeSemantic(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //AttributeSemantic diff --git a/data/src/main/java/org/soluvas/data/AttributeType.java b/data/src/main/java/org/soluvas/data/AttributeType.java new file mode 100644 index 000000000..99ff23a08 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/AttributeType.java @@ -0,0 +1,200 @@ +/** + */ +package org.soluvas.data; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.NameContainer; +import org.soluvas.commons.NsPrefixable; +import org.soluvas.commons.ResourceAware; + +/** + * + * A representation of the model object 'Attribute Type'. + * + * + * + * EXPERIMENTAL. + * + * Two/three approaches: + * + * 1. Mixin must be statically designed into Ecore EClass, e.g. BerbatikBags, which inherits from BerbatikMixin (inherits ClothingMixin = SizeMixin + ColorMixin), BatikMixin, and BagsMixin. The upside is all attributes/references merge into the EObject. Downside is we need to permutate all combinations into EClass. + * Not sure yet how it goes with MongoDB, JSON, and XMI import/export. Not sure yet how it goes with VariedProduct, BundleProduct, SubscribedProduct, SharedProduct, etc. + * + * 2. Mixin is dynamic. Each product object maintain a list of MixinTypes (which is by default specified when the product is created), and filled mixins are put in an EList. Mixins can be added and removed during runtime, without any build-time project rebuild or EMF regeneration. + * So store owner, even staff, can define new mixin and manipulate existing products with ease. No Mall admin or schema changes required. + * Store staff can browse available mixin types and just add any mixin they want. + * Similar approach with Drupal taxonomy or JCR mixin. Magento is more restrictive because of its inflexible AttributeSet concept. Mixin is like AttributeSet but with cardinality 0..*. + * Probably need better name than mixin though. + * Seems to be most flexible, for Jackson we can have custom converter. My concern is MongoDB and XMI. + * Not sure yet how it goes with MongoDB, JSON, and XMI import/export. Not sure yet how it goes with VariedProduct, BundleProduct, SubscribedProduct, SharedProduct, etc. + * + * 3. Hybrid #1. Mixin is by default static, which hopefully covers 80% use case. + * When you want dynamic, you can add more mixins. + * But ain't this too complicated? + * On the web client side, it's also more work. Not to mention inventory, etc. integration with other systems. + * ProductInfo & principal etc. also use the fully dynamic approach. + * + * 4. Hybrid #2. Mixin is by default dynamic, which covers 80% of the customization. + * And for things like category, tag, color, size, they're static, with code support. i.e. must be generated by EMF. + * + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.AttributeType#getLabel Label}
  • + *
  • {@link org.soluvas.data.AttributeType#getMinValues Min Values}
  • + *
  • {@link org.soluvas.data.AttributeType#getMaxValues Max Values}
  • + *
  • {@link org.soluvas.data.AttributeType#getDataTypeName Data Type Name}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getAttributeType() + * @model interface="true" abstract="true" + * @generated + */ +public interface AttributeType extends NsPrefixable, NameContainer, ResourceAware, BundleAware { + /** + * Returns the value of the 'Label' attribute. + * + *

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

+ * + * @return the value of the 'Label' attribute. + * @see #setLabel(String) + * @see org.soluvas.data.DataPackage#getAttributeType_Label() + * @model + * @generated + */ + String getLabel(); + + /** + * Sets the value of the '{@link org.soluvas.data.AttributeType#getLabel Label}' attribute. + * + * + * @param value the new value of the 'Label' attribute. + * @see #getLabel() + * @generated + */ + void setLabel(String value); + + /** + * Returns the value of the 'Min Values' attribute. + * + * + * + * 0 means optional, 1 means required, and so on. + * + * @return the value of the 'Min Values' attribute. + * @see #setMinValues(long) + * @see org.soluvas.data.DataPackage#getAttributeType_MinValues() + * @model + * @generated + */ + long getMinValues(); + + /** + * Sets the value of the '{@link org.soluvas.data.AttributeType#getMinValues Min Values}' attribute. + * + * + * @param value the new value of the 'Min Values' attribute. + * @see #getMinValues() + * @generated + */ + void setMinValues(long value); + + /** + * Returns the value of the 'Max Values' attribute. + * + * + * + * 1 means singular. -1 means no maximum number of values. + * + * @return the value of the 'Max Values' attribute. + * @see #setMaxValues(long) + * @see org.soluvas.data.DataPackage#getAttributeType_MaxValues() + * @model + * @generated + */ + long getMaxValues(); + + /** + * Sets the value of the '{@link org.soluvas.data.AttributeType#getMaxValues Max Values}' attribute. + * + * + * @param value the new value of the 'Max Values' attribute. + * @see #getMaxValues() + * @generated + */ + void setMaxValues(long value); + + /** + * Returns the value of the 'Data Type Name' attribute. + * + *

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

+ * + * @return the value of the 'Data Type Name' attribute. + * @see #setDataTypeName(String) + * @see org.soluvas.data.DataPackage#getAttributeType_DataTypeName() + * @model + * @generated + */ + String getDataTypeName(); + + /** + * Sets the value of the '{@link org.soluvas.data.AttributeType#getDataTypeName Data Type Name}' attribute. + * + * + * @param value the new value of the 'Data Type Name' attribute. + * @see #getDataTypeName() + * @generated + */ + void setDataTypeName(String value); + + /** + * + * + * + * Convert the string value to a mixin instance. + * + * @model + * @generated + */ + Value valueOf(String stringValue); + + /** + * + * + * @model + * @generated + */ + Value create(); + + /** + * + * + * + * True if minValues > 0. + * + * @model kind="operation" + * @generated + */ + boolean isRequired(); + + /** + * + * + * + * true if maxValues is > 1. + * + * @model kind="operation" + * @generated + */ + boolean isMultiple(); + +} // AttributeType diff --git a/data/src/main/java/org/soluvas/data/CurrencyValue.java b/data/src/main/java/org/soluvas/data/CurrencyValue.java new file mode 100644 index 000000000..8efe983fc --- /dev/null +++ b/data/src/main/java/org/soluvas/data/CurrencyValue.java @@ -0,0 +1,56 @@ +/** + */ +package org.soluvas.data; + +import java.math.BigDecimal; + +import org.joda.money.CurrencyUnit; + +/** + * + * A representation of the model object 'Currency Value'. + * + * + * + * Mixin with monetary value and currency code. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.CurrencyValue#getCurrencyUnit Currency Unit}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getCurrencyValue() + * @model superTypes="org.soluvas.data.Value" + * @generated + */ +public interface CurrencyValue extends Value { + /** + * Returns the value of the 'Currency Unit' attribute. + * + *

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

+ * + * @return the value of the 'Currency Unit' attribute. + * @see #setCurrencyUnit(CurrencyUnit) + * @see org.soluvas.data.DataPackage#getCurrencyValue_CurrencyUnit() + * @model dataType="org.soluvas.commons.CurrencyUnit" + * @generated + */ + CurrencyUnit getCurrencyUnit(); + + /** + * Sets the value of the '{@link org.soluvas.data.CurrencyValue#getCurrencyUnit Currency Unit}' attribute. + * + * + * @param value the new value of the 'Currency Unit' attribute. + * @see #getCurrencyUnit() + * @generated + */ + void setCurrencyUnit(CurrencyUnit value); + +} // CurrencyValue diff --git a/data/src/main/java/org/soluvas/data/DataCatalog.java b/data/src/main/java/org/soluvas/data/DataCatalog.java new file mode 100644 index 000000000..f2296dcda --- /dev/null +++ b/data/src/main/java/org/soluvas/data/DataCatalog.java @@ -0,0 +1,95 @@ +/** + */ +package org.soluvas.data; + +import org.eclipse.emf.common.util.EList; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.NameContainer; +import org.soluvas.commons.ResourceAware; + +/** + * + * A representation of the model object 'Catalog'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.DataCatalog#getVocabs Vocabs}
  • + *
  • {@link org.soluvas.data.DataCatalog#getMixins Mixins}
  • + *
  • {@link org.soluvas.data.DataCatalog#getTerms Terms}
  • + *
  • {@link org.soluvas.data.DataCatalog#getAttributeTypes Attribute Types}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getDataCatalog() + * @model extendedMetaData="name='DataCatalog'" + * @generated + */ +public interface DataCatalog extends BundleAware, ResourceAware, NameContainer { + /** + * Returns the value of the 'Vocabs' containment reference list. + * The list contents are of type {@link org.soluvas.data.Vocab}. + * + *

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

+ * + * @return the value of the 'Vocabs' containment reference list. + * @see org.soluvas.data.DataPackage#getDataCatalog_Vocabs() + * @model containment="true" + * @generated + */ + EList getVocabs(); + + /** + * Returns the value of the 'Mixins' containment reference list. + * The list contents are of type {@link org.soluvas.data.Mixin}. + * + *

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

+ * + * @return the value of the 'Mixins' containment reference list. + * @see org.soluvas.data.DataPackage#getDataCatalog_Mixins() + * @model containment="true" + * @generated + */ + EList getMixins(); + + /** + * Returns the value of the 'Terms' containment reference list. + * The list contents are of type {@link org.soluvas.data.Term}. + * + *

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

+ * + * @return the value of the 'Terms' containment reference list. + * @see org.soluvas.data.DataPackage#getDataCatalog_Terms() + * @model containment="true" + * @generated + */ + EList getTerms(); + + /** + * Returns the value of the 'Attribute Types' containment reference list. + * The list contents are of type {@link org.soluvas.data.AttributeType}. + * + *

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

+ * + * @return the value of the 'Attribute Types' containment reference list. + * @see org.soluvas.data.DataPackage#getDataCatalog_AttributeTypes() + * @model containment="true" + * @generated + */ + EList getAttributeTypes(); + +} // DataCatalog diff --git a/data/src/main/java/org/soluvas/data/DataFactory.java b/data/src/main/java/org/soluvas/data/DataFactory.java index 898028bfa..246b4a7cf 100644 --- a/data/src/main/java/org/soluvas/data/DataFactory.java +++ b/data/src/main/java/org/soluvas/data/DataFactory.java @@ -2,6 +2,7 @@ */ package org.soluvas.data; +import javax.measure.quantity.Quantity; import org.eclipse.emf.ecore.EFactory; /** @@ -21,6 +22,105 @@ public interface DataFactory extends EFactory { */ DataFactory eINSTANCE = org.soluvas.data.impl.DataFactoryImpl.init(); + /** + * Returns a new object of class 'Value'. + * + * + * @return a new object of class 'Value'. + * @generated + */ + Value createValue(); + + /** + * Returns a new object of class 'Measure Value'. + * + * + * @return a new object of class 'Measure Value'. + * @generated + */ + MeasureValue createMeasureValue(); + + /** + * Returns a new object of class 'Currency Value'. + * + * + * @return a new object of class 'Currency Value'. + * @generated + */ + CurrencyValue createCurrencyValue(); + + /** + * Returns a new object of class 'Mixin'. + * + * + * @return a new object of class 'Mixin'. + * @generated + */ + Mixin createMixin(); + + /** + * Returns a new object of class 'Range Value'. + * + * + * @return a new object of class 'Range Value'. + * @generated + */ + RangeValue createRangeValue(); + + /** + * Returns a new object of class 'Term Value'. + * + * + * @return a new object of class 'Term Value'. + * @generated + */ + TermValue createTermValue(); + + /** + * Returns a new object of class 'Term'. + * + * + * @return a new object of class 'Term'. + * @generated + */ + Term createTerm(); + + /** + * Returns a new object of class 'List Vocab'. + * + * + * @return a new object of class 'List Vocab'. + * @generated + */ + ListVocab createListVocab(); + + /** + * Returns a new object of class 'Tree Vocab'. + * + * + * @return a new object of class 'Tree Vocab'. + * @generated + */ + TreeVocab createTreeVocab(); + + /** + * Returns a new object of class 'Free Vocab'. + * + * + * @return a new object of class 'Free Vocab'. + * @generated + */ + FreeVocab createFreeVocab(); + + /** + * Returns a new object of class 'Catalog'. + * + * + * @return a new object of class 'Catalog'. + * @generated + */ + DataCatalog createDataCatalog(); + /** * Returns the package supported by this factory. * diff --git a/data/src/main/java/org/soluvas/data/DataPackage.java b/data/src/main/java/org/soluvas/data/DataPackage.java index 1eec569a1..334fbfd82 100644 --- a/data/src/main/java/org/soluvas/data/DataPackage.java +++ b/data/src/main/java/org/soluvas/data/DataPackage.java @@ -2,8 +2,13 @@ */ package org.soluvas.data; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.soluvas.commons.CommonsPackage; /** * @@ -53,36 +58,1461 @@ public interface DataPackage extends EPackage { */ DataPackage eINSTANCE = org.soluvas.data.impl.DataPackageImpl.init(); + /** + * The meta object id for the '{@link org.soluvas.data.AttributeType Attribute Type}' class. + * + * + * @see org.soluvas.data.AttributeType + * @see org.soluvas.data.impl.DataPackageImpl#getAttributeType() + * @generated + */ + int ATTRIBUTE_TYPE = 0; + + /** + * The feature id for the 'Ns Prefix' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__NS_PREFIX = CommonsPackage.NS_PREFIXABLE__NS_PREFIX; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__NAME = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Resource Type' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__RESOURCE_TYPE = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Resource Uri' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__RESOURCE_URI = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Resource Name' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__RESOURCE_NAME = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Bundle' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__BUNDLE = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Label' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__LABEL = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Min Values' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__MIN_VALUES = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Max Values' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__MAX_VALUES = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Data Type Name' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE__DATA_TYPE_NAME = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 8; + + /** + * The number of structural features of the 'Attribute Type' class. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_TYPE_FEATURE_COUNT = CommonsPackage.NS_PREFIXABLE_FEATURE_COUNT + 9; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.ValueImpl Value}' class. + * + * + * @see org.soluvas.data.impl.ValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getValue() + * @generated + */ + int VALUE = 1; + + /** + * The feature id for the 'Semantic' attribute. + * + * + * @generated + * @ordered + */ + int VALUE__SEMANTIC = 0; + + /** + * The feature id for the 'Display Value' attribute. + * + * + * @generated + * @ordered + */ + int VALUE__DISPLAY_VALUE = 1; + + /** + * The number of structural features of the 'Value' class. + * + * + * @generated + * @ordered + */ + int VALUE_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.MeasureValueImpl Measure Value}' class. + * + * + * @see org.soluvas.data.impl.MeasureValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getMeasureValue() + * @generated + */ + int MEASURE_VALUE = 2; + + /** + * The feature id for the 'Semantic' attribute. + * + * + * @generated + * @ordered + */ + int MEASURE_VALUE__SEMANTIC = VALUE__SEMANTIC; + + /** + * The feature id for the 'Display Value' attribute. + * + * + * @generated + * @ordered + */ + int MEASURE_VALUE__DISPLAY_VALUE = VALUE__DISPLAY_VALUE; + + /** + * The feature id for the 'Value Unit' attribute. + * + * + * @generated + * @ordered + */ + int MEASURE_VALUE__VALUE_UNIT = VALUE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int MEASURE_VALUE__VALUE = VALUE_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Measure Value' class. + * + * + * @generated + * @ordered + */ + int MEASURE_VALUE_FEATURE_COUNT = VALUE_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.CurrencyValueImpl Currency Value}' class. + * + * + * @see org.soluvas.data.impl.CurrencyValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getCurrencyValue() + * @generated + */ + int CURRENCY_VALUE = 3; + + /** + * The feature id for the 'Semantic' attribute. + * + * + * @generated + * @ordered + */ + int CURRENCY_VALUE__SEMANTIC = VALUE__SEMANTIC; + + /** + * The feature id for the 'Display Value' attribute. + * + * + * @generated + * @ordered + */ + int CURRENCY_VALUE__DISPLAY_VALUE = VALUE__DISPLAY_VALUE; + + /** + * The feature id for the 'Currency Unit' attribute. + * + * + * @generated + * @ordered + */ + int CURRENCY_VALUE__CURRENCY_UNIT = VALUE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Currency Value' class. + * + * + * @generated + * @ordered + */ + int CURRENCY_VALUE_FEATURE_COUNT = VALUE_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.MixinImpl Mixin}' class. + * + * + * @see org.soluvas.data.impl.MixinImpl + * @see org.soluvas.data.impl.DataPackageImpl#getMixin() + * @generated + */ + int MIXIN = 4; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int MIXIN__NAME = CommonsPackage.NAME_CONTAINER__NAME; + + /** + * The feature id for the 'Resource Type' attribute. + * + * + * @generated + * @ordered + */ + int MIXIN__RESOURCE_TYPE = CommonsPackage.NAME_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Resource Uri' attribute. + * + * + * @generated + * @ordered + */ + int MIXIN__RESOURCE_URI = CommonsPackage.NAME_CONTAINER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Resource Name' attribute. + * + * + * @generated + * @ordered + */ + int MIXIN__RESOURCE_NAME = CommonsPackage.NAME_CONTAINER_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Bundle' attribute. + * + * + * @generated + * @ordered + */ + int MIXIN__BUNDLE = CommonsPackage.NAME_CONTAINER_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Ns Prefix' attribute. + * + * + * @generated + * @ordered + */ + int MIXIN__NS_PREFIX = CommonsPackage.NAME_CONTAINER_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int MIXIN__DESCRIPTION = CommonsPackage.NAME_CONTAINER_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Attribute Types' reference list. + * + * + * @generated + * @ordered + */ + int MIXIN__ATTRIBUTE_TYPES = CommonsPackage.NAME_CONTAINER_FEATURE_COUNT + 6; + + /** + * The number of structural features of the 'Mixin' class. + * + * + * @generated + * @ordered + */ + int MIXIN_FEATURE_COUNT = CommonsPackage.NAME_CONTAINER_FEATURE_COUNT + 7; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.RangeValueImpl Range Value}' class. + * + * + * @see org.soluvas.data.impl.RangeValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getRangeValue() + * @generated + */ + int RANGE_VALUE = 5; + + /** + * The feature id for the 'Semantic' attribute. + * + * + * @generated + * @ordered + */ + int RANGE_VALUE__SEMANTIC = VALUE__SEMANTIC; + + /** + * The feature id for the 'Display Value' attribute. + * + * + * @generated + * @ordered + */ + int RANGE_VALUE__DISPLAY_VALUE = VALUE__DISPLAY_VALUE; + + /** + * The feature id for the 'Start Value' attribute. + * + * + * @generated + * @ordered + */ + int RANGE_VALUE__START_VALUE = VALUE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'End Value' attribute. + * + * + * @generated + * @ordered + */ + int RANGE_VALUE__END_VALUE = VALUE_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Range Value' class. + * + * + * @generated + * @ordered + */ + int RANGE_VALUE_FEATURE_COUNT = VALUE_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.TermValueImpl Term Value}' class. + * + * + * @see org.soluvas.data.impl.TermValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getTermValue() + * @generated + */ + int TERM_VALUE = 6; + + /** + * The feature id for the 'Semantic' attribute. + * + * + * @generated + * @ordered + */ + int TERM_VALUE__SEMANTIC = VALUE__SEMANTIC; + + /** + * The feature id for the 'Display Value' attribute. + * + * + * @generated + * @ordered + */ + int TERM_VALUE__DISPLAY_VALUE = VALUE__DISPLAY_VALUE; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int TERM_VALUE__ID = VALUE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Slug' attribute. + * + * + * @generated + * @ordered + */ + int TERM_VALUE__SLUG = VALUE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Term' reference. + * + * + * @generated + * @ordered + */ + int TERM_VALUE__TERM = VALUE_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Slug Path' attribute. + * + * + * @generated + * @ordered + */ + int TERM_VALUE__SLUG_PATH = VALUE_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int TERM_VALUE__VALUE = VALUE_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'Term Value' class. + * + * + * @generated + * @ordered + */ + int TERM_VALUE_FEATURE_COUNT = VALUE_FEATURE_COUNT + 5; + + /** + * The meta object id for the '{@link org.soluvas.data.TermContainer Term Container}' class. + * + * + * @see org.soluvas.data.TermContainer + * @see org.soluvas.data.impl.DataPackageImpl#getTermContainer() + * @generated + */ + int TERM_CONTAINER = 12; + + /** + * The feature id for the 'Terms' reference list. + * + * + * @generated + * @ordered + */ + int TERM_CONTAINER__TERMS = 0; + + /** + * The number of structural features of the 'Term Container' class. + * + * + * @generated + * @ordered + */ + int TERM_CONTAINER_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.VocabImpl Vocab}' class. + * + * + * @see org.soluvas.data.impl.VocabImpl + * @see org.soluvas.data.impl.DataPackageImpl#getVocab() + * @generated + */ + int VOCAB = 7; + + /** + * The feature id for the 'Terms' reference list. + * + * + * @generated + * @ordered + */ + int VOCAB__TERMS = TERM_CONTAINER__TERMS; + + /** + * The feature id for the 'Bundle' attribute. + * + * + * @generated + * @ordered + */ + int VOCAB__BUNDLE = TERM_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Resource Type' attribute. + * + * + * @generated + * @ordered + */ + int VOCAB__RESOURCE_TYPE = TERM_CONTAINER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Resource Uri' attribute. + * + * + * @generated + * @ordered + */ + int VOCAB__RESOURCE_URI = TERM_CONTAINER_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Resource Name' attribute. + * + * + * @generated + * @ordered + */ + int VOCAB__RESOURCE_NAME = TERM_CONTAINER_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Ns Prefix' attribute. + * + * + * @generated + * @ordered + */ + int VOCAB__NS_PREFIX = TERM_CONTAINER_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int VOCAB__DESCRIPTION = TERM_CONTAINER_FEATURE_COUNT + 5; + + /** + * The number of structural features of the 'Vocab' class. + * + * + * @generated + * @ordered + */ + int VOCAB_FEATURE_COUNT = TERM_CONTAINER_FEATURE_COUNT + 6; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.TermImpl Term}' class. + * + * + * @see org.soluvas.data.impl.TermImpl + * @see org.soluvas.data.impl.DataPackageImpl#getTerm() + * @generated + */ + int TERM = 8; + + /** + * The feature id for the 'Terms' reference list. + * + * + * @generated + * @ordered + */ + int TERM__TERMS = TERM_CONTAINER__TERMS; + + /** + * The feature id for the 'Bundle' attribute. + * + * + * @generated + * @ordered + */ + int TERM__BUNDLE = TERM_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int TERM__NAME = TERM_CONTAINER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Resource Type' attribute. + * + * + * @generated + * @ordered + */ + int TERM__RESOURCE_TYPE = TERM_CONTAINER_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Resource Uri' attribute. + * + * + * @generated + * @ordered + */ + int TERM__RESOURCE_URI = TERM_CONTAINER_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Resource Name' attribute. + * + * + * @generated + * @ordered + */ + int TERM__RESOURCE_NAME = TERM_CONTAINER_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Vocab' reference. + * + * + * @generated + * @ordered + */ + int TERM__VOCAB = TERM_CONTAINER_FEATURE_COUNT + 5; + + /** + * The number of structural features of the 'Term' class. + * + * + * @generated + * @ordered + */ + int TERM_FEATURE_COUNT = TERM_CONTAINER_FEATURE_COUNT + 6; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.ListVocabImpl List Vocab}' class. + * + * + * @see org.soluvas.data.impl.ListVocabImpl + * @see org.soluvas.data.impl.DataPackageImpl#getListVocab() + * @generated + */ + int LIST_VOCAB = 9; + + /** + * The feature id for the 'Terms' reference list. + * + * + * @generated + * @ordered + */ + int LIST_VOCAB__TERMS = VOCAB__TERMS; + + /** + * The feature id for the 'Bundle' attribute. + * + * + * @generated + * @ordered + */ + int LIST_VOCAB__BUNDLE = VOCAB__BUNDLE; + + /** + * The feature id for the 'Resource Type' attribute. + * + * + * @generated + * @ordered + */ + int LIST_VOCAB__RESOURCE_TYPE = VOCAB__RESOURCE_TYPE; + + /** + * The feature id for the 'Resource Uri' attribute. + * + * + * @generated + * @ordered + */ + int LIST_VOCAB__RESOURCE_URI = VOCAB__RESOURCE_URI; + + /** + * The feature id for the 'Resource Name' attribute. + * + * + * @generated + * @ordered + */ + int LIST_VOCAB__RESOURCE_NAME = VOCAB__RESOURCE_NAME; + + /** + * The feature id for the 'Ns Prefix' attribute. + * + * + * @generated + * @ordered + */ + int LIST_VOCAB__NS_PREFIX = VOCAB__NS_PREFIX; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int LIST_VOCAB__DESCRIPTION = VOCAB__DESCRIPTION; + + /** + * The number of structural features of the 'List Vocab' class. + * + * + * @generated + * @ordered + */ + int LIST_VOCAB_FEATURE_COUNT = VOCAB_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.TreeVocabImpl Tree Vocab}' class. + * + * + * @see org.soluvas.data.impl.TreeVocabImpl + * @see org.soluvas.data.impl.DataPackageImpl#getTreeVocab() + * @generated + */ + int TREE_VOCAB = 10; + + /** + * The feature id for the 'Terms' reference list. + * + * + * @generated + * @ordered + */ + int TREE_VOCAB__TERMS = VOCAB__TERMS; + + /** + * The feature id for the 'Bundle' attribute. + * + * + * @generated + * @ordered + */ + int TREE_VOCAB__BUNDLE = VOCAB__BUNDLE; + + /** + * The feature id for the 'Resource Type' attribute. + * + * + * @generated + * @ordered + */ + int TREE_VOCAB__RESOURCE_TYPE = VOCAB__RESOURCE_TYPE; + + /** + * The feature id for the 'Resource Uri' attribute. + * + * + * @generated + * @ordered + */ + int TREE_VOCAB__RESOURCE_URI = VOCAB__RESOURCE_URI; + + /** + * The feature id for the 'Resource Name' attribute. + * + * + * @generated + * @ordered + */ + int TREE_VOCAB__RESOURCE_NAME = VOCAB__RESOURCE_NAME; + + /** + * The feature id for the 'Ns Prefix' attribute. + * + * + * @generated + * @ordered + */ + int TREE_VOCAB__NS_PREFIX = VOCAB__NS_PREFIX; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int TREE_VOCAB__DESCRIPTION = VOCAB__DESCRIPTION; + + /** + * The number of structural features of the 'Tree Vocab' class. + * + * + * @generated + * @ordered + */ + int TREE_VOCAB_FEATURE_COUNT = VOCAB_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.FreeVocabImpl Free Vocab}' class. + * + * + * @see org.soluvas.data.impl.FreeVocabImpl + * @see org.soluvas.data.impl.DataPackageImpl#getFreeVocab() + * @generated + */ + int FREE_VOCAB = 11; + + /** + * The feature id for the 'Terms' reference list. + * + * + * @generated + * @ordered + */ + int FREE_VOCAB__TERMS = VOCAB__TERMS; + + /** + * The feature id for the 'Bundle' attribute. + * + * + * @generated + * @ordered + */ + int FREE_VOCAB__BUNDLE = VOCAB__BUNDLE; + + /** + * The feature id for the 'Resource Type' attribute. + * + * + * @generated + * @ordered + */ + int FREE_VOCAB__RESOURCE_TYPE = VOCAB__RESOURCE_TYPE; + + /** + * The feature id for the 'Resource Uri' attribute. + * + * + * @generated + * @ordered + */ + int FREE_VOCAB__RESOURCE_URI = VOCAB__RESOURCE_URI; + + /** + * The feature id for the 'Resource Name' attribute. + * + * + * @generated + * @ordered + */ + int FREE_VOCAB__RESOURCE_NAME = VOCAB__RESOURCE_NAME; + + /** + * The feature id for the 'Ns Prefix' attribute. + * + * + * @generated + * @ordered + */ + int FREE_VOCAB__NS_PREFIX = VOCAB__NS_PREFIX; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int FREE_VOCAB__DESCRIPTION = VOCAB__DESCRIPTION; + + /** + * The number of structural features of the 'Free Vocab' class. + * + * + * @generated + * @ordered + */ + int FREE_VOCAB_FEATURE_COUNT = VOCAB_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.soluvas.data.impl.DataCatalogImpl Catalog}' class. + * + * + * @see org.soluvas.data.impl.DataCatalogImpl + * @see org.soluvas.data.impl.DataPackageImpl#getDataCatalog() + * @generated + */ + int DATA_CATALOG = 13; + + /** + * The feature id for the 'Bundle' attribute. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__BUNDLE = CommonsPackage.BUNDLE_AWARE__BUNDLE; + + /** + * The feature id for the 'Resource Type' attribute. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__RESOURCE_TYPE = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Resource Uri' attribute. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__RESOURCE_URI = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Resource Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__RESOURCE_NAME = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__NAME = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Vocabs' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__VOCABS = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Mixins' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__MIXINS = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Terms' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__TERMS = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Attribute Types' containment reference list. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG__ATTRIBUTE_TYPES = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 7; + + /** + * The number of structural features of the 'Catalog' class. + * + * + * @generated + * @ordered + */ + int DATA_CATALOG_FEATURE_COUNT = CommonsPackage.BUNDLE_AWARE_FEATURE_COUNT + 8; + + /** + * The meta object id for the '{@link org.soluvas.data.AttributeSemantic Attribute Semantic}' enum. + * + * + * @see org.soluvas.data.AttributeSemantic + * @see org.soluvas.data.impl.DataPackageImpl#getAttributeSemantic() + * @generated + */ + int ATTRIBUTE_SEMANTIC = 14; + /** * The meta object id for the 'Crud Repository' data type. * * - * @see org.soluvas.data.repository.CrudRepository - * @see org.soluvas.data.impl.DataPackageImpl#getCrudRepository() + * @see org.soluvas.data.repository.CrudRepository + * @see org.soluvas.data.impl.DataPackageImpl#getCrudRepository() + * @generated + */ + int CRUD_REPOSITORY = 15; + + /** + * The meta object id for the 'Paging And Sorting Repository' data type. + * + * + * @see org.soluvas.data.repository.PagingAndSortingRepository + * @see org.soluvas.data.impl.DataPackageImpl#getPagingAndSortingRepository() + * @generated + */ + int PAGING_AND_SORTING_REPOSITORY = 16; + + /** + * The meta object id for the 'Crud Repository Base' data type. + * + * + * @see org.soluvas.data.repository.CrudRepositoryBase + * @see org.soluvas.data.impl.DataPackageImpl#getCrudRepositoryBase() + * @generated + */ + int CRUD_REPOSITORY_BASE = 17; + + + /** + * The meta object id for the 'Measure' data type. + * + * + * @see javax.measure.Measure + * @see org.soluvas.data.impl.DataPackageImpl#getMeasure() + * @generated + */ + int MEASURE = 18; + + /** + * The meta object id for the 'Decimal Measure' data type. + * + * + * @see javax.measure.DecimalMeasure + * @see org.soluvas.data.impl.DataPackageImpl#getDecimalMeasure() + * @generated + */ + int DECIMAL_MEASURE = 19; + + + /** + * Returns the meta object for class '{@link org.soluvas.data.AttributeType Attribute Type}'. + * + * + * @return the meta object for class 'Attribute Type'. + * @see org.soluvas.data.AttributeType + * @generated + */ + EClass getAttributeType(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.AttributeType#getLabel Label}'. + * + * + * @return the meta object for the attribute 'Label'. + * @see org.soluvas.data.AttributeType#getLabel() + * @see #getAttributeType() + * @generated + */ + EAttribute getAttributeType_Label(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.AttributeType#getMinValues Min Values}'. + * + * + * @return the meta object for the attribute 'Min Values'. + * @see org.soluvas.data.AttributeType#getMinValues() + * @see #getAttributeType() + * @generated + */ + EAttribute getAttributeType_MinValues(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.AttributeType#getMaxValues Max Values}'. + * + * + * @return the meta object for the attribute 'Max Values'. + * @see org.soluvas.data.AttributeType#getMaxValues() + * @see #getAttributeType() + * @generated + */ + EAttribute getAttributeType_MaxValues(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.AttributeType#getDataTypeName Data Type Name}'. + * + * + * @return the meta object for the attribute 'Data Type Name'. + * @see org.soluvas.data.AttributeType#getDataTypeName() + * @see #getAttributeType() + * @generated + */ + EAttribute getAttributeType_DataTypeName(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.Value Value}'. + * + * + * @return the meta object for class 'Value'. + * @see org.soluvas.data.Value + * @generated + */ + EClass getValue(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.Value#getSemantic Semantic}'. + * + * + * @return the meta object for the attribute 'Semantic'. + * @see org.soluvas.data.Value#getSemantic() + * @see #getValue() + * @generated + */ + EAttribute getValue_Semantic(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.Value#getDisplayValue Display Value}'. + * + * + * @return the meta object for the attribute 'Display Value'. + * @see org.soluvas.data.Value#getDisplayValue() + * @see #getValue() + * @generated + */ + EAttribute getValue_DisplayValue(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.MeasureValue Measure Value}'. + * + * + * @return the meta object for class 'Measure Value'. + * @see org.soluvas.data.MeasureValue + * @generated + */ + EClass getMeasureValue(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.MeasureValue#getValueUnit Value Unit}'. + * + * + * @return the meta object for the attribute 'Value Unit'. + * @see org.soluvas.data.MeasureValue#getValueUnit() + * @see #getMeasureValue() + * @generated + */ + EAttribute getMeasureValue_ValueUnit(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.MeasureValue#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see org.soluvas.data.MeasureValue#getValue() + * @see #getMeasureValue() + * @generated + */ + EAttribute getMeasureValue_Value(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.CurrencyValue Currency Value}'. + * + * + * @return the meta object for class 'Currency Value'. + * @see org.soluvas.data.CurrencyValue + * @generated + */ + EClass getCurrencyValue(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.CurrencyValue#getCurrencyUnit Currency Unit}'. + * + * + * @return the meta object for the attribute 'Currency Unit'. + * @see org.soluvas.data.CurrencyValue#getCurrencyUnit() + * @see #getCurrencyValue() + * @generated + */ + EAttribute getCurrencyValue_CurrencyUnit(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.Mixin Mixin}'. + * + * + * @return the meta object for class 'Mixin'. + * @see org.soluvas.data.Mixin + * @generated + */ + EClass getMixin(); + + /** + * Returns the meta object for the reference list '{@link org.soluvas.data.Mixin#getAttributeTypes Attribute Types}'. + * + * + * @return the meta object for the reference list 'Attribute Types'. + * @see org.soluvas.data.Mixin#getAttributeTypes() + * @see #getMixin() + * @generated + */ + EReference getMixin_AttributeTypes(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.RangeValue Range Value}'. + * + * + * @return the meta object for class 'Range Value'. + * @see org.soluvas.data.RangeValue + * @generated + */ + EClass getRangeValue(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.RangeValue#getStartValue Start Value}'. + * + * + * @return the meta object for the attribute 'Start Value'. + * @see org.soluvas.data.RangeValue#getStartValue() + * @see #getRangeValue() + * @generated + */ + EAttribute getRangeValue_StartValue(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.RangeValue#getEndValue End Value}'. + * + * + * @return the meta object for the attribute 'End Value'. + * @see org.soluvas.data.RangeValue#getEndValue() + * @see #getRangeValue() + * @generated + */ + EAttribute getRangeValue_EndValue(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.TermValue Term Value}'. + * + * + * @return the meta object for class 'Term Value'. + * @see org.soluvas.data.TermValue + * @generated + */ + EClass getTermValue(); + + /** + * Returns the meta object for the reference '{@link org.soluvas.data.TermValue#getTerm Term}'. + * + * + * @return the meta object for the reference 'Term'. + * @see org.soluvas.data.TermValue#getTerm() + * @see #getTermValue() + * @generated + */ + EReference getTermValue_Term(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.TermValue#getSlugPath Slug Path}'. + * + * + * @return the meta object for the attribute 'Slug Path'. + * @see org.soluvas.data.TermValue#getSlugPath() + * @see #getTermValue() + * @generated + */ + EAttribute getTermValue_SlugPath(); + + /** + * Returns the meta object for the attribute '{@link org.soluvas.data.TermValue#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see org.soluvas.data.TermValue#getValue() + * @see #getTermValue() + * @generated + */ + EAttribute getTermValue_Value(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.Vocab Vocab}'. + * + * + * @return the meta object for class 'Vocab'. + * @see org.soluvas.data.Vocab + * @generated + */ + EClass getVocab(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.Term Term}'. + * + * + * @return the meta object for class 'Term'. + * @see org.soluvas.data.Term + * @generated + */ + EClass getTerm(); + + /** + * Returns the meta object for the reference '{@link org.soluvas.data.Term#getVocab Vocab}'. + * + * + * @return the meta object for the reference 'Vocab'. + * @see org.soluvas.data.Term#getVocab() + * @see #getTerm() + * @generated + */ + EReference getTerm_Vocab(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.ListVocab List Vocab}'. + * + * + * @return the meta object for class 'List Vocab'. + * @see org.soluvas.data.ListVocab + * @generated + */ + EClass getListVocab(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.TreeVocab Tree Vocab}'. + * + * + * @return the meta object for class 'Tree Vocab'. + * @see org.soluvas.data.TreeVocab + * @generated + */ + EClass getTreeVocab(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.FreeVocab Free Vocab}'. + * + * + * @return the meta object for class 'Free Vocab'. + * @see org.soluvas.data.FreeVocab + * @generated + */ + EClass getFreeVocab(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.TermContainer Term Container}'. + * + * + * @return the meta object for class 'Term Container'. + * @see org.soluvas.data.TermContainer + * @generated + */ + EClass getTermContainer(); + + /** + * Returns the meta object for the reference list '{@link org.soluvas.data.TermContainer#getTerms Terms}'. + * + * + * @return the meta object for the reference list 'Terms'. + * @see org.soluvas.data.TermContainer#getTerms() + * @see #getTermContainer() + * @generated + */ + EReference getTermContainer_Terms(); + + /** + * Returns the meta object for class '{@link org.soluvas.data.DataCatalog Catalog}'. + * + * + * @return the meta object for class 'Catalog'. + * @see org.soluvas.data.DataCatalog + * @generated + */ + EClass getDataCatalog(); + + /** + * Returns the meta object for the containment reference list '{@link org.soluvas.data.DataCatalog#getVocabs Vocabs}'. + * + * + * @return the meta object for the containment reference list 'Vocabs'. + * @see org.soluvas.data.DataCatalog#getVocabs() + * @see #getDataCatalog() + * @generated + */ + EReference getDataCatalog_Vocabs(); + + /** + * Returns the meta object for the containment reference list '{@link org.soluvas.data.DataCatalog#getMixins Mixins}'. + * + * + * @return the meta object for the containment reference list 'Mixins'. + * @see org.soluvas.data.DataCatalog#getMixins() + * @see #getDataCatalog() * @generated */ - int CRUD_REPOSITORY = 0; + EReference getDataCatalog_Mixins(); /** - * The meta object id for the 'Paging And Sorting Repository' data type. + * Returns the meta object for the containment reference list '{@link org.soluvas.data.DataCatalog#getTerms Terms}'. * * - * @see org.soluvas.data.repository.PagingAndSortingRepository - * @see org.soluvas.data.impl.DataPackageImpl#getPagingAndSortingRepository() + * @return the meta object for the containment reference list 'Terms'. + * @see org.soluvas.data.DataCatalog#getTerms() + * @see #getDataCatalog() * @generated */ - int PAGING_AND_SORTING_REPOSITORY = 1; + EReference getDataCatalog_Terms(); /** - * The meta object id for the 'Crud Repository Base' data type. + * Returns the meta object for the containment reference list '{@link org.soluvas.data.DataCatalog#getAttributeTypes Attribute Types}'. * * - * @see org.soluvas.data.repository.CrudRepositoryBase - * @see org.soluvas.data.impl.DataPackageImpl#getCrudRepositoryBase() + * @return the meta object for the containment reference list 'Attribute Types'. + * @see org.soluvas.data.DataCatalog#getAttributeTypes() + * @see #getDataCatalog() * @generated */ - int CRUD_REPOSITORY_BASE = 2; + EReference getDataCatalog_AttributeTypes(); + /** + * Returns the meta object for enum '{@link org.soluvas.data.AttributeSemantic Attribute Semantic}'. + * + * + * @return the meta object for enum 'Attribute Semantic'. + * @see org.soluvas.data.AttributeSemantic + * @generated + */ + EEnum getAttributeSemantic(); /** * Returns the meta object for data type '{@link org.soluvas.data.repository.CrudRepository Crud Repository}'. @@ -117,6 +1547,28 @@ public interface DataPackage extends EPackage { */ EDataType getCrudRepositoryBase(); + /** + * Returns the meta object for data type '{@link javax.measure.Measure Measure}'. + * + * + * @return the meta object for data type 'Measure'. + * @see javax.measure.Measure + * @model instanceClass="javax.measure.Measure" typeParameters="V Q" QBounds="org.soluvas.commons.Quantity" + * @generated + */ + EDataType getMeasure(); + + /** + * Returns the meta object for data type '{@link javax.measure.DecimalMeasure Decimal Measure}'. + * + * + * @return the meta object for data type 'Decimal Measure'. + * @see javax.measure.DecimalMeasure + * @model instanceClass="javax.measure.DecimalMeasure" typeParameters="Q" QBounds="org.soluvas.commons.Quantity" + * @generated + */ + EDataType getDecimalMeasure(); + /** * Returns the factory that creates the instances of the model. * @@ -139,6 +1591,324 @@ public interface DataPackage extends EPackage { * @generated */ interface Literals { + /** + * The meta object literal for the '{@link org.soluvas.data.AttributeType Attribute Type}' class. + * + * + * @see org.soluvas.data.AttributeType + * @see org.soluvas.data.impl.DataPackageImpl#getAttributeType() + * @generated + */ + EClass ATTRIBUTE_TYPE = eINSTANCE.getAttributeType(); + + /** + * The meta object literal for the 'Label' attribute feature. + * + * + * @generated + */ + EAttribute ATTRIBUTE_TYPE__LABEL = eINSTANCE.getAttributeType_Label(); + + /** + * The meta object literal for the 'Min Values' attribute feature. + * + * + * @generated + */ + EAttribute ATTRIBUTE_TYPE__MIN_VALUES = eINSTANCE.getAttributeType_MinValues(); + + /** + * The meta object literal for the 'Max Values' attribute feature. + * + * + * @generated + */ + EAttribute ATTRIBUTE_TYPE__MAX_VALUES = eINSTANCE.getAttributeType_MaxValues(); + + /** + * The meta object literal for the 'Data Type Name' attribute feature. + * + * + * @generated + */ + EAttribute ATTRIBUTE_TYPE__DATA_TYPE_NAME = eINSTANCE.getAttributeType_DataTypeName(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.ValueImpl Value}' class. + * + * + * @see org.soluvas.data.impl.ValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getValue() + * @generated + */ + EClass VALUE = eINSTANCE.getValue(); + + /** + * The meta object literal for the 'Semantic' attribute feature. + * + * + * @generated + */ + EAttribute VALUE__SEMANTIC = eINSTANCE.getValue_Semantic(); + + /** + * The meta object literal for the 'Display Value' attribute feature. + * + * + * @generated + */ + EAttribute VALUE__DISPLAY_VALUE = eINSTANCE.getValue_DisplayValue(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.MeasureValueImpl Measure Value}' class. + * + * + * @see org.soluvas.data.impl.MeasureValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getMeasureValue() + * @generated + */ + EClass MEASURE_VALUE = eINSTANCE.getMeasureValue(); + + /** + * The meta object literal for the 'Value Unit' attribute feature. + * + * + * @generated + */ + EAttribute MEASURE_VALUE__VALUE_UNIT = eINSTANCE.getMeasureValue_ValueUnit(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute MEASURE_VALUE__VALUE = eINSTANCE.getMeasureValue_Value(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.CurrencyValueImpl Currency Value}' class. + * + * + * @see org.soluvas.data.impl.CurrencyValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getCurrencyValue() + * @generated + */ + EClass CURRENCY_VALUE = eINSTANCE.getCurrencyValue(); + + /** + * The meta object literal for the 'Currency Unit' attribute feature. + * + * + * @generated + */ + EAttribute CURRENCY_VALUE__CURRENCY_UNIT = eINSTANCE.getCurrencyValue_CurrencyUnit(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.MixinImpl Mixin}' class. + * + * + * @see org.soluvas.data.impl.MixinImpl + * @see org.soluvas.data.impl.DataPackageImpl#getMixin() + * @generated + */ + EClass MIXIN = eINSTANCE.getMixin(); + + /** + * The meta object literal for the 'Attribute Types' reference list feature. + * + * + * @generated + */ + EReference MIXIN__ATTRIBUTE_TYPES = eINSTANCE.getMixin_AttributeTypes(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.RangeValueImpl Range Value}' class. + * + * + * @see org.soluvas.data.impl.RangeValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getRangeValue() + * @generated + */ + EClass RANGE_VALUE = eINSTANCE.getRangeValue(); + + /** + * The meta object literal for the 'Start Value' attribute feature. + * + * + * @generated + */ + EAttribute RANGE_VALUE__START_VALUE = eINSTANCE.getRangeValue_StartValue(); + + /** + * The meta object literal for the 'End Value' attribute feature. + * + * + * @generated + */ + EAttribute RANGE_VALUE__END_VALUE = eINSTANCE.getRangeValue_EndValue(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.TermValueImpl Term Value}' class. + * + * + * @see org.soluvas.data.impl.TermValueImpl + * @see org.soluvas.data.impl.DataPackageImpl#getTermValue() + * @generated + */ + EClass TERM_VALUE = eINSTANCE.getTermValue(); + + /** + * The meta object literal for the 'Term' reference feature. + * + * + * @generated + */ + EReference TERM_VALUE__TERM = eINSTANCE.getTermValue_Term(); + + /** + * The meta object literal for the 'Slug Path' attribute feature. + * + * + * @generated + */ + EAttribute TERM_VALUE__SLUG_PATH = eINSTANCE.getTermValue_SlugPath(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute TERM_VALUE__VALUE = eINSTANCE.getTermValue_Value(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.VocabImpl Vocab}' class. + * + * + * @see org.soluvas.data.impl.VocabImpl + * @see org.soluvas.data.impl.DataPackageImpl#getVocab() + * @generated + */ + EClass VOCAB = eINSTANCE.getVocab(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.TermImpl Term}' class. + * + * + * @see org.soluvas.data.impl.TermImpl + * @see org.soluvas.data.impl.DataPackageImpl#getTerm() + * @generated + */ + EClass TERM = eINSTANCE.getTerm(); + + /** + * The meta object literal for the 'Vocab' reference feature. + * + * + * @generated + */ + EReference TERM__VOCAB = eINSTANCE.getTerm_Vocab(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.ListVocabImpl List Vocab}' class. + * + * + * @see org.soluvas.data.impl.ListVocabImpl + * @see org.soluvas.data.impl.DataPackageImpl#getListVocab() + * @generated + */ + EClass LIST_VOCAB = eINSTANCE.getListVocab(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.TreeVocabImpl Tree Vocab}' class. + * + * + * @see org.soluvas.data.impl.TreeVocabImpl + * @see org.soluvas.data.impl.DataPackageImpl#getTreeVocab() + * @generated + */ + EClass TREE_VOCAB = eINSTANCE.getTreeVocab(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.FreeVocabImpl Free Vocab}' class. + * + * + * @see org.soluvas.data.impl.FreeVocabImpl + * @see org.soluvas.data.impl.DataPackageImpl#getFreeVocab() + * @generated + */ + EClass FREE_VOCAB = eINSTANCE.getFreeVocab(); + + /** + * The meta object literal for the '{@link org.soluvas.data.TermContainer Term Container}' class. + * + * + * @see org.soluvas.data.TermContainer + * @see org.soluvas.data.impl.DataPackageImpl#getTermContainer() + * @generated + */ + EClass TERM_CONTAINER = eINSTANCE.getTermContainer(); + + /** + * The meta object literal for the 'Terms' reference list feature. + * + * + * @generated + */ + EReference TERM_CONTAINER__TERMS = eINSTANCE.getTermContainer_Terms(); + + /** + * The meta object literal for the '{@link org.soluvas.data.impl.DataCatalogImpl Catalog}' class. + * + * + * @see org.soluvas.data.impl.DataCatalogImpl + * @see org.soluvas.data.impl.DataPackageImpl#getDataCatalog() + * @generated + */ + EClass DATA_CATALOG = eINSTANCE.getDataCatalog(); + + /** + * The meta object literal for the 'Vocabs' containment reference list feature. + * + * + * @generated + */ + EReference DATA_CATALOG__VOCABS = eINSTANCE.getDataCatalog_Vocabs(); + + /** + * The meta object literal for the 'Mixins' containment reference list feature. + * + * + * @generated + */ + EReference DATA_CATALOG__MIXINS = eINSTANCE.getDataCatalog_Mixins(); + + /** + * The meta object literal for the 'Terms' containment reference list feature. + * + * + * @generated + */ + EReference DATA_CATALOG__TERMS = eINSTANCE.getDataCatalog_Terms(); + + /** + * The meta object literal for the 'Attribute Types' containment reference list feature. + * + * + * @generated + */ + EReference DATA_CATALOG__ATTRIBUTE_TYPES = eINSTANCE.getDataCatalog_AttributeTypes(); + + /** + * The meta object literal for the '{@link org.soluvas.data.AttributeSemantic Attribute Semantic}' enum. + * + * + * @see org.soluvas.data.AttributeSemantic + * @see org.soluvas.data.impl.DataPackageImpl#getAttributeSemantic() + * @generated + */ + EEnum ATTRIBUTE_SEMANTIC = eINSTANCE.getAttributeSemantic(); + /** * The meta object literal for the 'Crud Repository' data type. * @@ -169,6 +1939,26 @@ interface Literals { */ EDataType CRUD_REPOSITORY_BASE = eINSTANCE.getCrudRepositoryBase(); + /** + * The meta object literal for the 'Measure' data type. + * + * + * @see javax.measure.Measure + * @see org.soluvas.data.impl.DataPackageImpl#getMeasure() + * @generated + */ + EDataType MEASURE = eINSTANCE.getMeasure(); + + /** + * The meta object literal for the 'Decimal Measure' data type. + * + * + * @see javax.measure.DecimalMeasure + * @see org.soluvas.data.impl.DataPackageImpl#getDecimalMeasure() + * @generated + */ + EDataType DECIMAL_MEASURE = eINSTANCE.getDecimalMeasure(); + } } //DataPackage diff --git a/data/src/main/java/org/soluvas/data/FreeVocab.java b/data/src/main/java/org/soluvas/data/FreeVocab.java new file mode 100644 index 000000000..ed0a3906a --- /dev/null +++ b/data/src/main/java/org/soluvas/data/FreeVocab.java @@ -0,0 +1,17 @@ +/** + */ +package org.soluvas.data; + + +/** + * + * A representation of the model object 'Free Vocab'. + * + * + * + * @see org.soluvas.data.DataPackage#getFreeVocab() + * @model extendedMetaData="name='FreeVocab'" + * @generated + */ +public interface FreeVocab extends Vocab { +} // FreeVocab diff --git a/data/src/main/java/org/soluvas/data/ListVocab.java b/data/src/main/java/org/soluvas/data/ListVocab.java new file mode 100644 index 000000000..9abf62c93 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/ListVocab.java @@ -0,0 +1,17 @@ +/** + */ +package org.soluvas.data; + + +/** + * + * A representation of the model object 'List Vocab'. + * + * + * + * @see org.soluvas.data.DataPackage#getListVocab() + * @model extendedMetaData="name='ListVocab'" + * @generated + */ +public interface ListVocab extends Vocab { +} // ListVocab diff --git a/data/src/main/java/org/soluvas/data/MeasureValue.java b/data/src/main/java/org/soluvas/data/MeasureValue.java new file mode 100644 index 000000000..4fb28f463 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/MeasureValue.java @@ -0,0 +1,95 @@ +/** + */ +package org.soluvas.data; + +import java.math.BigDecimal; + +import javax.measure.DecimalMeasure; + +import javax.measure.quantity.Quantity; + +import javax.measure.unit.Unit; + +/** + * + * A representation of the model object 'Measure Value'. + * + * + * + * Mixin with measured unit. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.MeasureValue#getValueUnit Value Unit}
  • + *
  • {@link org.soluvas.data.MeasureValue#getValue Value}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getMeasureValue() + * @model superTypes="org.soluvas.data.Value" QBounds="org.soluvas.commons.Quantity" + * @generated + */ +public interface MeasureValue extends Value { + /** + * Returns the value of the 'Value Unit' attribute. + * + *

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

+ * + * @return the value of the 'Value Unit' attribute. + * @see #setValueUnit(Unit) + * @see org.soluvas.data.DataPackage#getMeasureValue_ValueUnit() + * @model dataType="org.soluvas.commons.Unit" + * @generated + */ + Unit getValueUnit(); + + /** + * Sets the value of the '{@link org.soluvas.data.MeasureValue#getValueUnit Value Unit}' attribute. + * + * + * @param value the new value of the 'Value Unit' attribute. + * @see #getValueUnit() + * @generated + */ + void setValueUnit(Unit value); + + /** + * Returns the value of the 'Value' attribute. + * + *

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

+ * + * @return the value of the 'Value' attribute. + * @see #setValue(BigDecimal) + * @see org.soluvas.data.DataPackage#getMeasureValue_Value() + * @model + * @generated + */ + BigDecimal getValue(); + + /** + * Sets the value of the '{@link org.soluvas.data.MeasureValue#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(BigDecimal value); + + /** + * + * + * @model kind="operation" dataType="org.soluvas.data.DecimalMeasure" + * @generated + */ + DecimalMeasure getMeasure(); + +} // MeasureValue diff --git a/data/src/main/java/org/soluvas/data/Mixin.java b/data/src/main/java/org/soluvas/data/Mixin.java new file mode 100644 index 000000000..d87893802 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/Mixin.java @@ -0,0 +1,46 @@ +/** + */ +package org.soluvas.data; + +import org.eclipse.emf.common.util.EList; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.Describable; +import org.soluvas.commons.NameContainer; +import org.soluvas.commons.NsPrefixable; +import org.soluvas.commons.ResourceAware; + +/** + * + * A representation of the model object 'Mixin'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.Mixin#getAttributeTypes Attribute Types}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getMixin() + * @model + * @generated + */ +public interface Mixin extends NameContainer, ResourceAware, BundleAware, NsPrefixable, Describable { + /** + * Returns the value of the 'Attribute Types' reference list. + * The list contents are of type {@link org.soluvas.data.AttributeType}. + * + *

+ * If the meaning of the 'Attribute Types' reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Attribute Types' reference list. + * @see org.soluvas.data.DataPackage#getMixin_AttributeTypes() + * @model + * @generated + */ + EList getAttributeTypes(); + +} // Mixin diff --git a/data/src/main/java/org/soluvas/data/RangeValue.java b/data/src/main/java/org/soluvas/data/RangeValue.java new file mode 100644 index 000000000..e98a2ec46 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/RangeValue.java @@ -0,0 +1,80 @@ +/** + */ +package org.soluvas.data; + + +/** + * + * A representation of the model object 'Range Value'. + * + * + * + * Range attribute's primary value can be either the start or end value. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.RangeValue#getStartValue Start Value}
  • + *
  • {@link org.soluvas.data.RangeValue#getEndValue End Value}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getRangeValue() + * @model + * @generated + */ +public interface RangeValue extends Value { + /** + * Returns the value of the 'Start Value' attribute. + * + *

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

+ * + * @return the value of the 'Start Value' attribute. + * @see #setStartValue(Object) + * @see org.soluvas.data.DataPackage#getRangeValue_StartValue() + * @model + * @generated + */ + T getStartValue(); + + /** + * Sets the value of the '{@link org.soluvas.data.RangeValue#getStartValue Start Value}' attribute. + * + * + * @param value the new value of the 'Start Value' attribute. + * @see #getStartValue() + * @generated + */ + void setStartValue(T value); + + /** + * Returns the value of the 'End Value' attribute. + * + *

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

+ * + * @return the value of the 'End Value' attribute. + * @see #setEndValue(Object) + * @see org.soluvas.data.DataPackage#getRangeValue_EndValue() + * @model + * @generated + */ + T getEndValue(); + + /** + * Sets the value of the '{@link org.soluvas.data.RangeValue#getEndValue End Value}' attribute. + * + * + * @param value the new value of the 'End Value' attribute. + * @see #getEndValue() + * @generated + */ + void setEndValue(T value); + +} // RangeValue diff --git a/data/src/main/java/org/soluvas/data/Term.java b/data/src/main/java/org/soluvas/data/Term.java new file mode 100644 index 000000000..5d44ae691 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/Term.java @@ -0,0 +1,52 @@ +/** + */ +package org.soluvas.data; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.NameContainer; +import org.soluvas.commons.ResourceAware; + +/** + * + * A representation of the model object 'Term'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.Term#getVocab Vocab}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getTerm() + * @model + * @generated + */ +public interface Term extends TermContainer, BundleAware, NameContainer, ResourceAware { + /** + * Returns the value of the 'Vocab' reference. + * + *

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

+ * + * @return the value of the 'Vocab' reference. + * @see #setVocab(Vocab) + * @see org.soluvas.data.DataPackage#getTerm_Vocab() + * @model + * @generated + */ + Vocab getVocab(); + + /** + * Sets the value of the '{@link org.soluvas.data.Term#getVocab Vocab}' reference. + * + * + * @param value the new value of the 'Vocab' reference. + * @see #getVocab() + * @generated + */ + void setVocab(Vocab value); + +} // Term diff --git a/data/src/main/java/org/soluvas/data/TermAttribute.java b/data/src/main/java/org/soluvas/data/TermAttribute.java new file mode 100644 index 000000000..cc7cbbda2 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/TermAttribute.java @@ -0,0 +1,53 @@ +/** + */ +package org.soluvas.data; + + +/** + * + * A representation of the model object 'Term Attribute'. + * + * + * + * Use a taxonomy term. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.TermAttribute#getTerm Term}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getTermAttribute() + * @model superTypes="org.soluvas.data.Value" + * @generated + */ +public interface TermAttribute extends Value { + /** + * Returns the value of the 'Term' reference. + * + *

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

+ * + * @return the value of the 'Term' reference. + * @see #setTerm(Term) + * @see org.soluvas.data.DataPackage#getTermAttribute_Term() + * @model + * @generated + */ + Term getTerm(); + + /** + * Sets the value of the '{@link org.soluvas.data.TermAttribute#getTerm Term}' reference. + * + * + * @param value the new value of the 'Term' reference. + * @see #getTerm() + * @generated + */ + void setTerm(Term value); + +} // TermAttribute diff --git a/data/src/main/java/org/soluvas/data/TermContainer.java b/data/src/main/java/org/soluvas/data/TermContainer.java new file mode 100644 index 000000000..4e4acca1f --- /dev/null +++ b/data/src/main/java/org/soluvas/data/TermContainer.java @@ -0,0 +1,42 @@ +/** + */ +package org.soluvas.data; + +import org.eclipse.emf.common.util.EList; + +import org.soluvas.commons.SerializableEObject; + +/** + * + * A representation of the model object 'Term Container'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.TermContainer#getTerms Terms}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getTermContainer() + * @model interface="true" abstract="true" + * @extends SerializableEObject + * @generated + */ +public interface TermContainer extends SerializableEObject { + /** + * Returns the value of the 'Terms' reference list. + * The list contents are of type {@link org.soluvas.data.Term}. + * + * + * + * List of terms in a Vocabulary or if the Term is nested (tree vocabulary). + * + * @return the value of the 'Terms' reference list. + * @see org.soluvas.data.DataPackage#getTermContainer_Terms() + * @model + * @generated + */ + EList getTerms(); + +} // TermContainer diff --git a/data/src/main/java/org/soluvas/data/TermValue.java b/data/src/main/java/org/soluvas/data/TermValue.java new file mode 100644 index 000000000..a0e6eac77 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/TermValue.java @@ -0,0 +1,108 @@ +/** + */ +package org.soluvas.data; + +import org.soluvas.commons.Identifiable; +import org.soluvas.commons.Sluggable; + +/** + * + * A representation of the model object 'Term Value'. + * + * + * + * Use a taxonomy term. 'value' is the ID of the term. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.TermValue#getTerm Term}
  • + *
  • {@link org.soluvas.data.TermValue#getSlugPath Slug Path}
  • + *
  • {@link org.soluvas.data.TermValue#getValue Value}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getTermValue() + * @model superTypes="org.soluvas.data.Value org.soluvas.commons.Identifiable org.soluvas.commons.Sluggable" + * @generated + */ +public interface TermValue extends Value, Identifiable, Sluggable { + /** + * Returns the value of the 'Term' reference. + * + *

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

+ * + * @return the value of the 'Term' reference. + * @see #setTerm(Term) + * @see org.soluvas.data.DataPackage#getTermValue_Term() + * @model + * @generated + */ + Term getTerm(); + + /** + * Sets the value of the '{@link org.soluvas.data.TermValue#getTerm Term}' reference. + * + * + * @param value the new value of the 'Term' reference. + * @see #getTerm() + * @generated + */ + void setTerm(Term value); + + /** + * Returns the value of the 'Slug Path' attribute. + * + * + * + * '/'-separated slug path. + * + * @return the value of the 'Slug Path' attribute. + * @see #setSlugPath(String) + * @see org.soluvas.data.DataPackage#getTermValue_SlugPath() + * @model + * @generated + */ + String getSlugPath(); + + /** + * Sets the value of the '{@link org.soluvas.data.TermValue#getSlugPath Slug Path}' attribute. + * + * + * @param value the new value of the 'Slug Path' attribute. + * @see #getSlugPath() + * @generated + */ + void setSlugPath(String value); + + /** + * Returns the value of the 'Value' attribute. + * + *

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

+ * + * @return the value of the 'Value' attribute. + * @see #setValue(String) + * @see org.soluvas.data.DataPackage#getTermValue_Value() + * @model + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link org.soluvas.data.TermValue#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + +} // TermValue diff --git a/data/src/main/java/org/soluvas/data/TreeVocab.java b/data/src/main/java/org/soluvas/data/TreeVocab.java new file mode 100644 index 000000000..c540b2e83 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/TreeVocab.java @@ -0,0 +1,17 @@ +/** + */ +package org.soluvas.data; + + +/** + * + * A representation of the model object 'Tree Vocab'. + * + * + * + * @see org.soluvas.data.DataPackage#getTreeVocab() + * @model extendedMetaData="name='TreeVocab'" + * @generated + */ +public interface TreeVocab extends Vocab { +} // TreeVocab diff --git a/data/src/main/java/org/soluvas/data/Value.java b/data/src/main/java/org/soluvas/data/Value.java new file mode 100644 index 000000000..f8380ed80 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/Value.java @@ -0,0 +1,156 @@ +/** + */ +package org.soluvas.data; + +import org.soluvas.commons.SerializableEObject; + +/** + * + * A representation of the model object 'Value'. + * + * + * + * Attribute having single or multiple values. + * + * { + * attributes: + * color: [{value: "red", displayValue: "Merah"}], + * berbatikMaterial: [{value: "katun", displayValue: "Katun"}], + * berbatikShawlLength: [{value: "90cm", displayValue: "90 cm"}], + * mixins: { + * "color": { + * attributeTypes: { + * color: {className: "TermValue", "name": "color", "label": "Warna"}, // nsPrefix: builtin + * }, + * "berbatik": { + * attributeTypes: { + * berbatikMaterial: {className: "TermValue", nsPrefix: "berbatik", name: "material", label: "Material"}, + * berbatikBatikAge: {className: "TermValue", nsPrefix: "berbatik", name: "batikAge", label: "Batik Age"}, + * } + * }, + * } + * + * + * "berbatik:material": [{value: "Katun"}], + * + * nggak enak: + * product['berbatik:material'][0].displayValue + * + * lebih enak: + * + *

Warna: {{product.attributes.color.0.displayValue}}

+ *

Material: {{product.attributes.berbatikMaterial.0.displayValue}}

+ * + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.soluvas.data.Value#getSemantic Semantic}
  • + *
  • {@link org.soluvas.data.Value#getDisplayValue Display Value}
  • + *
+ *

+ * + * @see org.soluvas.data.DataPackage#getValue() + * @model + * @extends SerializableEObject + * @generated + */ +public interface Value extends SerializableEObject { + /** + * + * + * + * Primary value of the attribute in native type. There may be complementary values like unit. + * In multiple attribute values, this returns the first value. + * + *

Note: setting the value will clear all values and reset to a list with 1 element. + * + * @model kind="operation" + * @generated + */ + T getValue(); + + /** + * Returns the value of the 'Semantic' attribute. + * The literals are from the enumeration {@link org.soluvas.data.AttributeSemantic}. + * + * + * + * Optional semantic of this value. + * + * i.e. value = 50 cm, semantic = less than, means "< 50 cm". + * + * @return the value of the 'Semantic' attribute. + * @see org.soluvas.data.AttributeSemantic + * @see #setSemantic(AttributeSemantic) + * @see org.soluvas.data.DataPackage#getValue_Semantic() + * @model + * @generated + */ + AttributeSemantic getSemantic(); + + /** + * Sets the value of the '{@link org.soluvas.data.Value#getSemantic Semantic}' attribute. + * + * + * @param value the new value of the 'Semantic' attribute. + * @see org.soluvas.data.AttributeSemantic + * @see #getSemantic() + * @generated + */ + void setSemantic(AttributeSemantic value); + + /** + * Returns the value of the 'Display Value' attribute. + * + *

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

+ * + * @return the value of the 'Display Value' attribute. + * @see #setDisplayValue(String) + * @see org.soluvas.data.DataPackage#getValue_DisplayValue() + * @model + * @generated + */ + String getDisplayValue(); + + /** + * Sets the value of the '{@link org.soluvas.data.Value#getDisplayValue Display Value}' attribute. + * + * + * @param value the new value of the 'Display Value' attribute. + * @see #getDisplayValue() + * @generated + */ + void setDisplayValue(String value); + + /** + * + * + * + * Convert the mixin value to a single string. Paths are separated with '/'. Ranges are separated with "-" or ".." (TODO: which one?). + * Semantics are prefixed: "<", "<=", ">", ">=". equal "=" is default if not specified. + * + *

9 cm would be "9cm". Bags > Hobos would be "bags_hobos" (using ID) or "bags/hobos" (using slugPath). + * + *

9 cm, 20 km would be "9cm,20km". + * + *

"2012-12-30-2012-12-30" + * "2012-12-30..2012-12-30" + * "2012-12-30T15:15:70.863+0700-2012-12-30T15:15:70.863+0700" + * "2012-12-30T15:15:70.863+0700..2012-12-30T15:15:70.863+0700" + * "atang-sutisna-rudi-wijaya" + * "atang-sutisna..rudi-wijaya" + * "atang_sutisna-rudi_wijaya" + * "atang_sutisna..rudi_wijaya" + * + * + * @model kind="operation" + * @generated + */ + String getString(); + +} // Value diff --git a/data/src/main/java/org/soluvas/data/Vocab.java b/data/src/main/java/org/soluvas/data/Vocab.java new file mode 100644 index 000000000..f7af73d97 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/Vocab.java @@ -0,0 +1,26 @@ +/** + */ +package org.soluvas.data; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.Describable; +import org.soluvas.commons.NsPrefixable; +import org.soluvas.commons.ResourceAware; + +/** + * + * A representation of the model object 'Vocab'. + * + * + * + * pindah jd attributetype. + * + * + * + * @see org.soluvas.data.DataPackage#getVocab() + * @model abstract="true" + * extendedMetaData="name='Vocab'" + * @generated + */ +public interface Vocab extends TermContainer, BundleAware, ResourceAware, NsPrefixable, Describable { +} // Vocab diff --git a/data/src/main/java/org/soluvas/data/impl/CurrencyValueImpl.java b/data/src/main/java/org/soluvas/data/impl/CurrencyValueImpl.java new file mode 100644 index 000000000..b745b5aa6 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/CurrencyValueImpl.java @@ -0,0 +1,166 @@ +/** + */ +package org.soluvas.data.impl; + +import java.math.BigDecimal; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.joda.money.CurrencyUnit; + +import org.soluvas.data.CurrencyValue; +import org.soluvas.data.DataPackage; + +/** + * + * An implementation of the model object 'Currency Value'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.CurrencyValueImpl#getCurrencyUnit Currency Unit}
  • + *
+ *

+ * + * @generated + */ +public class CurrencyValueImpl extends ValueImpl implements CurrencyValue { + /** + * The default value of the '{@link #getCurrencyUnit() Currency Unit}' attribute. + * + * + * @see #getCurrencyUnit() + * @generated + * @ordered + */ + protected static final CurrencyUnit CURRENCY_UNIT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCurrencyUnit() Currency Unit}' attribute. + * + * + * @see #getCurrencyUnit() + * @generated + * @ordered + */ + protected CurrencyUnit currencyUnit = CURRENCY_UNIT_EDEFAULT; + + /** + * + * + * @generated + */ + public CurrencyValueImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.CURRENCY_VALUE; + } + + /** + * + * + * @generated + */ + public CurrencyUnit getCurrencyUnit() { + return currencyUnit; + } + + /** + * + * + * @generated + */ + public void setCurrencyUnit(CurrencyUnit newCurrencyUnit) { + CurrencyUnit oldCurrencyUnit = currencyUnit; + currencyUnit = newCurrencyUnit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.CURRENCY_VALUE__CURRENCY_UNIT, oldCurrencyUnit, currencyUnit)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.CURRENCY_VALUE__CURRENCY_UNIT: + return getCurrencyUnit(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.CURRENCY_VALUE__CURRENCY_UNIT: + setCurrencyUnit((CurrencyUnit)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.CURRENCY_VALUE__CURRENCY_UNIT: + setCurrencyUnit(CURRENCY_UNIT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.CURRENCY_VALUE__CURRENCY_UNIT: + return CURRENCY_UNIT_EDEFAULT == null ? currencyUnit != null : !CURRENCY_UNIT_EDEFAULT.equals(currencyUnit); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (currencyUnit: "); + result.append(currencyUnit); + result.append(')'); + return result.toString(); + } + +} //CurrencyValueImpl diff --git a/data/src/main/java/org/soluvas/data/impl/DataCatalogImpl.java b/data/src/main/java/org/soluvas/data/impl/DataCatalogImpl.java new file mode 100644 index 000000000..308698ae4 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/DataCatalogImpl.java @@ -0,0 +1,615 @@ +/** + */ +package org.soluvas.data.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.osgi.framework.Bundle; + +import org.soluvas.commons.CommonsPackage; +import org.soluvas.commons.NameContainer; +import org.soluvas.commons.Nameable; +import org.soluvas.commons.ResourceAware; +import org.soluvas.commons.ResourceType; + +import org.soluvas.data.AttributeType; +import org.soluvas.data.DataCatalog; +import org.soluvas.data.DataPackage; +import org.soluvas.data.Mixin; +import org.soluvas.data.Term; +import org.soluvas.data.Vocab; + +/** + * + * An implementation of the model object 'Catalog'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getBundle Bundle}
  • + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getResourceType Resource Type}
  • + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getResourceUri Resource Uri}
  • + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getResourceName Resource Name}
  • + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getName Name}
  • + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getVocabs Vocabs}
  • + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getMixins Mixins}
  • + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getTerms Terms}
  • + *
  • {@link org.soluvas.data.impl.DataCatalogImpl#getAttributeTypes Attribute Types}
  • + *
+ *

+ * + * @generated + */ +public class DataCatalogImpl extends EObjectImpl implements DataCatalog { + /** + * The default value of the '{@link #getBundle() Bundle}' attribute. + * + * + * @see #getBundle() + * @generated + * @ordered + */ + protected static final Bundle BUNDLE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getBundle() Bundle}' attribute. + * + * + * @see #getBundle() + * @generated + * @ordered + */ + protected Bundle bundle = BUNDLE_EDEFAULT; + + /** + * The default value of the '{@link #getResourceType() Resource Type}' attribute. + * + * + * @see #getResourceType() + * @generated + * @ordered + */ + protected static final ResourceType RESOURCE_TYPE_EDEFAULT = ResourceType.BUNDLE; + + /** + * The cached value of the '{@link #getResourceType() Resource Type}' attribute. + * + * + * @see #getResourceType() + * @generated + * @ordered + */ + protected ResourceType resourceType = RESOURCE_TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getResourceUri() Resource Uri}' attribute. + * + * + * @see #getResourceUri() + * @generated + * @ordered + */ + protected static final String RESOURCE_URI_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResourceUri() Resource Uri}' attribute. + * + * + * @see #getResourceUri() + * @generated + * @ordered + */ + protected String resourceUri = RESOURCE_URI_EDEFAULT; + + /** + * The default value of the '{@link #getResourceName() Resource Name}' attribute. + * + * + * @see #getResourceName() + * @generated + * @ordered + */ + protected static final String RESOURCE_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResourceName() Resource Name}' attribute. + * + * + * @see #getResourceName() + * @generated + * @ordered + */ + protected String resourceName = RESOURCE_NAME_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getVocabs() Vocabs}' containment reference list. + * + * + * @see #getVocabs() + * @generated + * @ordered + */ + protected EList vocabs; + + /** + * The cached value of the '{@link #getMixins() Mixins}' containment reference list. + * + * + * @see #getMixins() + * @generated + * @ordered + */ + protected EList mixins; + + /** + * The cached value of the '{@link #getTerms() Terms}' containment reference list. + * + * + * @see #getTerms() + * @generated + * @ordered + */ + protected EList terms; + + /** + * The cached value of the '{@link #getAttributeTypes() Attribute Types}' containment reference list. + * + * + * @see #getAttributeTypes() + * @generated + * @ordered + */ + protected EList attributeTypes; + + /** + * + * + * @generated + */ + public DataCatalogImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.DATA_CATALOG; + } + + /** + * + * + * @generated + */ + public Bundle getBundle() { + return bundle; + } + + /** + * + * + * @generated + */ + public void setBundle(Bundle newBundle) { + Bundle oldBundle = bundle; + bundle = newBundle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.DATA_CATALOG__BUNDLE, oldBundle, bundle)); + } + + /** + * + * + * @generated + */ + public ResourceType getResourceType() { + return resourceType; + } + + /** + * + * + * @generated + */ + public void setResourceType(ResourceType newResourceType) { + ResourceType oldResourceType = resourceType; + resourceType = newResourceType == null ? RESOURCE_TYPE_EDEFAULT : newResourceType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.DATA_CATALOG__RESOURCE_TYPE, oldResourceType, resourceType)); + } + + /** + * + * + * @generated + */ + public String getResourceUri() { + return resourceUri; + } + + /** + * + * + * @generated + */ + public void setResourceUri(String newResourceUri) { + String oldResourceUri = resourceUri; + resourceUri = newResourceUri; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.DATA_CATALOG__RESOURCE_URI, oldResourceUri, resourceUri)); + } + + /** + * + * + * @generated + */ + public String getResourceName() { + return resourceName; + } + + /** + * + * + * @generated + */ + public void setResourceName(String newResourceName) { + String oldResourceName = resourceName; + resourceName = newResourceName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.DATA_CATALOG__RESOURCE_NAME, oldResourceName, resourceName)); + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.DATA_CATALOG__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public EList getVocabs() { + if (vocabs == null) { + vocabs = new EObjectContainmentEList(Vocab.class, this, DataPackage.DATA_CATALOG__VOCABS); + } + return vocabs; + } + + /** + * + * + * @generated + */ + public EList getMixins() { + if (mixins == null) { + mixins = new EObjectContainmentEList(Mixin.class, this, DataPackage.DATA_CATALOG__MIXINS); + } + return mixins; + } + + /** + * + * + * @generated + */ + public EList getTerms() { + if (terms == null) { + terms = new EObjectContainmentEList(Term.class, this, DataPackage.DATA_CATALOG__TERMS); + } + return terms; + } + + /** + * + * + * @generated + */ + public EList getAttributeTypes() { + if (attributeTypes == null) { + attributeTypes = new EObjectContainmentEList(AttributeType.class, this, DataPackage.DATA_CATALOG__ATTRIBUTE_TYPES); + } + return attributeTypes; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case DataPackage.DATA_CATALOG__VOCABS: + return ((InternalEList)getVocabs()).basicRemove(otherEnd, msgs); + case DataPackage.DATA_CATALOG__MIXINS: + return ((InternalEList)getMixins()).basicRemove(otherEnd, msgs); + case DataPackage.DATA_CATALOG__TERMS: + return ((InternalEList)getTerms()).basicRemove(otherEnd, msgs); + case DataPackage.DATA_CATALOG__ATTRIBUTE_TYPES: + return ((InternalEList)getAttributeTypes()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.DATA_CATALOG__BUNDLE: + return getBundle(); + case DataPackage.DATA_CATALOG__RESOURCE_TYPE: + return getResourceType(); + case DataPackage.DATA_CATALOG__RESOURCE_URI: + return getResourceUri(); + case DataPackage.DATA_CATALOG__RESOURCE_NAME: + return getResourceName(); + case DataPackage.DATA_CATALOG__NAME: + return getName(); + case DataPackage.DATA_CATALOG__VOCABS: + return getVocabs(); + case DataPackage.DATA_CATALOG__MIXINS: + return getMixins(); + case DataPackage.DATA_CATALOG__TERMS: + return getTerms(); + case DataPackage.DATA_CATALOG__ATTRIBUTE_TYPES: + return getAttributeTypes(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.DATA_CATALOG__BUNDLE: + setBundle((Bundle)newValue); + return; + case DataPackage.DATA_CATALOG__RESOURCE_TYPE: + setResourceType((ResourceType)newValue); + return; + case DataPackage.DATA_CATALOG__RESOURCE_URI: + setResourceUri((String)newValue); + return; + case DataPackage.DATA_CATALOG__RESOURCE_NAME: + setResourceName((String)newValue); + return; + case DataPackage.DATA_CATALOG__NAME: + setName((String)newValue); + return; + case DataPackage.DATA_CATALOG__VOCABS: + getVocabs().clear(); + getVocabs().addAll((Collection)newValue); + return; + case DataPackage.DATA_CATALOG__MIXINS: + getMixins().clear(); + getMixins().addAll((Collection)newValue); + return; + case DataPackage.DATA_CATALOG__TERMS: + getTerms().clear(); + getTerms().addAll((Collection)newValue); + return; + case DataPackage.DATA_CATALOG__ATTRIBUTE_TYPES: + getAttributeTypes().clear(); + getAttributeTypes().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.DATA_CATALOG__BUNDLE: + setBundle(BUNDLE_EDEFAULT); + return; + case DataPackage.DATA_CATALOG__RESOURCE_TYPE: + setResourceType(RESOURCE_TYPE_EDEFAULT); + return; + case DataPackage.DATA_CATALOG__RESOURCE_URI: + setResourceUri(RESOURCE_URI_EDEFAULT); + return; + case DataPackage.DATA_CATALOG__RESOURCE_NAME: + setResourceName(RESOURCE_NAME_EDEFAULT); + return; + case DataPackage.DATA_CATALOG__NAME: + setName(NAME_EDEFAULT); + return; + case DataPackage.DATA_CATALOG__VOCABS: + getVocabs().clear(); + return; + case DataPackage.DATA_CATALOG__MIXINS: + getMixins().clear(); + return; + case DataPackage.DATA_CATALOG__TERMS: + getTerms().clear(); + return; + case DataPackage.DATA_CATALOG__ATTRIBUTE_TYPES: + getAttributeTypes().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.DATA_CATALOG__BUNDLE: + return BUNDLE_EDEFAULT == null ? bundle != null : !BUNDLE_EDEFAULT.equals(bundle); + case DataPackage.DATA_CATALOG__RESOURCE_TYPE: + return resourceType != RESOURCE_TYPE_EDEFAULT; + case DataPackage.DATA_CATALOG__RESOURCE_URI: + return RESOURCE_URI_EDEFAULT == null ? resourceUri != null : !RESOURCE_URI_EDEFAULT.equals(resourceUri); + case DataPackage.DATA_CATALOG__RESOURCE_NAME: + return RESOURCE_NAME_EDEFAULT == null ? resourceName != null : !RESOURCE_NAME_EDEFAULT.equals(resourceName); + case DataPackage.DATA_CATALOG__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case DataPackage.DATA_CATALOG__VOCABS: + return vocabs != null && !vocabs.isEmpty(); + case DataPackage.DATA_CATALOG__MIXINS: + return mixins != null && !mixins.isEmpty(); + case DataPackage.DATA_CATALOG__TERMS: + return terms != null && !terms.isEmpty(); + case DataPackage.DATA_CATALOG__ATTRIBUTE_TYPES: + return attributeTypes != null && !attributeTypes.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == ResourceAware.class) { + switch (derivedFeatureID) { + case DataPackage.DATA_CATALOG__RESOURCE_TYPE: return CommonsPackage.RESOURCE_AWARE__RESOURCE_TYPE; + case DataPackage.DATA_CATALOG__RESOURCE_URI: return CommonsPackage.RESOURCE_AWARE__RESOURCE_URI; + case DataPackage.DATA_CATALOG__RESOURCE_NAME: return CommonsPackage.RESOURCE_AWARE__RESOURCE_NAME; + default: return -1; + } + } + if (baseClass == Nameable.class) { + switch (derivedFeatureID) { + default: return -1; + } + } + if (baseClass == NameContainer.class) { + switch (derivedFeatureID) { + case DataPackage.DATA_CATALOG__NAME: return CommonsPackage.NAME_CONTAINER__NAME; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == ResourceAware.class) { + switch (baseFeatureID) { + case CommonsPackage.RESOURCE_AWARE__RESOURCE_TYPE: return DataPackage.DATA_CATALOG__RESOURCE_TYPE; + case CommonsPackage.RESOURCE_AWARE__RESOURCE_URI: return DataPackage.DATA_CATALOG__RESOURCE_URI; + case CommonsPackage.RESOURCE_AWARE__RESOURCE_NAME: return DataPackage.DATA_CATALOG__RESOURCE_NAME; + default: return -1; + } + } + if (baseClass == Nameable.class) { + switch (baseFeatureID) { + default: return -1; + } + } + if (baseClass == NameContainer.class) { + switch (baseFeatureID) { + case CommonsPackage.NAME_CONTAINER__NAME: return DataPackage.DATA_CATALOG__NAME; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (bundle: "); + result.append(bundle); + result.append(", resourceType: "); + result.append(resourceType); + result.append(", resourceUri: "); + result.append(resourceUri); + result.append(", resourceName: "); + result.append(resourceName); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //DataCatalogImpl diff --git a/data/src/main/java/org/soluvas/data/impl/DataFactoryImpl.java b/data/src/main/java/org/soluvas/data/impl/DataFactoryImpl.java index 9c04fc4fb..e4fe8e293 100644 --- a/data/src/main/java/org/soluvas/data/impl/DataFactoryImpl.java +++ b/data/src/main/java/org/soluvas/data/impl/DataFactoryImpl.java @@ -2,6 +2,9 @@ */ package org.soluvas.data.impl; +import javax.measure.DecimalMeasure; +import javax.measure.Measure; +import javax.measure.quantity.Quantity; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EObject; @@ -61,6 +64,17 @@ public DataFactoryImpl() { @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { + case DataPackage.VALUE: return (EObject)createValue(); + case DataPackage.MEASURE_VALUE: return (EObject)createMeasureValue(); + case DataPackage.CURRENCY_VALUE: return (EObject)createCurrencyValue(); + case DataPackage.MIXIN: return (EObject)createMixin(); + case DataPackage.RANGE_VALUE: return (EObject)createRangeValue(); + case DataPackage.TERM_VALUE: return (EObject)createTermValue(); + case DataPackage.TERM: return (EObject)createTerm(); + case DataPackage.LIST_VOCAB: return (EObject)createListVocab(); + case DataPackage.TREE_VOCAB: return (EObject)createTreeVocab(); + case DataPackage.FREE_VOCAB: return (EObject)createFreeVocab(); + case DataPackage.DATA_CATALOG: return (EObject)createDataCatalog(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -74,12 +88,18 @@ public EObject create(EClass eClass) { @Override public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { + case DataPackage.ATTRIBUTE_SEMANTIC: + return createAttributeSemanticFromString(eDataType, initialValue); case DataPackage.CRUD_REPOSITORY: return createCrudRepositoryFromString(eDataType, initialValue); case DataPackage.PAGING_AND_SORTING_REPOSITORY: return createPagingAndSortingRepositoryFromString(eDataType, initialValue); case DataPackage.CRUD_REPOSITORY_BASE: return createCrudRepositoryBaseFromString(eDataType, initialValue); + case DataPackage.MEASURE: + return createMeasureFromString(eDataType, initialValue); + case DataPackage.DECIMAL_MEASURE: + return createDecimalMeasureFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } @@ -93,17 +113,153 @@ public Object createFromString(EDataType eDataType, String initialValue) { @Override public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { + case DataPackage.ATTRIBUTE_SEMANTIC: + return convertAttributeSemanticToString(eDataType, instanceValue); case DataPackage.CRUD_REPOSITORY: return convertCrudRepositoryToString(eDataType, instanceValue); case DataPackage.PAGING_AND_SORTING_REPOSITORY: return convertPagingAndSortingRepositoryToString(eDataType, instanceValue); case DataPackage.CRUD_REPOSITORY_BASE: return convertCrudRepositoryBaseToString(eDataType, instanceValue); + case DataPackage.MEASURE: + return convertMeasureToString(eDataType, instanceValue); + case DataPackage.DECIMAL_MEASURE: + return convertDecimalMeasureToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } + /** + * + * + * @generated + */ + public Value createValue() { + ValueImpl value = new ValueImpl(); + return value; + } + + /** + * + * + * @generated + */ + public MeasureValue createMeasureValue() { + MeasureValueImpl measureValue = new MeasureValueImpl(); + return measureValue; + } + + /** + * + * + * @generated + */ + public CurrencyValue createCurrencyValue() { + CurrencyValueImpl currencyValue = new CurrencyValueImpl(); + return currencyValue; + } + + /** + * + * + * @generated + */ + public Mixin createMixin() { + MixinImpl mixin = new MixinImpl(); + return mixin; + } + + /** + * + * + * @generated + */ + public RangeValue createRangeValue() { + RangeValueImpl rangeValue = new RangeValueImpl(); + return rangeValue; + } + + /** + * + * + * @generated + */ + public TermValue createTermValue() { + TermValueImpl termValue = new TermValueImpl(); + return termValue; + } + + /** + * + * + * @generated + */ + public Term createTerm() { + TermImpl term = new TermImpl(); + return term; + } + + /** + * + * + * @generated + */ + public ListVocab createListVocab() { + ListVocabImpl listVocab = new ListVocabImpl(); + return listVocab; + } + + /** + * + * + * @generated + */ + public TreeVocab createTreeVocab() { + TreeVocabImpl treeVocab = new TreeVocabImpl(); + return treeVocab; + } + + /** + * + * + * @generated + */ + public FreeVocab createFreeVocab() { + FreeVocabImpl freeVocab = new FreeVocabImpl(); + return freeVocab; + } + + /** + * + * + * @generated + */ + public DataCatalog createDataCatalog() { + DataCatalogImpl dataCatalog = new DataCatalogImpl(); + return dataCatalog; + } + + /** + * + * + * @generated + */ + public AttributeSemantic createAttributeSemanticFromString(EDataType eDataType, String initialValue) { + AttributeSemantic result = AttributeSemantic.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertAttributeSemanticToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + /** * * @@ -158,6 +314,42 @@ public String convertCrudRepositoryBaseToString(EDataType eDataType, Object inst return super.convertToString(instanceValue); } + /** + * + * + * @generated + */ + public Measure createMeasureFromString(EDataType eDataType, String initialValue) { + return (Measure)super.createFromString(initialValue); + } + + /** + * + * + * @generated + */ + public String convertMeasureToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(instanceValue); + } + + /** + * + * + * @generated + */ + public DecimalMeasure createDecimalMeasureFromString(EDataType eDataType, String initialValue) { + return (DecimalMeasure)super.createFromString(initialValue); + } + + /** + * + * + * @generated + */ + public String convertDecimalMeasureToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(instanceValue); + } + /** * * diff --git a/data/src/main/java/org/soluvas/data/impl/DataPackageImpl.java b/data/src/main/java/org/soluvas/data/impl/DataPackageImpl.java index a47409e63..eb31c947e 100644 --- a/data/src/main/java/org/soluvas/data/impl/DataPackageImpl.java +++ b/data/src/main/java/org/soluvas/data/impl/DataPackageImpl.java @@ -2,16 +2,38 @@ */ package org.soluvas.data.impl; +import javax.measure.DecimalMeasure; +import javax.measure.Measure; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EPackage; - +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.ETypeParameter; +import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.impl.EPackageImpl; - import org.soluvas.commons.CommonsPackage; - +import org.soluvas.data.AttributeSemantic; +import org.soluvas.data.AttributeType; +import org.soluvas.data.CurrencyValue; +import org.soluvas.data.DataCatalog; import org.soluvas.data.DataFactory; import org.soluvas.data.DataPackage; - +import org.soluvas.data.FreeVocab; +import org.soluvas.data.ListVocab; +import org.soluvas.data.MeasureValue; +import org.soluvas.data.Mixin; +import org.soluvas.data.RangeValue; +import org.soluvas.data.Term; +import org.soluvas.data.TermContainer; +import org.soluvas.data.TermValue; +import org.soluvas.data.TreeVocab; +import org.soluvas.data.Value; +import org.soluvas.data.Vocab; import org.soluvas.data.repository.CrudRepository; import org.soluvas.data.repository.CrudRepositoryBase; import org.soluvas.data.repository.PagingAndSortingRepository; @@ -23,6 +45,111 @@ * @generated */ public class DataPackageImpl extends EPackageImpl implements DataPackage { + /** + * + * + * @generated + */ + private EClass attributeTypeEClass = null; + + /** + * + * + * @generated + */ + private EClass valueEClass = null; + + /** + * + * + * @generated + */ + private EClass measureValueEClass = null; + + /** + * + * + * @generated + */ + private EClass currencyValueEClass = null; + + /** + * + * + * @generated + */ + private EClass mixinEClass = null; + + /** + * + * + * @generated + */ + private EClass rangeValueEClass = null; + + /** + * + * + * @generated + */ + private EClass termValueEClass = null; + + /** + * + * + * @generated + */ + private EClass vocabEClass = null; + + /** + * + * + * @generated + */ + private EClass termEClass = null; + + /** + * + * + * @generated + */ + private EClass listVocabEClass = null; + + /** + * + * + * @generated + */ + private EClass treeVocabEClass = null; + + /** + * + * + * @generated + */ + private EClass freeVocabEClass = null; + + /** + * + * + * @generated + */ + private EClass termContainerEClass = null; + + /** + * + * + * @generated + */ + private EClass dataCatalogEClass = null; + + /** + * + * + * @generated + */ + private EEnum attributeSemanticEEnum = null; + /** * * @@ -44,6 +171,20 @@ public class DataPackageImpl extends EPackageImpl implements DataPackage { */ private EDataType crudRepositoryBaseEDataType = null; + /** + * + * + * @generated + */ + private EDataType measureEDataType = null; + + /** + * + * + * @generated + */ + private EDataType decimalMeasureEDataType = null; + /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -113,6 +254,365 @@ public static DataPackage init() { * * @generated */ + @Override + public EClass getAttributeType() { + return attributeTypeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAttributeType_Label() { + return (EAttribute)attributeTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAttributeType_MinValues() { + return (EAttribute)attributeTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAttributeType_MaxValues() { + return (EAttribute)attributeTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAttributeType_DataTypeName() { + return (EAttribute)attributeTypeEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getValue() { + return valueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getValue_Semantic() { + return (EAttribute)valueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getValue_DisplayValue() { + return (EAttribute)valueEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getMeasureValue() { + return measureValueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getMeasureValue_ValueUnit() { + return (EAttribute)measureValueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getMeasureValue_Value() { + return (EAttribute)measureValueEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCurrencyValue() { + return currencyValueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCurrencyValue_CurrencyUnit() { + return (EAttribute)currencyValueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getMixin() { + return mixinEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getMixin_AttributeTypes() { + return (EReference)mixinEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRangeValue() { + return rangeValueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getRangeValue_StartValue() { + return (EAttribute)rangeValueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getRangeValue_EndValue() { + return (EAttribute)rangeValueEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTermValue() { + return termValueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTermValue_Term() { + return (EReference)termValueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTermValue_SlugPath() { + return (EAttribute)termValueEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getTermValue_Value() { + return (EAttribute)termValueEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getVocab() { + return vocabEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getTerm() { + return termEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTerm_Vocab() { + return (EReference)termEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getListVocab() { + return listVocabEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getTreeVocab() { + return treeVocabEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getFreeVocab() { + return freeVocabEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getTermContainer() { + return termContainerEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTermContainer_Terms() { + return (EReference)termContainerEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDataCatalog() { + return dataCatalogEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataCatalog_Vocabs() { + return (EReference)dataCatalogEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataCatalog_Mixins() { + return (EReference)dataCatalogEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataCatalog_Terms() { + return (EReference)dataCatalogEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDataCatalog_AttributeTypes() { + return (EReference)dataCatalogEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EEnum getAttributeSemantic() { + return attributeSemanticEEnum; + } + + /** + * + * + * @generated + */ + @Override public EDataType getCrudRepository() { return crudRepositoryEDataType; } @@ -122,6 +622,7 @@ public EDataType getCrudRepository() { * * @generated */ + @Override public EDataType getPagingAndSortingRepository() { return pagingAndSortingRepositoryEDataType; } @@ -131,6 +632,7 @@ public EDataType getPagingAndSortingRepository() { * * @generated */ + @Override public EDataType getCrudRepositoryBase() { return crudRepositoryBaseEDataType; } @@ -140,6 +642,27 @@ public EDataType getCrudRepositoryBase() { * * @generated */ + @Override + public EDataType getMeasure() { + return measureEDataType; + } + + /** + * + * + * @generated + */ + @Override + public EDataType getDecimalMeasure() { + return decimalMeasureEDataType; + } + + /** + * + * + * @generated + */ + @Override public DataFactory getDataFactory() { return (DataFactory)getEFactoryInstance(); } @@ -162,10 +685,65 @@ public void createPackageContents() { if (isCreated) return; isCreated = true; + // Create classes and their features + attributeTypeEClass = createEClass(ATTRIBUTE_TYPE); + createEAttribute(attributeTypeEClass, ATTRIBUTE_TYPE__LABEL); + createEAttribute(attributeTypeEClass, ATTRIBUTE_TYPE__MIN_VALUES); + createEAttribute(attributeTypeEClass, ATTRIBUTE_TYPE__MAX_VALUES); + createEAttribute(attributeTypeEClass, ATTRIBUTE_TYPE__DATA_TYPE_NAME); + + valueEClass = createEClass(VALUE); + createEAttribute(valueEClass, VALUE__SEMANTIC); + createEAttribute(valueEClass, VALUE__DISPLAY_VALUE); + + measureValueEClass = createEClass(MEASURE_VALUE); + createEAttribute(measureValueEClass, MEASURE_VALUE__VALUE_UNIT); + createEAttribute(measureValueEClass, MEASURE_VALUE__VALUE); + + currencyValueEClass = createEClass(CURRENCY_VALUE); + createEAttribute(currencyValueEClass, CURRENCY_VALUE__CURRENCY_UNIT); + + mixinEClass = createEClass(MIXIN); + createEReference(mixinEClass, MIXIN__ATTRIBUTE_TYPES); + + rangeValueEClass = createEClass(RANGE_VALUE); + createEAttribute(rangeValueEClass, RANGE_VALUE__START_VALUE); + createEAttribute(rangeValueEClass, RANGE_VALUE__END_VALUE); + + termValueEClass = createEClass(TERM_VALUE); + createEReference(termValueEClass, TERM_VALUE__TERM); + createEAttribute(termValueEClass, TERM_VALUE__SLUG_PATH); + createEAttribute(termValueEClass, TERM_VALUE__VALUE); + + vocabEClass = createEClass(VOCAB); + + termEClass = createEClass(TERM); + createEReference(termEClass, TERM__VOCAB); + + listVocabEClass = createEClass(LIST_VOCAB); + + treeVocabEClass = createEClass(TREE_VOCAB); + + freeVocabEClass = createEClass(FREE_VOCAB); + + termContainerEClass = createEClass(TERM_CONTAINER); + createEReference(termContainerEClass, TERM_CONTAINER__TERMS); + + dataCatalogEClass = createEClass(DATA_CATALOG); + createEReference(dataCatalogEClass, DATA_CATALOG__VOCABS); + createEReference(dataCatalogEClass, DATA_CATALOG__MIXINS); + createEReference(dataCatalogEClass, DATA_CATALOG__TERMS); + createEReference(dataCatalogEClass, DATA_CATALOG__ATTRIBUTE_TYPES); + + // Create enums + attributeSemanticEEnum = createEEnum(ATTRIBUTE_SEMANTIC); + // Create data types crudRepositoryEDataType = createEDataType(CRUD_REPOSITORY); pagingAndSortingRepositoryEDataType = createEDataType(PAGING_AND_SORTING_REPOSITORY); crudRepositoryBaseEDataType = createEDataType(CRUD_REPOSITORY_BASE); + measureEDataType = createEDataType(MEASURE); + decimalMeasureEDataType = createEDataType(DECIMAL_MEASURE); } /** @@ -193,11 +771,172 @@ public void initializePackageContents() { // Obtain other dependent packages CommonsPackage theCommonsPackage = (CommonsPackage)EPackage.Registry.INSTANCE.getEPackage(CommonsPackage.eNS_URI); + EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); + + // Create type parameters + ETypeParameter valueEClass_T = addETypeParameter(valueEClass, "T"); + ETypeParameter measureValueEClass_Q = addETypeParameter(measureValueEClass, "Q"); + ETypeParameter rangeValueEClass_T = addETypeParameter(rangeValueEClass, "T"); + addETypeParameter(crudRepositoryEDataType, "T"); + ETypeParameter crudRepositoryEDataType_ID = addETypeParameter(crudRepositoryEDataType, "ID"); + addETypeParameter(pagingAndSortingRepositoryEDataType, "T"); + ETypeParameter pagingAndSortingRepositoryEDataType_ID = addETypeParameter(pagingAndSortingRepositoryEDataType, "ID"); + addETypeParameter(crudRepositoryBaseEDataType, "T"); + ETypeParameter crudRepositoryBaseEDataType_ID = addETypeParameter(crudRepositoryBaseEDataType, "ID"); + addETypeParameter(measureEDataType, "V"); + ETypeParameter measureEDataType_Q = addETypeParameter(measureEDataType, "Q"); + ETypeParameter decimalMeasureEDataType_Q = addETypeParameter(decimalMeasureEDataType, "Q"); + + // Set bounds for type parameters + EGenericType g1 = createEGenericType(theCommonsPackage.getQuantity()); + measureValueEClass_Q.getEBounds().add(g1); + g1 = createEGenericType(theCommonsPackage.getSerializable()); + crudRepositoryEDataType_ID.getEBounds().add(g1); + g1 = createEGenericType(theCommonsPackage.getSerializable()); + pagingAndSortingRepositoryEDataType_ID.getEBounds().add(g1); + g1 = createEGenericType(theCommonsPackage.getSerializable()); + crudRepositoryBaseEDataType_ID.getEBounds().add(g1); + g1 = createEGenericType(theCommonsPackage.getQuantity()); + measureEDataType_Q.getEBounds().add(g1); + g1 = createEGenericType(theCommonsPackage.getQuantity()); + decimalMeasureEDataType_Q.getEBounds().add(g1); + + // Add supertypes to classes + attributeTypeEClass.getESuperTypes().add(theCommonsPackage.getNsPrefixable()); + attributeTypeEClass.getESuperTypes().add(theCommonsPackage.getNameContainer()); + attributeTypeEClass.getESuperTypes().add(theCommonsPackage.getResourceAware()); + attributeTypeEClass.getESuperTypes().add(theCommonsPackage.getBundleAware()); + g1 = createEGenericType(this.getValue()); + EGenericType g2 = createEGenericType(theEcorePackage.getEBigDecimal()); + g1.getETypeArguments().add(g2); + measureValueEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getValue()); + g2 = createEGenericType(theEcorePackage.getEBigDecimal()); + g1.getETypeArguments().add(g2); + currencyValueEClass.getEGenericSuperTypes().add(g1); + mixinEClass.getESuperTypes().add(theCommonsPackage.getNameContainer()); + mixinEClass.getESuperTypes().add(theCommonsPackage.getResourceAware()); + mixinEClass.getESuperTypes().add(theCommonsPackage.getBundleAware()); + mixinEClass.getESuperTypes().add(theCommonsPackage.getNsPrefixable()); + mixinEClass.getESuperTypes().add(theCommonsPackage.getDescribable()); + g1 = createEGenericType(this.getValue()); + g2 = createEGenericType(rangeValueEClass_T); + g1.getETypeArguments().add(g2); + rangeValueEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getValue()); + g2 = createEGenericType(theEcorePackage.getEString()); + g1.getETypeArguments().add(g2); + termValueEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(theCommonsPackage.getIdentifiable()); + termValueEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(theCommonsPackage.getSluggable()); + termValueEClass.getEGenericSuperTypes().add(g1); + vocabEClass.getESuperTypes().add(this.getTermContainer()); + vocabEClass.getESuperTypes().add(theCommonsPackage.getBundleAware()); + vocabEClass.getESuperTypes().add(theCommonsPackage.getResourceAware()); + vocabEClass.getESuperTypes().add(theCommonsPackage.getNsPrefixable()); + vocabEClass.getESuperTypes().add(theCommonsPackage.getDescribable()); + termEClass.getESuperTypes().add(this.getTermContainer()); + termEClass.getESuperTypes().add(theCommonsPackage.getBundleAware()); + termEClass.getESuperTypes().add(theCommonsPackage.getNameContainer()); + termEClass.getESuperTypes().add(theCommonsPackage.getResourceAware()); + listVocabEClass.getESuperTypes().add(this.getVocab()); + treeVocabEClass.getESuperTypes().add(this.getVocab()); + freeVocabEClass.getESuperTypes().add(this.getVocab()); + dataCatalogEClass.getESuperTypes().add(theCommonsPackage.getBundleAware()); + dataCatalogEClass.getESuperTypes().add(theCommonsPackage.getResourceAware()); + dataCatalogEClass.getESuperTypes().add(theCommonsPackage.getNameContainer()); + + // Initialize classes and features; add operations and parameters + initEClass(attributeTypeEClass, AttributeType.class, "AttributeType", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getAttributeType_Label(), ecorePackage.getEString(), "label", null, 0, 1, AttributeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAttributeType_MinValues(), theEcorePackage.getELong(), "minValues", null, 0, 1, AttributeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAttributeType_MaxValues(), theEcorePackage.getELong(), "maxValues", null, 0, 1, AttributeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAttributeType_DataTypeName(), ecorePackage.getEString(), "dataTypeName", null, 0, 1, AttributeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + EOperation op = addEOperation(attributeTypeEClass, this.getValue(), "valueOf", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, theEcorePackage.getEString(), "stringValue", 0, 1, IS_UNIQUE, IS_ORDERED); + + addEOperation(attributeTypeEClass, this.getValue(), "create", 0, 1, IS_UNIQUE, IS_ORDERED); + + addEOperation(attributeTypeEClass, theEcorePackage.getEBoolean(), "isRequired", 0, 1, IS_UNIQUE, IS_ORDERED); + + addEOperation(attributeTypeEClass, theEcorePackage.getEBoolean(), "isMultiple", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(valueEClass, Value.class, "Value", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getValue_Semantic(), this.getAttributeSemantic(), "semantic", null, 0, 1, Value.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getValue_DisplayValue(), ecorePackage.getEString(), "displayValue", null, 0, 1, Value.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + addEOperation(valueEClass, theEcorePackage.getEString(), "getString", 0, 1, IS_UNIQUE, IS_ORDERED); + + op = addEOperation(valueEClass, null, "getValue", 0, 1, IS_UNIQUE, IS_ORDERED); + g1 = createEGenericType(valueEClass_T); + initEOperation(op, g1); + + initEClass(measureValueEClass, MeasureValue.class, "MeasureValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(theCommonsPackage.getUnit()); + g2 = createEGenericType(measureValueEClass_Q); + g1.getETypeArguments().add(g2); + initEAttribute(getMeasureValue_ValueUnit(), g1, "valueUnit", null, 0, 1, MeasureValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getMeasureValue_Value(), theEcorePackage.getEBigDecimal(), "value", null, 0, 1, MeasureValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + op = addEOperation(measureValueEClass, null, "getMeasure", 0, 1, IS_UNIQUE, IS_ORDERED); + g1 = createEGenericType(this.getDecimalMeasure()); + g2 = createEGenericType(measureValueEClass_Q); + g1.getETypeArguments().add(g2); + initEOperation(op, g1); + + initEClass(currencyValueEClass, CurrencyValue.class, "CurrencyValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getCurrencyValue_CurrencyUnit(), theCommonsPackage.getCurrencyUnit(), "currencyUnit", null, 0, 1, CurrencyValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(mixinEClass, Mixin.class, "Mixin", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getMixin_AttributeTypes(), this.getAttributeType(), null, "attributeTypes", null, 0, -1, Mixin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(rangeValueEClass, RangeValue.class, "RangeValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(rangeValueEClass_T); + initEAttribute(getRangeValue_StartValue(), g1, "startValue", null, 0, 1, RangeValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(rangeValueEClass_T); + initEAttribute(getRangeValue_EndValue(), g1, "endValue", null, 0, 1, RangeValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(termValueEClass, TermValue.class, "TermValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getTermValue_Term(), this.getTerm(), null, "term", null, 0, 1, TermValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTermValue_SlugPath(), theEcorePackage.getEString(), "slugPath", null, 0, 1, TermValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTermValue_Value(), theEcorePackage.getEString(), "value", null, 0, 1, TermValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(vocabEClass, Vocab.class, "Vocab", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(termEClass, Term.class, "Term", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getTerm_Vocab(), this.getVocab(), null, "vocab", null, 0, 1, Term.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(listVocabEClass, ListVocab.class, "ListVocab", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(treeVocabEClass, TreeVocab.class, "TreeVocab", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(freeVocabEClass, FreeVocab.class, "FreeVocab", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(termContainerEClass, TermContainer.class, "TermContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getTermContainer_Terms(), this.getTerm(), null, "terms", null, 0, -1, TermContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(dataCatalogEClass, DataCatalog.class, "DataCatalog", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getDataCatalog_Vocabs(), this.getVocab(), null, "vocabs", null, 0, -1, DataCatalog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDataCatalog_Mixins(), this.getMixin(), null, "mixins", null, 0, -1, DataCatalog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDataCatalog_Terms(), this.getTerm(), null, "terms", null, 0, -1, DataCatalog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDataCatalog_AttributeTypes(), this.getAttributeType(), null, "attributeTypes", null, 0, -1, DataCatalog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(attributeSemanticEEnum, AttributeSemantic.class, "AttributeSemantic"); + addEEnumLiteral(attributeSemanticEEnum, AttributeSemantic.EQUAL); + addEEnumLiteral(attributeSemanticEEnum, AttributeSemantic.LESS_THAN); + addEEnumLiteral(attributeSemanticEEnum, AttributeSemantic.LESS_THAN_OR_EQUAL); + addEEnumLiteral(attributeSemanticEEnum, AttributeSemantic.GREATER_THAN); + addEEnumLiteral(attributeSemanticEEnum, AttributeSemantic.GREATER_THAN_OR_EQUAL); // Initialize data types initEDataType(crudRepositoryEDataType, CrudRepository.class, "CrudRepository", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(pagingAndSortingRepositoryEDataType, PagingAndSortingRepository.class, "PagingAndSortingRepository", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(crudRepositoryBaseEDataType, CrudRepositoryBase.class, "CrudRepositoryBase", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(measureEDataType, Measure.class, "Measure", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(decimalMeasureEDataType, DecimalMeasure.class, "DecimalMeasure", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); @@ -205,6 +944,8 @@ public void initializePackageContents() { // Create annotations // http://www.eclipse.org/emf/2002/GenModel createGenModelAnnotations(); + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); } /** @@ -216,40 +957,146 @@ public void initializePackageContents() { protected void createGenModelAnnotations() { String source = "http://www.eclipse.org/emf/2002/GenModel"; addAnnotation - (null, + (attributeTypeEClass, + source, + new String[] { + "documentation", "EXPERIMENTAL.\n\nTwo/three approaches:\n\n1. Mixin must be statically designed into Ecore EClass, e.g. BerbatikBags, which inherits from BerbatikMixin (inherits ClothingMixin = SizeMixin + ColorMixin), BatikMixin, and BagsMixin. The upside is all attributes/references merge into the EObject. Downside is we need to permutate all combinations into EClass.\nNot sure yet how it goes with MongoDB, JSON, and XMI import/export. Not sure yet how it goes with VariedProduct, BundleProduct, SubscribedProduct, SharedProduct, etc.\n\n2. Mixin is dynamic. Each product object maintain a list of MixinTypes (which is by default specified when the product is created), and filled mixins are put in an EList. Mixins can be added and removed during runtime, without any build-time project rebuild or EMF regeneration.\nSo store owner, even staff, can define new mixin and manipulate existing products with ease. No Mall admin or schema changes required.\nStore staff can browse available mixin types and just add any mixin they want.\nSimilar approach with Drupal taxonomy or JCR mixin. Magento is more restrictive because of its inflexible AttributeSet concept. Mixin is like AttributeSet but with cardinality 0..*.\nProbably need better name than mixin though.\nSeems to be most flexible, for Jackson we can have custom converter. My concern is MongoDB and XMI.\nNot sure yet how it goes with MongoDB, JSON, and XMI import/export. Not sure yet how it goes with VariedProduct, BundleProduct, SubscribedProduct, SharedProduct, etc.\n\n3. Hybrid #1. Mixin is by default static, which hopefully covers 80% use case.\nWhen you want dynamic, you can add more mixins.\nBut ain\'t this too complicated?\nOn the web client side, it\'s also more work. Not to mention inventory, etc. integration with other systems.\nProductInfo & principal etc. also use the fully dynamic approach.\n\n4. Hybrid #2. Mixin is by default dynamic, which covers 80% of the customization.\nAnd for things like category, tag, color, size, they\'re static, with code support. i.e. must be generated by EMF.\n" + }); + addAnnotation + (attributeTypeEClass.getEOperations().get(0), + source, + new String[] { + "documentation", "Convert the string value to a mixin instance." + }); + addAnnotation + (attributeTypeEClass.getEOperations().get(2), source, new String[] { - "documentation", "Object type of the data structure values." + "documentation", "True if minValues > 0." }); addAnnotation - (null, + (attributeTypeEClass.getEOperations().get(3), source, new String[] { - "documentation", "ID type of the data structure identifiers, usually String." + "documentation", "true if maxValues is > 1." }); addAnnotation - (null, + (getAttributeType_MinValues(), source, new String[] { - "documentation", "Object type of the data structure values." + "documentation", "0 means optional, 1 means required, and so on." }); addAnnotation - (null, + (getAttributeType_MaxValues(), source, new String[] { - "documentation", "ID type of the data structure identifiers, usually String." + "documentation", "1 means singular. -1 means no maximum number of values." }); addAnnotation - (null, + (valueEClass, source, new String[] { - "documentation", "Object type of the data structure values." + "documentation", "Attribute having single or multiple values.\n\n{\nattributes:\n color: [{value: \"red\", displayValue: \"Merah\"}],\n berbatikMaterial: [{value: \"katun\", displayValue: \"Katun\"}],\n berbatikShawlLength: [{value: \"90cm\", displayValue: \"90 cm\"}],\nmixins: {\n \"color\": {\n attributeTypes: {\n color: {className: \"TermValue\", \"name\": \"color\", \"label\": \"Warna\"}, // nsPrefix: builtin\n },\n \"berbatik\": {\n attributeTypes: {\n berbatikMaterial: {className: \"TermValue\", nsPrefix: \"berbatik\", name: \"material\", label: \"Material\"},\n berbatikBatikAge: {className: \"TermValue\", nsPrefix: \"berbatik\", name: \"batikAge\", label: \"Batik Age\"},\n }\n },\n}\n\n\n\"berbatik:material\": [{value: \"Katun\"}],\n\nnggak enak:\nproduct[\'berbatik:material\'][0].displayValue\n\nlebih enak:\n\n

Warna: {{product.attributes.color.0.displayValue}}

\n

Material: {{product.attributes.berbatikMaterial.0.displayValue}}

\n" }); addAnnotation - (null, + (valueEClass.getEOperations().get(0), + source, + new String[] { + "documentation", "Convert the mixin value to a single string. Paths are separated with \'/\'. Ranges are separated with \"-\" or \"..\" (TODO: which one?).\nSemantics are prefixed: \"<\", \"<=\", \">\", \">=\". equal \"=\" is default if not specified.\n\n

9 cm would be \"9cm\". Bags > Hobos would be \"bags_hobos\" (using ID) or \"bags/hobos\" (using slugPath).\n\n

9 cm, 20 km would be \"9cm,20km\".\n\n

\"2012-12-30-2012-12-30\"\n\"2012-12-30..2012-12-30\"\n\"2012-12-30T15:15:70.863+0700-2012-12-30T15:15:70.863+0700\"\n\"2012-12-30T15:15:70.863+0700..2012-12-30T15:15:70.863+0700\"\n\"atang-sutisna-rudi-wijaya\"\n\"atang-sutisna..rudi-wijaya\"\n\"atang_sutisna-rudi_wijaya\"\n\"atang_sutisna..rudi_wijaya\"\n" + }); + addAnnotation + (valueEClass.getEOperations().get(1), + source, + new String[] { + "documentation", "Primary value of the attribute in native type. There may be complementary values like unit.\nIn multiple attribute values, this returns the first value.\n\n

Note: setting the value will clear all values and reset to a list with 1 element." + }); + addAnnotation + (getValue_Semantic(), + source, + new String[] { + "documentation", "Optional semantic of this value.\n\ni.e. value = 50 cm, semantic = less than, means \"< 50 cm\"." + }); + addAnnotation + (measureValueEClass, + source, + new String[] { + "documentation", "Mixin with measured unit." + }); + addAnnotation + (currencyValueEClass, + source, + new String[] { + "documentation", "Mixin with monetary value and currency code." + }); + addAnnotation + (rangeValueEClass, + source, + new String[] { + "documentation", "Range attribute\'s primary value can be either the start or end value." + }); + addAnnotation + (termValueEClass, + source, + new String[] { + "documentation", "Use a taxonomy term. \'value\' is the ID of the term." + }); + addAnnotation + (getTermValue_SlugPath(), + source, + new String[] { + "documentation", "\'/\'-separated slug path." + }); + addAnnotation + (vocabEClass, + source, + new String[] { + "documentation", "pindah jd attributetype." + }); + addAnnotation + (getTermContainer_Terms(), + source, + new String[] { + "documentation", "List of terms in a Vocabulary or if the Term is nested (tree vocabulary)." + }); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation + (vocabEClass, + source, + new String[] { + "name", "Vocab" + }); + addAnnotation + (listVocabEClass, + source, + new String[] { + "name", "ListVocab" + }); + addAnnotation + (treeVocabEClass, + source, + new String[] { + "name", "TreeVocab" + }); + addAnnotation + (freeVocabEClass, + source, + new String[] { + "name", "FreeVocab" + }); + addAnnotation + (dataCatalogEClass, source, new String[] { - "documentation", "ID type of the data structure identifiers, usually String." + "name", "DataCatalog" }); } diff --git a/data/src/main/java/org/soluvas/data/impl/FreeVocabImpl.java b/data/src/main/java/org/soluvas/data/impl/FreeVocabImpl.java new file mode 100644 index 000000000..25bee73ec --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/FreeVocabImpl.java @@ -0,0 +1,39 @@ +/** + */ +package org.soluvas.data.impl; + +import org.eclipse.emf.ecore.EClass; + +import org.soluvas.data.DataPackage; +import org.soluvas.data.FreeVocab; + +/** + * + * An implementation of the model object 'Free Vocab'. + * + *

+ *

+ * + * @generated + */ +public class FreeVocabImpl extends VocabImpl implements FreeVocab { + /** + * + * + * @generated + */ + public FreeVocabImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.FREE_VOCAB; + } + +} //FreeVocabImpl diff --git a/data/src/main/java/org/soluvas/data/impl/ListVocabImpl.java b/data/src/main/java/org/soluvas/data/impl/ListVocabImpl.java new file mode 100644 index 000000000..c7f519a23 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/ListVocabImpl.java @@ -0,0 +1,39 @@ +/** + */ +package org.soluvas.data.impl; + +import org.eclipse.emf.ecore.EClass; + +import org.soluvas.data.DataPackage; +import org.soluvas.data.ListVocab; + +/** + * + * An implementation of the model object 'List Vocab'. + * + *

+ *

+ * + * @generated + */ +public class ListVocabImpl extends VocabImpl implements ListVocab { + /** + * + * + * @generated + */ + public ListVocabImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.LIST_VOCAB; + } + +} //ListVocabImpl diff --git a/data/src/main/java/org/soluvas/data/impl/MeasureValueImpl.java b/data/src/main/java/org/soluvas/data/impl/MeasureValueImpl.java new file mode 100644 index 000000000..f17659ba6 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/MeasureValueImpl.java @@ -0,0 +1,241 @@ +/** + */ +package org.soluvas.data.impl; + +import java.math.BigDecimal; + +import javax.measure.DecimalMeasure; +import javax.measure.quantity.Quantity; +import javax.measure.unit.Unit; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.soluvas.data.DataPackage; +import org.soluvas.data.MeasureValue; + +/** + * + * An implementation of the model object 'Measure Value'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.MeasureValueImpl#getValueUnit Value Unit}
  • + *
  • {@link org.soluvas.data.impl.MeasureValueImpl#getValue Value}
  • + *
+ *

+ * + * @generated + */ +public class MeasureValueImpl extends ValueImpl implements MeasureValue { + /** + * The cached value of the '{@link #getValueUnit() Value Unit}' attribute. + * + * + * @see #getValueUnit() + * @generated + * @ordered + */ + protected Unit valueUnit; + + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final BigDecimal VALUE_EDEFAULT = null; + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected BigDecimal value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + public MeasureValueImpl() { + super(); + } + + public MeasureValueImpl(DecimalMeasure measure) { + super(); + setValue(measure.getValue()); + setValueUnit(measure.getUnit()); + } + + public MeasureValueImpl(Unit unit, BigDecimal value) { + super(); + setValue(value); + setValueUnit(unit); + } + + public MeasureValueImpl(Unit unit, double value) { + super(); + setValue(new BigDecimal(value)); + setValueUnit(unit); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.MEASURE_VALUE; + } + + /** + * + * + * @generated + */ + @Override + public Unit getValueUnit() { + return valueUnit; + } + + /** + * + * + * @generated + */ + public void setValueUnit(Unit newValueUnit) { + Unit oldValueUnit = valueUnit; + valueUnit = newValueUnit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MEASURE_VALUE__VALUE_UNIT, oldValueUnit, valueUnit)); + } + + /** + * + * + * @generated + */ + public BigDecimal getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(BigDecimal newValue) { + BigDecimal oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MEASURE_VALUE__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public DecimalMeasure getMeasure() { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.MEASURE_VALUE__VALUE_UNIT: + return getValueUnit(); + case DataPackage.MEASURE_VALUE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.MEASURE_VALUE__VALUE_UNIT: + setValueUnit((Unit)newValue); + return; + case DataPackage.MEASURE_VALUE__VALUE: + setValue((BigDecimal)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.MEASURE_VALUE__VALUE_UNIT: + setValueUnit((Unit)null); + return; + case DataPackage.MEASURE_VALUE__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.MEASURE_VALUE__VALUE_UNIT: + return valueUnit != null; + case DataPackage.MEASURE_VALUE__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (valueUnit: "); + result.append(valueUnit); + result.append(", value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} //MeasureValueImpl diff --git a/data/src/main/java/org/soluvas/data/impl/MixinImpl.java b/data/src/main/java/org/soluvas/data/impl/MixinImpl.java new file mode 100644 index 000000000..b2e8b4151 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/MixinImpl.java @@ -0,0 +1,610 @@ +/** + */ +package org.soluvas.data.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import org.osgi.framework.Bundle; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.CommonsPackage; +import org.soluvas.commons.Describable; +import org.soluvas.commons.NsPrefixable; +import org.soluvas.commons.ResourceAware; +import org.soluvas.commons.ResourceType; + +import org.soluvas.data.AttributeType; +import org.soluvas.data.DataPackage; +import org.soluvas.data.Mixin; + +/** + * + * An implementation of the model object 'Mixin'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.MixinImpl#getName Name}
  • + *
  • {@link org.soluvas.data.impl.MixinImpl#getResourceType Resource Type}
  • + *
  • {@link org.soluvas.data.impl.MixinImpl#getResourceUri Resource Uri}
  • + *
  • {@link org.soluvas.data.impl.MixinImpl#getResourceName Resource Name}
  • + *
  • {@link org.soluvas.data.impl.MixinImpl#getBundle Bundle}
  • + *
  • {@link org.soluvas.data.impl.MixinImpl#getNsPrefix Ns Prefix}
  • + *
  • {@link org.soluvas.data.impl.MixinImpl#getDescription Description}
  • + *
  • {@link org.soluvas.data.impl.MixinImpl#getAttributeTypes Attribute Types}
  • + *
+ *

+ * + * @generated + */ +public class MixinImpl extends EObjectImpl implements Mixin { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getResourceType() Resource Type}' attribute. + * + * + * @see #getResourceType() + * @generated + * @ordered + */ + protected static final ResourceType RESOURCE_TYPE_EDEFAULT = ResourceType.BUNDLE; + + /** + * The cached value of the '{@link #getResourceType() Resource Type}' attribute. + * + * + * @see #getResourceType() + * @generated + * @ordered + */ + protected ResourceType resourceType = RESOURCE_TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getResourceUri() Resource Uri}' attribute. + * + * + * @see #getResourceUri() + * @generated + * @ordered + */ + protected static final String RESOURCE_URI_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResourceUri() Resource Uri}' attribute. + * + * + * @see #getResourceUri() + * @generated + * @ordered + */ + protected String resourceUri = RESOURCE_URI_EDEFAULT; + + /** + * The default value of the '{@link #getResourceName() Resource Name}' attribute. + * + * + * @see #getResourceName() + * @generated + * @ordered + */ + protected static final String RESOURCE_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResourceName() Resource Name}' attribute. + * + * + * @see #getResourceName() + * @generated + * @ordered + */ + protected String resourceName = RESOURCE_NAME_EDEFAULT; + + /** + * The default value of the '{@link #getBundle() Bundle}' attribute. + * + * + * @see #getBundle() + * @generated + * @ordered + */ + protected static final Bundle BUNDLE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getBundle() Bundle}' attribute. + * + * + * @see #getBundle() + * @generated + * @ordered + */ + protected Bundle bundle = BUNDLE_EDEFAULT; + + /** + * The default value of the '{@link #getNsPrefix() Ns Prefix}' attribute. + * + * + * @see #getNsPrefix() + * @generated + * @ordered + */ + protected static final String NS_PREFIX_EDEFAULT = null; + + /** + * The cached value of the '{@link #getNsPrefix() Ns Prefix}' attribute. + * + * + * @see #getNsPrefix() + * @generated + * @ordered + */ + protected String nsPrefix = NS_PREFIX_EDEFAULT; + + /** + * The default value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected static final String DESCRIPTION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected String description = DESCRIPTION_EDEFAULT; + + /** + * The cached value of the '{@link #getAttributeTypes() Attribute Types}' reference list. + * + * + * @see #getAttributeTypes() + * @generated + * @ordered + */ + protected EList attributeTypes; + + /** + * + * + * @generated + */ + public MixinImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.MIXIN; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MIXIN__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public ResourceType getResourceType() { + return resourceType; + } + + /** + * + * + * @generated + */ + public void setResourceType(ResourceType newResourceType) { + ResourceType oldResourceType = resourceType; + resourceType = newResourceType == null ? RESOURCE_TYPE_EDEFAULT : newResourceType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MIXIN__RESOURCE_TYPE, oldResourceType, resourceType)); + } + + /** + * + * + * @generated + */ + public String getResourceUri() { + return resourceUri; + } + + /** + * + * + * @generated + */ + public void setResourceUri(String newResourceUri) { + String oldResourceUri = resourceUri; + resourceUri = newResourceUri; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MIXIN__RESOURCE_URI, oldResourceUri, resourceUri)); + } + + /** + * + * + * @generated + */ + public String getResourceName() { + return resourceName; + } + + /** + * + * + * @generated + */ + public void setResourceName(String newResourceName) { + String oldResourceName = resourceName; + resourceName = newResourceName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MIXIN__RESOURCE_NAME, oldResourceName, resourceName)); + } + + /** + * + * + * @generated + */ + public Bundle getBundle() { + return bundle; + } + + /** + * + * + * @generated + */ + public void setBundle(Bundle newBundle) { + Bundle oldBundle = bundle; + bundle = newBundle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MIXIN__BUNDLE, oldBundle, bundle)); + } + + /** + * + * + * @generated + */ + public String getNsPrefix() { + return nsPrefix; + } + + /** + * + * + * @generated + */ + public void setNsPrefix(String newNsPrefix) { + String oldNsPrefix = nsPrefix; + nsPrefix = newNsPrefix; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MIXIN__NS_PREFIX, oldNsPrefix, nsPrefix)); + } + + /** + * + * + * @generated + */ + public String getDescription() { + return description; + } + + /** + * + * + * @generated + */ + public void setDescription(String newDescription) { + String oldDescription = description; + description = newDescription; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.MIXIN__DESCRIPTION, oldDescription, description)); + } + + /** + * + * + * @generated + */ + public EList getAttributeTypes() { + if (attributeTypes == null) { + attributeTypes = new EObjectResolvingEList(AttributeType.class, this, DataPackage.MIXIN__ATTRIBUTE_TYPES); + } + return attributeTypes; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.MIXIN__NAME: + return getName(); + case DataPackage.MIXIN__RESOURCE_TYPE: + return getResourceType(); + case DataPackage.MIXIN__RESOURCE_URI: + return getResourceUri(); + case DataPackage.MIXIN__RESOURCE_NAME: + return getResourceName(); + case DataPackage.MIXIN__BUNDLE: + return getBundle(); + case DataPackage.MIXIN__NS_PREFIX: + return getNsPrefix(); + case DataPackage.MIXIN__DESCRIPTION: + return getDescription(); + case DataPackage.MIXIN__ATTRIBUTE_TYPES: + return getAttributeTypes(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.MIXIN__NAME: + setName((String)newValue); + return; + case DataPackage.MIXIN__RESOURCE_TYPE: + setResourceType((ResourceType)newValue); + return; + case DataPackage.MIXIN__RESOURCE_URI: + setResourceUri((String)newValue); + return; + case DataPackage.MIXIN__RESOURCE_NAME: + setResourceName((String)newValue); + return; + case DataPackage.MIXIN__BUNDLE: + setBundle((Bundle)newValue); + return; + case DataPackage.MIXIN__NS_PREFIX: + setNsPrefix((String)newValue); + return; + case DataPackage.MIXIN__DESCRIPTION: + setDescription((String)newValue); + return; + case DataPackage.MIXIN__ATTRIBUTE_TYPES: + getAttributeTypes().clear(); + getAttributeTypes().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.MIXIN__NAME: + setName(NAME_EDEFAULT); + return; + case DataPackage.MIXIN__RESOURCE_TYPE: + setResourceType(RESOURCE_TYPE_EDEFAULT); + return; + case DataPackage.MIXIN__RESOURCE_URI: + setResourceUri(RESOURCE_URI_EDEFAULT); + return; + case DataPackage.MIXIN__RESOURCE_NAME: + setResourceName(RESOURCE_NAME_EDEFAULT); + return; + case DataPackage.MIXIN__BUNDLE: + setBundle(BUNDLE_EDEFAULT); + return; + case DataPackage.MIXIN__NS_PREFIX: + setNsPrefix(NS_PREFIX_EDEFAULT); + return; + case DataPackage.MIXIN__DESCRIPTION: + setDescription(DESCRIPTION_EDEFAULT); + return; + case DataPackage.MIXIN__ATTRIBUTE_TYPES: + getAttributeTypes().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.MIXIN__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case DataPackage.MIXIN__RESOURCE_TYPE: + return resourceType != RESOURCE_TYPE_EDEFAULT; + case DataPackage.MIXIN__RESOURCE_URI: + return RESOURCE_URI_EDEFAULT == null ? resourceUri != null : !RESOURCE_URI_EDEFAULT.equals(resourceUri); + case DataPackage.MIXIN__RESOURCE_NAME: + return RESOURCE_NAME_EDEFAULT == null ? resourceName != null : !RESOURCE_NAME_EDEFAULT.equals(resourceName); + case DataPackage.MIXIN__BUNDLE: + return BUNDLE_EDEFAULT == null ? bundle != null : !BUNDLE_EDEFAULT.equals(bundle); + case DataPackage.MIXIN__NS_PREFIX: + return NS_PREFIX_EDEFAULT == null ? nsPrefix != null : !NS_PREFIX_EDEFAULT.equals(nsPrefix); + case DataPackage.MIXIN__DESCRIPTION: + return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); + case DataPackage.MIXIN__ATTRIBUTE_TYPES: + return attributeTypes != null && !attributeTypes.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == ResourceAware.class) { + switch (derivedFeatureID) { + case DataPackage.MIXIN__RESOURCE_TYPE: return CommonsPackage.RESOURCE_AWARE__RESOURCE_TYPE; + case DataPackage.MIXIN__RESOURCE_URI: return CommonsPackage.RESOURCE_AWARE__RESOURCE_URI; + case DataPackage.MIXIN__RESOURCE_NAME: return CommonsPackage.RESOURCE_AWARE__RESOURCE_NAME; + default: return -1; + } + } + if (baseClass == BundleAware.class) { + switch (derivedFeatureID) { + case DataPackage.MIXIN__BUNDLE: return CommonsPackage.BUNDLE_AWARE__BUNDLE; + default: return -1; + } + } + if (baseClass == NsPrefixable.class) { + switch (derivedFeatureID) { + case DataPackage.MIXIN__NS_PREFIX: return CommonsPackage.NS_PREFIXABLE__NS_PREFIX; + default: return -1; + } + } + if (baseClass == Describable.class) { + switch (derivedFeatureID) { + case DataPackage.MIXIN__DESCRIPTION: return CommonsPackage.DESCRIBABLE__DESCRIPTION; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == ResourceAware.class) { + switch (baseFeatureID) { + case CommonsPackage.RESOURCE_AWARE__RESOURCE_TYPE: return DataPackage.MIXIN__RESOURCE_TYPE; + case CommonsPackage.RESOURCE_AWARE__RESOURCE_URI: return DataPackage.MIXIN__RESOURCE_URI; + case CommonsPackage.RESOURCE_AWARE__RESOURCE_NAME: return DataPackage.MIXIN__RESOURCE_NAME; + default: return -1; + } + } + if (baseClass == BundleAware.class) { + switch (baseFeatureID) { + case CommonsPackage.BUNDLE_AWARE__BUNDLE: return DataPackage.MIXIN__BUNDLE; + default: return -1; + } + } + if (baseClass == NsPrefixable.class) { + switch (baseFeatureID) { + case CommonsPackage.NS_PREFIXABLE__NS_PREFIX: return DataPackage.MIXIN__NS_PREFIX; + default: return -1; + } + } + if (baseClass == Describable.class) { + switch (baseFeatureID) { + case CommonsPackage.DESCRIBABLE__DESCRIPTION: return DataPackage.MIXIN__DESCRIPTION; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", resourceType: "); + result.append(resourceType); + result.append(", resourceUri: "); + result.append(resourceUri); + result.append(", resourceName: "); + result.append(resourceName); + result.append(", bundle: "); + result.append(bundle); + result.append(", nsPrefix: "); + result.append(nsPrefix); + result.append(", description: "); + result.append(description); + result.append(')'); + return result.toString(); + } + +} //MixinImpl diff --git a/data/src/main/java/org/soluvas/data/impl/RangeValueImpl.java b/data/src/main/java/org/soluvas/data/impl/RangeValueImpl.java new file mode 100644 index 000000000..fd328b2e1 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/RangeValueImpl.java @@ -0,0 +1,197 @@ +/** + */ +package org.soluvas.data.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.soluvas.data.DataPackage; +import org.soluvas.data.RangeValue; + +/** + * + * An implementation of the model object 'Range Value'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.RangeValueImpl#getStartValue Start Value}
  • + *
  • {@link org.soluvas.data.impl.RangeValueImpl#getEndValue End Value}
  • + *
+ *

+ * + * @generated + */ +public class RangeValueImpl extends ValueImpl implements RangeValue { + /** + * The cached value of the '{@link #getStartValue() Start Value}' attribute. + * + * + * @see #getStartValue() + * @generated + * @ordered + */ + protected T startValue; + + /** + * The cached value of the '{@link #getEndValue() End Value}' attribute. + * + * + * @see #getEndValue() + * @generated + * @ordered + */ + protected T endValue; + + /** + * + * + * @generated + */ + public RangeValueImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.RANGE_VALUE; + } + + /** + * + * + * @generated + */ + public T getStartValue() { + return startValue; + } + + /** + * + * + * @generated + */ + public void setStartValue(T newStartValue) { + T oldStartValue = startValue; + startValue = newStartValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.RANGE_VALUE__START_VALUE, oldStartValue, startValue)); + } + + /** + * + * + * @generated + */ + public T getEndValue() { + return endValue; + } + + /** + * + * + * @generated + */ + public void setEndValue(T newEndValue) { + T oldEndValue = endValue; + endValue = newEndValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.RANGE_VALUE__END_VALUE, oldEndValue, endValue)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.RANGE_VALUE__START_VALUE: + return getStartValue(); + case DataPackage.RANGE_VALUE__END_VALUE: + return getEndValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.RANGE_VALUE__START_VALUE: + setStartValue((T)newValue); + return; + case DataPackage.RANGE_VALUE__END_VALUE: + setEndValue((T)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.RANGE_VALUE__START_VALUE: + setStartValue((T)null); + return; + case DataPackage.RANGE_VALUE__END_VALUE: + setEndValue((T)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.RANGE_VALUE__START_VALUE: + return startValue != null; + case DataPackage.RANGE_VALUE__END_VALUE: + return endValue != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (startValue: "); + result.append(startValue); + result.append(", endValue: "); + result.append(endValue); + result.append(')'); + return result.toString(); + } + +} //RangeValueImpl diff --git a/data/src/main/java/org/soluvas/data/impl/TermImpl.java b/data/src/main/java/org/soluvas/data/impl/TermImpl.java new file mode 100644 index 000000000..13f710fbf --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/TermImpl.java @@ -0,0 +1,562 @@ +/** + */ +package org.soluvas.data.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import org.osgi.framework.Bundle; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.CommonsPackage; +import org.soluvas.commons.NameContainer; +import org.soluvas.commons.Nameable; +import org.soluvas.commons.ResourceAware; +import org.soluvas.commons.ResourceType; + +import org.soluvas.data.DataPackage; +import org.soluvas.data.Term; +import org.soluvas.data.Vocab; + +/** + * + * An implementation of the model object 'Term'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.TermImpl#getTerms Terms}
  • + *
  • {@link org.soluvas.data.impl.TermImpl#getBundle Bundle}
  • + *
  • {@link org.soluvas.data.impl.TermImpl#getName Name}
  • + *
  • {@link org.soluvas.data.impl.TermImpl#getResourceType Resource Type}
  • + *
  • {@link org.soluvas.data.impl.TermImpl#getResourceUri Resource Uri}
  • + *
  • {@link org.soluvas.data.impl.TermImpl#getResourceName Resource Name}
  • + *
  • {@link org.soluvas.data.impl.TermImpl#getVocab Vocab}
  • + *
+ *

+ * + * @generated + */ +public class TermImpl extends EObjectImpl implements Term { + /** + * The cached value of the '{@link #getTerms() Terms}' reference list. + * + * + * @see #getTerms() + * @generated + * @ordered + */ + protected EList terms; + + /** + * The default value of the '{@link #getBundle() Bundle}' attribute. + * + * + * @see #getBundle() + * @generated + * @ordered + */ + protected static final Bundle BUNDLE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getBundle() Bundle}' attribute. + * + * + * @see #getBundle() + * @generated + * @ordered + */ + protected Bundle bundle = BUNDLE_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getResourceType() Resource Type}' attribute. + * + * + * @see #getResourceType() + * @generated + * @ordered + */ + protected static final ResourceType RESOURCE_TYPE_EDEFAULT = ResourceType.BUNDLE; + + /** + * The cached value of the '{@link #getResourceType() Resource Type}' attribute. + * + * + * @see #getResourceType() + * @generated + * @ordered + */ + protected ResourceType resourceType = RESOURCE_TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getResourceUri() Resource Uri}' attribute. + * + * + * @see #getResourceUri() + * @generated + * @ordered + */ + protected static final String RESOURCE_URI_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResourceUri() Resource Uri}' attribute. + * + * + * @see #getResourceUri() + * @generated + * @ordered + */ + protected String resourceUri = RESOURCE_URI_EDEFAULT; + + /** + * The default value of the '{@link #getResourceName() Resource Name}' attribute. + * + * + * @see #getResourceName() + * @generated + * @ordered + */ + protected static final String RESOURCE_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResourceName() Resource Name}' attribute. + * + * + * @see #getResourceName() + * @generated + * @ordered + */ + protected String resourceName = RESOURCE_NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getVocab() Vocab}' reference. + * + * + * @see #getVocab() + * @generated + * @ordered + */ + protected Vocab vocab; + + /** + * + * + * @generated + */ + public TermImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.TERM; + } + + /** + * + * + * @generated + */ + public EList getTerms() { + if (terms == null) { + terms = new EObjectResolvingEList(Term.class, this, DataPackage.TERM__TERMS); + } + return terms; + } + + /** + * + * + * @generated + */ + public Bundle getBundle() { + return bundle; + } + + /** + * + * + * @generated + */ + public void setBundle(Bundle newBundle) { + Bundle oldBundle = bundle; + bundle = newBundle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM__BUNDLE, oldBundle, bundle)); + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public ResourceType getResourceType() { + return resourceType; + } + + /** + * + * + * @generated + */ + public void setResourceType(ResourceType newResourceType) { + ResourceType oldResourceType = resourceType; + resourceType = newResourceType == null ? RESOURCE_TYPE_EDEFAULT : newResourceType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM__RESOURCE_TYPE, oldResourceType, resourceType)); + } + + /** + * + * + * @generated + */ + public String getResourceUri() { + return resourceUri; + } + + /** + * + * + * @generated + */ + public void setResourceUri(String newResourceUri) { + String oldResourceUri = resourceUri; + resourceUri = newResourceUri; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM__RESOURCE_URI, oldResourceUri, resourceUri)); + } + + /** + * + * + * @generated + */ + public String getResourceName() { + return resourceName; + } + + /** + * + * + * @generated + */ + public void setResourceName(String newResourceName) { + String oldResourceName = resourceName; + resourceName = newResourceName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM__RESOURCE_NAME, oldResourceName, resourceName)); + } + + /** + * + * + * @generated + */ + public Vocab getVocab() { + if (vocab != null && ((EObject)vocab).eIsProxy()) { + InternalEObject oldVocab = (InternalEObject)vocab; + vocab = (Vocab)eResolveProxy(oldVocab); + if (vocab != oldVocab) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, DataPackage.TERM__VOCAB, oldVocab, vocab)); + } + } + return vocab; + } + + /** + * + * + * @generated + */ + public Vocab basicGetVocab() { + return vocab; + } + + /** + * + * + * @generated + */ + public void setVocab(Vocab newVocab) { + Vocab oldVocab = vocab; + vocab = newVocab; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM__VOCAB, oldVocab, vocab)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.TERM__TERMS: + return getTerms(); + case DataPackage.TERM__BUNDLE: + return getBundle(); + case DataPackage.TERM__NAME: + return getName(); + case DataPackage.TERM__RESOURCE_TYPE: + return getResourceType(); + case DataPackage.TERM__RESOURCE_URI: + return getResourceUri(); + case DataPackage.TERM__RESOURCE_NAME: + return getResourceName(); + case DataPackage.TERM__VOCAB: + if (resolve) return getVocab(); + return basicGetVocab(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.TERM__TERMS: + getTerms().clear(); + getTerms().addAll((Collection)newValue); + return; + case DataPackage.TERM__BUNDLE: + setBundle((Bundle)newValue); + return; + case DataPackage.TERM__NAME: + setName((String)newValue); + return; + case DataPackage.TERM__RESOURCE_TYPE: + setResourceType((ResourceType)newValue); + return; + case DataPackage.TERM__RESOURCE_URI: + setResourceUri((String)newValue); + return; + case DataPackage.TERM__RESOURCE_NAME: + setResourceName((String)newValue); + return; + case DataPackage.TERM__VOCAB: + setVocab((Vocab)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.TERM__TERMS: + getTerms().clear(); + return; + case DataPackage.TERM__BUNDLE: + setBundle(BUNDLE_EDEFAULT); + return; + case DataPackage.TERM__NAME: + setName(NAME_EDEFAULT); + return; + case DataPackage.TERM__RESOURCE_TYPE: + setResourceType(RESOURCE_TYPE_EDEFAULT); + return; + case DataPackage.TERM__RESOURCE_URI: + setResourceUri(RESOURCE_URI_EDEFAULT); + return; + case DataPackage.TERM__RESOURCE_NAME: + setResourceName(RESOURCE_NAME_EDEFAULT); + return; + case DataPackage.TERM__VOCAB: + setVocab((Vocab)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.TERM__TERMS: + return terms != null && !terms.isEmpty(); + case DataPackage.TERM__BUNDLE: + return BUNDLE_EDEFAULT == null ? bundle != null : !BUNDLE_EDEFAULT.equals(bundle); + case DataPackage.TERM__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case DataPackage.TERM__RESOURCE_TYPE: + return resourceType != RESOURCE_TYPE_EDEFAULT; + case DataPackage.TERM__RESOURCE_URI: + return RESOURCE_URI_EDEFAULT == null ? resourceUri != null : !RESOURCE_URI_EDEFAULT.equals(resourceUri); + case DataPackage.TERM__RESOURCE_NAME: + return RESOURCE_NAME_EDEFAULT == null ? resourceName != null : !RESOURCE_NAME_EDEFAULT.equals(resourceName); + case DataPackage.TERM__VOCAB: + return vocab != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == BundleAware.class) { + switch (derivedFeatureID) { + case DataPackage.TERM__BUNDLE: return CommonsPackage.BUNDLE_AWARE__BUNDLE; + default: return -1; + } + } + if (baseClass == Nameable.class) { + switch (derivedFeatureID) { + default: return -1; + } + } + if (baseClass == NameContainer.class) { + switch (derivedFeatureID) { + case DataPackage.TERM__NAME: return CommonsPackage.NAME_CONTAINER__NAME; + default: return -1; + } + } + if (baseClass == ResourceAware.class) { + switch (derivedFeatureID) { + case DataPackage.TERM__RESOURCE_TYPE: return CommonsPackage.RESOURCE_AWARE__RESOURCE_TYPE; + case DataPackage.TERM__RESOURCE_URI: return CommonsPackage.RESOURCE_AWARE__RESOURCE_URI; + case DataPackage.TERM__RESOURCE_NAME: return CommonsPackage.RESOURCE_AWARE__RESOURCE_NAME; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == BundleAware.class) { + switch (baseFeatureID) { + case CommonsPackage.BUNDLE_AWARE__BUNDLE: return DataPackage.TERM__BUNDLE; + default: return -1; + } + } + if (baseClass == Nameable.class) { + switch (baseFeatureID) { + default: return -1; + } + } + if (baseClass == NameContainer.class) { + switch (baseFeatureID) { + case CommonsPackage.NAME_CONTAINER__NAME: return DataPackage.TERM__NAME; + default: return -1; + } + } + if (baseClass == ResourceAware.class) { + switch (baseFeatureID) { + case CommonsPackage.RESOURCE_AWARE__RESOURCE_TYPE: return DataPackage.TERM__RESOURCE_TYPE; + case CommonsPackage.RESOURCE_AWARE__RESOURCE_URI: return DataPackage.TERM__RESOURCE_URI; + case CommonsPackage.RESOURCE_AWARE__RESOURCE_NAME: return DataPackage.TERM__RESOURCE_NAME; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (bundle: "); + result.append(bundle); + result.append(", name: "); + result.append(name); + result.append(", resourceType: "); + result.append(resourceType); + result.append(", resourceUri: "); + result.append(resourceUri); + result.append(", resourceName: "); + result.append(resourceName); + result.append(')'); + return result.toString(); + } + +} //TermImpl diff --git a/data/src/main/java/org/soluvas/data/impl/TermValueImpl.java b/data/src/main/java/org/soluvas/data/impl/TermValueImpl.java new file mode 100644 index 000000000..0e2d70fa7 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/TermValueImpl.java @@ -0,0 +1,445 @@ +/** + */ +package org.soluvas.data.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.soluvas.commons.CommonsPackage; +import org.soluvas.commons.Identifiable; +import org.soluvas.commons.Sluggable; +import org.soluvas.data.DataPackage; +import org.soluvas.data.Term; +import org.soluvas.data.TermValue; + +/** + * + * An implementation of the model object 'Term Value'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.TermValueImpl#getId Id}
  • + *
  • {@link org.soluvas.data.impl.TermValueImpl#getSlug Slug}
  • + *
  • {@link org.soluvas.data.impl.TermValueImpl#getTerm Term}
  • + *
  • {@link org.soluvas.data.impl.TermValueImpl#getSlugPath Slug Path}
  • + *
  • {@link org.soluvas.data.impl.TermValueImpl#getValue Value}
  • + *
+ *

+ * + * @generated + */ +public class TermValueImpl extends ValueImpl implements TermValue { + /** + * The default value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected static final String ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected String id = ID_EDEFAULT; + + /** + * The default value of the '{@link #getSlug() Slug}' attribute. + * + * + * @see #getSlug() + * @generated + * @ordered + */ + protected static final String SLUG_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSlug() Slug}' attribute. + * + * + * @see #getSlug() + * @generated + * @ordered + */ + protected String slug = SLUG_EDEFAULT; + + /** + * The cached value of the '{@link #getTerm() Term}' reference. + * + * + * @see #getTerm() + * @generated + * @ordered + */ + protected Term term; + + /** + * The default value of the '{@link #getSlugPath() Slug Path}' attribute. + * + * + * @see #getSlugPath() + * @generated + * @ordered + */ + protected static final String SLUG_PATH_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSlugPath() Slug Path}' attribute. + * + * + * @see #getSlugPath() + * @generated + * @ordered + */ + protected String slugPath = SLUG_PATH_EDEFAULT; + + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final String VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected String value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + public TermValueImpl() { + super(); + } + + public TermValueImpl(String id, String displayValue) { + super(); + setValue(id); + setDisplayValue(displayValue); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.TERM_VALUE; + } + + /** + * + * + * @generated + */ + @Override + public String getId() { + return id; + } + + /** + * + * + * @generated + */ + @Override + public void setId(String newId) { + String oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM_VALUE__ID, oldId, id)); + } + + /** + * + * + * @generated + */ + @Override + public String getSlug() { + return slug; + } + + /** + * + * + * @generated + */ + @Override + public void setSlug(String newSlug) { + String oldSlug = slug; + slug = newSlug; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM_VALUE__SLUG, oldSlug, slug)); + } + + /** + * + * + * @generated + */ + @Override + public Term getTerm() { + if (term != null && ((EObject)term).eIsProxy()) { + InternalEObject oldTerm = (InternalEObject)term; + term = (Term)eResolveProxy(oldTerm); + if (term != oldTerm) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, DataPackage.TERM_VALUE__TERM, oldTerm, term)); + } + } + return term; + } + + /** + * + * + * @generated + */ + public Term basicGetTerm() { + return term; + } + + /** + * + * + * @generated + */ + @Override + public void setTerm(Term newTerm) { + Term oldTerm = term; + term = newTerm; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM_VALUE__TERM, oldTerm, term)); + } + + /** + * + * + * @generated + */ + @Override + public String getSlugPath() { + return slugPath; + } + + /** + * + * + * @generated + */ + @Override + public void setSlugPath(String newSlugPath) { + String oldSlugPath = slugPath; + slugPath = newSlugPath; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM_VALUE__SLUG_PATH, oldSlugPath, slugPath)); + } + + /** + * + * + * @generated + */ + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.TERM_VALUE__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.TERM_VALUE__ID: + return getId(); + case DataPackage.TERM_VALUE__SLUG: + return getSlug(); + case DataPackage.TERM_VALUE__TERM: + if (resolve) return getTerm(); + return basicGetTerm(); + case DataPackage.TERM_VALUE__SLUG_PATH: + return getSlugPath(); + case DataPackage.TERM_VALUE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.TERM_VALUE__ID: + setId((String)newValue); + return; + case DataPackage.TERM_VALUE__SLUG: + setSlug((String)newValue); + return; + case DataPackage.TERM_VALUE__TERM: + setTerm((Term)newValue); + return; + case DataPackage.TERM_VALUE__SLUG_PATH: + setSlugPath((String)newValue); + return; + case DataPackage.TERM_VALUE__VALUE: + setValue((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.TERM_VALUE__ID: + setId(ID_EDEFAULT); + return; + case DataPackage.TERM_VALUE__SLUG: + setSlug(SLUG_EDEFAULT); + return; + case DataPackage.TERM_VALUE__TERM: + setTerm((Term)null); + return; + case DataPackage.TERM_VALUE__SLUG_PATH: + setSlugPath(SLUG_PATH_EDEFAULT); + return; + case DataPackage.TERM_VALUE__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.TERM_VALUE__ID: + return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); + case DataPackage.TERM_VALUE__SLUG: + return SLUG_EDEFAULT == null ? slug != null : !SLUG_EDEFAULT.equals(slug); + case DataPackage.TERM_VALUE__TERM: + return term != null; + case DataPackage.TERM_VALUE__SLUG_PATH: + return SLUG_PATH_EDEFAULT == null ? slugPath != null : !SLUG_PATH_EDEFAULT.equals(slugPath); + case DataPackage.TERM_VALUE__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == Identifiable.class) { + switch (derivedFeatureID) { + case DataPackage.TERM_VALUE__ID: return CommonsPackage.IDENTIFIABLE__ID; + default: return -1; + } + } + if (baseClass == Sluggable.class) { + switch (derivedFeatureID) { + case DataPackage.TERM_VALUE__SLUG: return CommonsPackage.SLUGGABLE__SLUG; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == Identifiable.class) { + switch (baseFeatureID) { + case CommonsPackage.IDENTIFIABLE__ID: return DataPackage.TERM_VALUE__ID; + default: return -1; + } + } + if (baseClass == Sluggable.class) { + switch (baseFeatureID) { + case CommonsPackage.SLUGGABLE__SLUG: return DataPackage.TERM_VALUE__SLUG; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (id: "); + result.append(id); + result.append(", slug: "); + result.append(slug); + result.append(", slugPath: "); + result.append(slugPath); + result.append(", value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} //TermValueImpl diff --git a/data/src/main/java/org/soluvas/data/impl/TreeVocabImpl.java b/data/src/main/java/org/soluvas/data/impl/TreeVocabImpl.java new file mode 100644 index 000000000..e26887398 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/TreeVocabImpl.java @@ -0,0 +1,39 @@ +/** + */ +package org.soluvas.data.impl; + +import org.eclipse.emf.ecore.EClass; + +import org.soluvas.data.DataPackage; +import org.soluvas.data.TreeVocab; + +/** + * + * An implementation of the model object 'Tree Vocab'. + * + *

+ *

+ * + * @generated + */ +public class TreeVocabImpl extends VocabImpl implements TreeVocab { + /** + * + * + * @generated + */ + public TreeVocabImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.TREE_VOCAB; + } + +} //TreeVocabImpl diff --git a/data/src/main/java/org/soluvas/data/impl/ValueImpl.java b/data/src/main/java/org/soluvas/data/impl/ValueImpl.java new file mode 100644 index 000000000..823b79784 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/ValueImpl.java @@ -0,0 +1,249 @@ +/** + */ +package org.soluvas.data.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.soluvas.data.AttributeSemantic; +import org.soluvas.data.DataPackage; +import org.soluvas.data.Value; + +/** + * + * An implementation of the model object 'Value'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.ValueImpl#getSemantic Semantic}
  • + *
  • {@link org.soluvas.data.impl.ValueImpl#getDisplayValue Display Value}
  • + *
+ *

+ * + * @generated + */ +public class ValueImpl extends EObjectImpl implements Value { + /** + * The default value of the '{@link #getSemantic() Semantic}' attribute. + * + * + * @see #getSemantic() + * @generated + * @ordered + */ + protected static final AttributeSemantic SEMANTIC_EDEFAULT = AttributeSemantic.EQUAL; + + /** + * The cached value of the '{@link #getSemantic() Semantic}' attribute. + * + * + * @see #getSemantic() + * @generated + * @ordered + */ + protected AttributeSemantic semantic = SEMANTIC_EDEFAULT; + + /** + * The default value of the '{@link #getDisplayValue() Display Value}' attribute. + * + * + * @see #getDisplayValue() + * @generated + * @ordered + */ + protected static final String DISPLAY_VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDisplayValue() Display Value}' attribute. + * + * + * @see #getDisplayValue() + * @generated + * @ordered + */ + protected String displayValue = DISPLAY_VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + public ValueImpl() { + super(); + } + +// public ValueImpl(T value) { +// super(); +// setValue(value); +// } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.VALUE; + } + + /** + * + * + * @generated + */ + @Override + public T getValue() { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public AttributeSemantic getSemantic() { + return semantic; + } + + /** + * + * + * @generated + */ + @Override + public void setSemantic(AttributeSemantic newSemantic) { + AttributeSemantic oldSemantic = semantic; + semantic = newSemantic == null ? SEMANTIC_EDEFAULT : newSemantic; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.VALUE__SEMANTIC, oldSemantic, semantic)); + } + + /** + * + * + * @generated + */ + @Override + public String getDisplayValue() { + return displayValue; + } + + /** + * + * + * @generated + */ + @Override + public void setDisplayValue(String newDisplayValue) { + String oldDisplayValue = displayValue; + displayValue = newDisplayValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.VALUE__DISPLAY_VALUE, oldDisplayValue, displayValue)); + } + + /** + * + * + * @generated + */ + @Override + public String getString() { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.VALUE__SEMANTIC: + return getSemantic(); + case DataPackage.VALUE__DISPLAY_VALUE: + return getDisplayValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.VALUE__SEMANTIC: + setSemantic((AttributeSemantic)newValue); + return; + case DataPackage.VALUE__DISPLAY_VALUE: + setDisplayValue((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.VALUE__SEMANTIC: + setSemantic(SEMANTIC_EDEFAULT); + return; + case DataPackage.VALUE__DISPLAY_VALUE: + setDisplayValue(DISPLAY_VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.VALUE__SEMANTIC: + return semantic != SEMANTIC_EDEFAULT; + case DataPackage.VALUE__DISPLAY_VALUE: + return DISPLAY_VALUE_EDEFAULT == null ? displayValue != null : !DISPLAY_VALUE_EDEFAULT.equals(displayValue); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (semantic: "); + result.append(semantic); + result.append(", displayValue: "); + result.append(displayValue); + result.append(')'); + return result.toString(); + } + +} //ValueImpl diff --git a/data/src/main/java/org/soluvas/data/impl/VocabImpl.java b/data/src/main/java/org/soluvas/data/impl/VocabImpl.java new file mode 100644 index 000000000..ad2176123 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/impl/VocabImpl.java @@ -0,0 +1,556 @@ +/** + */ +package org.soluvas.data.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import org.osgi.framework.Bundle; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.CommonsPackage; +import org.soluvas.commons.Describable; +import org.soluvas.commons.NsPrefixable; +import org.soluvas.commons.ResourceAware; +import org.soluvas.commons.ResourceType; + +import org.soluvas.data.DataPackage; +import org.soluvas.data.Term; +import org.soluvas.data.Vocab; + +/** + * + * An implementation of the model object 'Vocab'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.soluvas.data.impl.VocabImpl#getTerms Terms}
  • + *
  • {@link org.soluvas.data.impl.VocabImpl#getBundle Bundle}
  • + *
  • {@link org.soluvas.data.impl.VocabImpl#getResourceType Resource Type}
  • + *
  • {@link org.soluvas.data.impl.VocabImpl#getResourceUri Resource Uri}
  • + *
  • {@link org.soluvas.data.impl.VocabImpl#getResourceName Resource Name}
  • + *
  • {@link org.soluvas.data.impl.VocabImpl#getNsPrefix Ns Prefix}
  • + *
  • {@link org.soluvas.data.impl.VocabImpl#getDescription Description}
  • + *
+ *

+ * + * @generated + */ +public abstract class VocabImpl extends EObjectImpl implements Vocab { + /** + * The cached value of the '{@link #getTerms() Terms}' reference list. + * + * + * @see #getTerms() + * @generated + * @ordered + */ + protected EList terms; + + /** + * The default value of the '{@link #getBundle() Bundle}' attribute. + * + * + * @see #getBundle() + * @generated + * @ordered + */ + protected static final Bundle BUNDLE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getBundle() Bundle}' attribute. + * + * + * @see #getBundle() + * @generated + * @ordered + */ + protected Bundle bundle = BUNDLE_EDEFAULT; + + /** + * The default value of the '{@link #getResourceType() Resource Type}' attribute. + * + * + * @see #getResourceType() + * @generated + * @ordered + */ + protected static final ResourceType RESOURCE_TYPE_EDEFAULT = ResourceType.BUNDLE; + + /** + * The cached value of the '{@link #getResourceType() Resource Type}' attribute. + * + * + * @see #getResourceType() + * @generated + * @ordered + */ + protected ResourceType resourceType = RESOURCE_TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getResourceUri() Resource Uri}' attribute. + * + * + * @see #getResourceUri() + * @generated + * @ordered + */ + protected static final String RESOURCE_URI_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResourceUri() Resource Uri}' attribute. + * + * + * @see #getResourceUri() + * @generated + * @ordered + */ + protected String resourceUri = RESOURCE_URI_EDEFAULT; + + /** + * The default value of the '{@link #getResourceName() Resource Name}' attribute. + * + * + * @see #getResourceName() + * @generated + * @ordered + */ + protected static final String RESOURCE_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getResourceName() Resource Name}' attribute. + * + * + * @see #getResourceName() + * @generated + * @ordered + */ + protected String resourceName = RESOURCE_NAME_EDEFAULT; + + /** + * The default value of the '{@link #getNsPrefix() Ns Prefix}' attribute. + * + * + * @see #getNsPrefix() + * @generated + * @ordered + */ + protected static final String NS_PREFIX_EDEFAULT = null; + + /** + * The cached value of the '{@link #getNsPrefix() Ns Prefix}' attribute. + * + * + * @see #getNsPrefix() + * @generated + * @ordered + */ + protected String nsPrefix = NS_PREFIX_EDEFAULT; + + /** + * The default value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected static final String DESCRIPTION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected String description = DESCRIPTION_EDEFAULT; + + /** + * + * + * @generated + */ + public VocabImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DataPackage.Literals.VOCAB; + } + + /** + * + * + * @generated + */ + public EList getTerms() { + if (terms == null) { + terms = new EObjectResolvingEList(Term.class, this, DataPackage.VOCAB__TERMS); + } + return terms; + } + + /** + * + * + * @generated + */ + public Bundle getBundle() { + return bundle; + } + + /** + * + * + * @generated + */ + public void setBundle(Bundle newBundle) { + Bundle oldBundle = bundle; + bundle = newBundle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.VOCAB__BUNDLE, oldBundle, bundle)); + } + + /** + * + * + * @generated + */ + public ResourceType getResourceType() { + return resourceType; + } + + /** + * + * + * @generated + */ + public void setResourceType(ResourceType newResourceType) { + ResourceType oldResourceType = resourceType; + resourceType = newResourceType == null ? RESOURCE_TYPE_EDEFAULT : newResourceType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.VOCAB__RESOURCE_TYPE, oldResourceType, resourceType)); + } + + /** + * + * + * @generated + */ + public String getResourceUri() { + return resourceUri; + } + + /** + * + * + * @generated + */ + public void setResourceUri(String newResourceUri) { + String oldResourceUri = resourceUri; + resourceUri = newResourceUri; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.VOCAB__RESOURCE_URI, oldResourceUri, resourceUri)); + } + + /** + * + * + * @generated + */ + public String getResourceName() { + return resourceName; + } + + /** + * + * + * @generated + */ + public void setResourceName(String newResourceName) { + String oldResourceName = resourceName; + resourceName = newResourceName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.VOCAB__RESOURCE_NAME, oldResourceName, resourceName)); + } + + /** + * + * + * @generated + */ + public String getNsPrefix() { + return nsPrefix; + } + + /** + * + * + * @generated + */ + public void setNsPrefix(String newNsPrefix) { + String oldNsPrefix = nsPrefix; + nsPrefix = newNsPrefix; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.VOCAB__NS_PREFIX, oldNsPrefix, nsPrefix)); + } + + /** + * + * + * @generated + */ + public String getDescription() { + return description; + } + + /** + * + * + * @generated + */ + public void setDescription(String newDescription) { + String oldDescription = description; + description = newDescription; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DataPackage.VOCAB__DESCRIPTION, oldDescription, description)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DataPackage.VOCAB__TERMS: + return getTerms(); + case DataPackage.VOCAB__BUNDLE: + return getBundle(); + case DataPackage.VOCAB__RESOURCE_TYPE: + return getResourceType(); + case DataPackage.VOCAB__RESOURCE_URI: + return getResourceUri(); + case DataPackage.VOCAB__RESOURCE_NAME: + return getResourceName(); + case DataPackage.VOCAB__NS_PREFIX: + return getNsPrefix(); + case DataPackage.VOCAB__DESCRIPTION: + return getDescription(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DataPackage.VOCAB__TERMS: + getTerms().clear(); + getTerms().addAll((Collection)newValue); + return; + case DataPackage.VOCAB__BUNDLE: + setBundle((Bundle)newValue); + return; + case DataPackage.VOCAB__RESOURCE_TYPE: + setResourceType((ResourceType)newValue); + return; + case DataPackage.VOCAB__RESOURCE_URI: + setResourceUri((String)newValue); + return; + case DataPackage.VOCAB__RESOURCE_NAME: + setResourceName((String)newValue); + return; + case DataPackage.VOCAB__NS_PREFIX: + setNsPrefix((String)newValue); + return; + case DataPackage.VOCAB__DESCRIPTION: + setDescription((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DataPackage.VOCAB__TERMS: + getTerms().clear(); + return; + case DataPackage.VOCAB__BUNDLE: + setBundle(BUNDLE_EDEFAULT); + return; + case DataPackage.VOCAB__RESOURCE_TYPE: + setResourceType(RESOURCE_TYPE_EDEFAULT); + return; + case DataPackage.VOCAB__RESOURCE_URI: + setResourceUri(RESOURCE_URI_EDEFAULT); + return; + case DataPackage.VOCAB__RESOURCE_NAME: + setResourceName(RESOURCE_NAME_EDEFAULT); + return; + case DataPackage.VOCAB__NS_PREFIX: + setNsPrefix(NS_PREFIX_EDEFAULT); + return; + case DataPackage.VOCAB__DESCRIPTION: + setDescription(DESCRIPTION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DataPackage.VOCAB__TERMS: + return terms != null && !terms.isEmpty(); + case DataPackage.VOCAB__BUNDLE: + return BUNDLE_EDEFAULT == null ? bundle != null : !BUNDLE_EDEFAULT.equals(bundle); + case DataPackage.VOCAB__RESOURCE_TYPE: + return resourceType != RESOURCE_TYPE_EDEFAULT; + case DataPackage.VOCAB__RESOURCE_URI: + return RESOURCE_URI_EDEFAULT == null ? resourceUri != null : !RESOURCE_URI_EDEFAULT.equals(resourceUri); + case DataPackage.VOCAB__RESOURCE_NAME: + return RESOURCE_NAME_EDEFAULT == null ? resourceName != null : !RESOURCE_NAME_EDEFAULT.equals(resourceName); + case DataPackage.VOCAB__NS_PREFIX: + return NS_PREFIX_EDEFAULT == null ? nsPrefix != null : !NS_PREFIX_EDEFAULT.equals(nsPrefix); + case DataPackage.VOCAB__DESCRIPTION: + return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == BundleAware.class) { + switch (derivedFeatureID) { + case DataPackage.VOCAB__BUNDLE: return CommonsPackage.BUNDLE_AWARE__BUNDLE; + default: return -1; + } + } + if (baseClass == ResourceAware.class) { + switch (derivedFeatureID) { + case DataPackage.VOCAB__RESOURCE_TYPE: return CommonsPackage.RESOURCE_AWARE__RESOURCE_TYPE; + case DataPackage.VOCAB__RESOURCE_URI: return CommonsPackage.RESOURCE_AWARE__RESOURCE_URI; + case DataPackage.VOCAB__RESOURCE_NAME: return CommonsPackage.RESOURCE_AWARE__RESOURCE_NAME; + default: return -1; + } + } + if (baseClass == NsPrefixable.class) { + switch (derivedFeatureID) { + case DataPackage.VOCAB__NS_PREFIX: return CommonsPackage.NS_PREFIXABLE__NS_PREFIX; + default: return -1; + } + } + if (baseClass == Describable.class) { + switch (derivedFeatureID) { + case DataPackage.VOCAB__DESCRIPTION: return CommonsPackage.DESCRIBABLE__DESCRIPTION; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == BundleAware.class) { + switch (baseFeatureID) { + case CommonsPackage.BUNDLE_AWARE__BUNDLE: return DataPackage.VOCAB__BUNDLE; + default: return -1; + } + } + if (baseClass == ResourceAware.class) { + switch (baseFeatureID) { + case CommonsPackage.RESOURCE_AWARE__RESOURCE_TYPE: return DataPackage.VOCAB__RESOURCE_TYPE; + case CommonsPackage.RESOURCE_AWARE__RESOURCE_URI: return DataPackage.VOCAB__RESOURCE_URI; + case CommonsPackage.RESOURCE_AWARE__RESOURCE_NAME: return DataPackage.VOCAB__RESOURCE_NAME; + default: return -1; + } + } + if (baseClass == NsPrefixable.class) { + switch (baseFeatureID) { + case CommonsPackage.NS_PREFIXABLE__NS_PREFIX: return DataPackage.VOCAB__NS_PREFIX; + default: return -1; + } + } + if (baseClass == Describable.class) { + switch (baseFeatureID) { + case CommonsPackage.DESCRIBABLE__DESCRIPTION: return DataPackage.VOCAB__DESCRIPTION; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (bundle: "); + result.append(bundle); + result.append(", resourceType: "); + result.append(resourceType); + result.append(", resourceUri: "); + result.append(resourceUri); + result.append(", resourceName: "); + result.append(resourceName); + result.append(", nsPrefix: "); + result.append(nsPrefix); + result.append(", description: "); + result.append(description); + result.append(')'); + return result.toString(); + } + +} //VocabImpl diff --git a/data/src/main/java/org/soluvas/data/util/DataAdapterFactory.java b/data/src/main/java/org/soluvas/data/util/DataAdapterFactory.java new file mode 100644 index 000000000..e43c3ae70 --- /dev/null +++ b/data/src/main/java/org/soluvas/data/util/DataAdapterFactory.java @@ -0,0 +1,508 @@ +/** + */ +package org.soluvas.data.util; + +import javax.measure.quantity.Quantity; +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.Describable; +import org.soluvas.commons.Identifiable; +import org.soluvas.commons.NameContainer; +import org.soluvas.commons.Nameable; +import org.soluvas.commons.NsPrefixable; +import org.soluvas.commons.ResourceAware; + +import org.soluvas.commons.Sluggable; +import org.soluvas.data.*; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.soluvas.data.DataPackage + * @generated + */ +public class DataAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static DataPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public DataAdapterFactory() { + if (modelPackage == null) { + modelPackage = DataPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected DataSwitch modelSwitch = + new DataSwitch() { + @Override + public Adapter caseAttributeType(AttributeType object) { + return createAttributeTypeAdapter(); + } + @Override + public Adapter caseValue(Value object) { + return createValueAdapter(); + } + @Override + public Adapter caseMeasureValue(MeasureValue object) { + return createMeasureValueAdapter(); + } + @Override + public Adapter caseCurrencyValue(CurrencyValue object) { + return createCurrencyValueAdapter(); + } + @Override + public Adapter caseMixin(Mixin object) { + return createMixinAdapter(); + } + @Override + public Adapter caseRangeValue(RangeValue object) { + return createRangeValueAdapter(); + } + @Override + public Adapter caseTermValue(TermValue object) { + return createTermValueAdapter(); + } + @Override + public Adapter caseVocab(Vocab object) { + return createVocabAdapter(); + } + @Override + public Adapter caseTerm(Term object) { + return createTermAdapter(); + } + @Override + public Adapter caseListVocab(ListVocab object) { + return createListVocabAdapter(); + } + @Override + public Adapter caseTreeVocab(TreeVocab object) { + return createTreeVocabAdapter(); + } + @Override + public Adapter caseFreeVocab(FreeVocab object) { + return createFreeVocabAdapter(); + } + @Override + public Adapter caseTermContainer(TermContainer object) { + return createTermContainerAdapter(); + } + @Override + public Adapter caseDataCatalog(DataCatalog object) { + return createDataCatalogAdapter(); + } + @Override + public Adapter caseNsPrefixable(NsPrefixable object) { + return createNsPrefixableAdapter(); + } + @Override + public Adapter caseNameable(Nameable object) { + return createNameableAdapter(); + } + @Override + public Adapter caseNameContainer(NameContainer object) { + return createNameContainerAdapter(); + } + @Override + public Adapter caseResourceAware(ResourceAware object) { + return createResourceAwareAdapter(); + } + @Override + public Adapter caseBundleAware(BundleAware object) { + return createBundleAwareAdapter(); + } + @Override + public Adapter caseDescribable(Describable object) { + return createDescribableAdapter(); + } + @Override + public Adapter caseIdentifiable(Identifiable object) { + return createIdentifiableAdapter(); + } + @Override + public Adapter caseSluggable(Sluggable object) { + return createSluggableAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.AttributeType Attribute Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.AttributeType + * @generated + */ + public Adapter createAttributeTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.Value Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.Value + * @generated + */ + public Adapter createValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.MeasureValue Measure Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.MeasureValue + * @generated + */ + public Adapter createMeasureValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.CurrencyValue Currency Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.CurrencyValue + * @generated + */ + public Adapter createCurrencyValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.Mixin Mixin}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.Mixin + * @generated + */ + public Adapter createMixinAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.RangeValue Range Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.RangeValue + * @generated + */ + public Adapter createRangeValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.TermValue Term Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.TermValue + * @generated + */ + public Adapter createTermValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.Vocab Vocab}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.Vocab + * @generated + */ + public Adapter createVocabAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.Term Term}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.Term + * @generated + */ + public Adapter createTermAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.ListVocab List Vocab}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.ListVocab + * @generated + */ + public Adapter createListVocabAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.TreeVocab Tree Vocab}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.TreeVocab + * @generated + */ + public Adapter createTreeVocabAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.FreeVocab Free Vocab}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.FreeVocab + * @generated + */ + public Adapter createFreeVocabAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.TermContainer Term Container}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.TermContainer + * @generated + */ + public Adapter createTermContainerAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.data.DataCatalog Catalog}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.data.DataCatalog + * @generated + */ + public Adapter createDataCatalogAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.commons.NsPrefixable Ns Prefixable}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.commons.NsPrefixable + * @generated + */ + public Adapter createNsPrefixableAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.commons.Nameable Nameable}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.commons.Nameable + * @generated + */ + public Adapter createNameableAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.commons.NameContainer Name Container}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.commons.NameContainer + * @generated + */ + public Adapter createNameContainerAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.commons.ResourceAware Resource Aware}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.commons.ResourceAware + * @generated + */ + public Adapter createResourceAwareAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.commons.BundleAware Bundle Aware}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.commons.BundleAware + * @generated + */ + public Adapter createBundleAwareAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.commons.Describable Describable}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.commons.Describable + * @generated + */ + public Adapter createDescribableAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.commons.Identifiable Identifiable}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.commons.Identifiable + * @generated + */ + public Adapter createIdentifiableAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.soluvas.commons.Sluggable Sluggable}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.soluvas.commons.Sluggable + * @generated + */ + public Adapter createSluggableAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //DataAdapterFactory diff --git a/data/src/main/java/org/soluvas/data/util/DataSwitch.java b/data/src/main/java/org/soluvas/data/util/DataSwitch.java new file mode 100644 index 000000000..883b0f69e --- /dev/null +++ b/data/src/main/java/org/soluvas/data/util/DataSwitch.java @@ -0,0 +1,562 @@ +/** + */ +package org.soluvas.data.util; + +import javax.measure.quantity.Quantity; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import org.soluvas.commons.BundleAware; +import org.soluvas.commons.Describable; +import org.soluvas.commons.Identifiable; +import org.soluvas.commons.NameContainer; +import org.soluvas.commons.Nameable; +import org.soluvas.commons.NsPrefixable; +import org.soluvas.commons.ResourceAware; + +import org.soluvas.commons.Sluggable; +import org.soluvas.data.*; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see org.soluvas.data.DataPackage + * @generated + */ +public class DataSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static DataPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public DataSwitch() { + if (modelPackage == null) { + modelPackage = DataPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T1 doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case DataPackage.ATTRIBUTE_TYPE: { + AttributeType attributeType = (AttributeType)theEObject; + T1 result = caseAttributeType(attributeType); + if (result == null) result = caseNsPrefixable(attributeType); + if (result == null) result = caseNameContainer(attributeType); + if (result == null) result = caseResourceAware(attributeType); + if (result == null) result = caseBundleAware(attributeType); + if (result == null) result = caseNameable(attributeType); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.VALUE: { + Value value = (Value)theEObject; + T1 result = caseValue(value); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.MEASURE_VALUE: { + MeasureValue measureValue = (MeasureValue)theEObject; + T1 result = caseMeasureValue(measureValue); + if (result == null) result = caseValue(measureValue); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.CURRENCY_VALUE: { + CurrencyValue currencyValue = (CurrencyValue)theEObject; + T1 result = caseCurrencyValue(currencyValue); + if (result == null) result = caseValue(currencyValue); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.MIXIN: { + Mixin mixin = (Mixin)theEObject; + T1 result = caseMixin(mixin); + if (result == null) result = caseNameContainer(mixin); + if (result == null) result = caseResourceAware(mixin); + if (result == null) result = caseBundleAware(mixin); + if (result == null) result = caseNsPrefixable(mixin); + if (result == null) result = caseDescribable(mixin); + if (result == null) result = caseNameable(mixin); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.RANGE_VALUE: { + RangeValue rangeValue = (RangeValue)theEObject; + T1 result = caseRangeValue(rangeValue); + if (result == null) result = caseValue(rangeValue); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.TERM_VALUE: { + TermValue termValue = (TermValue)theEObject; + T1 result = caseTermValue(termValue); + if (result == null) result = caseValue(termValue); + if (result == null) result = caseIdentifiable(termValue); + if (result == null) result = caseSluggable(termValue); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.VOCAB: { + Vocab vocab = (Vocab)theEObject; + T1 result = caseVocab(vocab); + if (result == null) result = caseTermContainer(vocab); + if (result == null) result = caseBundleAware(vocab); + if (result == null) result = caseResourceAware(vocab); + if (result == null) result = caseNsPrefixable(vocab); + if (result == null) result = caseDescribable(vocab); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.TERM: { + Term term = (Term)theEObject; + T1 result = caseTerm(term); + if (result == null) result = caseTermContainer(term); + if (result == null) result = caseBundleAware(term); + if (result == null) result = caseNameContainer(term); + if (result == null) result = caseResourceAware(term); + if (result == null) result = caseNameable(term); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.LIST_VOCAB: { + ListVocab listVocab = (ListVocab)theEObject; + T1 result = caseListVocab(listVocab); + if (result == null) result = caseVocab(listVocab); + if (result == null) result = caseTermContainer(listVocab); + if (result == null) result = caseBundleAware(listVocab); + if (result == null) result = caseResourceAware(listVocab); + if (result == null) result = caseNsPrefixable(listVocab); + if (result == null) result = caseDescribable(listVocab); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.TREE_VOCAB: { + TreeVocab treeVocab = (TreeVocab)theEObject; + T1 result = caseTreeVocab(treeVocab); + if (result == null) result = caseVocab(treeVocab); + if (result == null) result = caseTermContainer(treeVocab); + if (result == null) result = caseBundleAware(treeVocab); + if (result == null) result = caseResourceAware(treeVocab); + if (result == null) result = caseNsPrefixable(treeVocab); + if (result == null) result = caseDescribable(treeVocab); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.FREE_VOCAB: { + FreeVocab freeVocab = (FreeVocab)theEObject; + T1 result = caseFreeVocab(freeVocab); + if (result == null) result = caseVocab(freeVocab); + if (result == null) result = caseTermContainer(freeVocab); + if (result == null) result = caseBundleAware(freeVocab); + if (result == null) result = caseResourceAware(freeVocab); + if (result == null) result = caseNsPrefixable(freeVocab); + if (result == null) result = caseDescribable(freeVocab); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.TERM_CONTAINER: { + TermContainer termContainer = (TermContainer)theEObject; + T1 result = caseTermContainer(termContainer); + if (result == null) result = defaultCase(theEObject); + return result; + } + case DataPackage.DATA_CATALOG: { + DataCatalog dataCatalog = (DataCatalog)theEObject; + T1 result = caseDataCatalog(dataCatalog); + if (result == null) result = caseBundleAware(dataCatalog); + if (result == null) result = caseResourceAware(dataCatalog); + if (result == null) result = caseNameContainer(dataCatalog); + if (result == null) result = caseNameable(dataCatalog); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Attribute Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Attribute Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseAttributeType(AttributeType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseValue(Value object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Measure Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Measure Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseMeasureValue(MeasureValue object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Currency Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Currency Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseCurrencyValue(CurrencyValue object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Mixin'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Mixin'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseMixin(Mixin object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Range Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Range Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseRangeValue(RangeValue object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Term Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Term Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseTermValue(TermValue object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Vocab'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Vocab'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseVocab(Vocab object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Term'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Term'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseTerm(Term object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'List Vocab'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'List Vocab'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseListVocab(ListVocab object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Tree Vocab'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Tree Vocab'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseTreeVocab(TreeVocab object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Free Vocab'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Free Vocab'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseFreeVocab(FreeVocab object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Term Container'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Term Container'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseTermContainer(TermContainer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Catalog'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Catalog'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseDataCatalog(DataCatalog object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Ns Prefixable'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Ns Prefixable'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseNsPrefixable(NsPrefixable object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Nameable'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Nameable'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseNameable(Nameable object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Name Container'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Name Container'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseNameContainer(NameContainer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Resource Aware'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Resource Aware'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseResourceAware(ResourceAware object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Bundle Aware'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Bundle Aware'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseBundleAware(BundleAware object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Describable'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Describable'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseDescribable(Describable object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Identifiable'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Identifiable'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseIdentifiable(Identifiable object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Sluggable'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Sluggable'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseSluggable(Sluggable object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T1 defaultCase(EObject object) { + return null; + } + +} //DataSwitch diff --git a/data/src/main/resources/OSGI-INF/blueprint/data.xml b/data/src/main/resources/OSGI-INF/blueprint/data.xml index a8298e439..ced740979 100644 --- a/data/src/main/resources/OSGI-INF/blueprint/data.xml +++ b/data/src/main/resources/OSGI-INF/blueprint/data.xml @@ -3,9 +3,15 @@ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0 http://karaf.apache.org/xmlns/shell/v1.1.0 http://karaf.apache.org/xmlns/shell/v1.1.0"> - - - - + + + + + + org.soluvas.data.DataPackage + + + diff --git a/data/src/main/resources/org/soluvas/data/DataXMI.xsd b/data/src/main/resources/org/soluvas/data/DataXMI.xsd index 3e379ec7e..a20119719 100644 --- a/data/src/main/resources/org/soluvas/data/DataXMI.xsd +++ b/data/src/main/resources/org/soluvas/data/DataXMI.xsd @@ -1,2 +1,349 @@ - + + + + + + + + + + + + + + + EXPERIMENTAL. + +Two/three approaches: + +1. Mixin must be statically designed into Ecore EClass, e.g. BerbatikBags, which inherits from BerbatikMixin (inherits ClothingMixin = SizeMixin + ColorMixin), BatikMixin, and BagsMixin. The upside is all attributes/references merge into the EObject. Downside is we need to permutate all combinations into EClass. +Not sure yet how it goes with MongoDB, JSON, and XMI import/export. Not sure yet how it goes with VariedProduct, BundleProduct, SubscribedProduct, SharedProduct, etc. + +2. Mixin is dynamic. Each product object maintain a list of MixinTypes (which is by default specified when the product is created), and filled mixins are put in an EList. Mixins can be added and removed during runtime, without any build-time project rebuild or EMF regeneration. +So store owner, even staff, can define new mixin and manipulate existing products with ease. No Mall admin or schema changes required. +Store staff can browse available mixin types and just add any mixin they want. +Similar approach with Drupal taxonomy or JCR mixin. Magento is more restrictive because of its inflexible AttributeSet concept. Mixin is like AttributeSet but with cardinality 0..*. +Probably need better name than mixin though. +Seems to be most flexible, for Jackson we can have custom converter. My concern is MongoDB and XMI. +Not sure yet how it goes with MongoDB, JSON, and XMI import/export. Not sure yet how it goes with VariedProduct, BundleProduct, SubscribedProduct, SharedProduct, etc. + +3. Hybrid #1. Mixin is by default static, which hopefully covers 80% use case. +When you want dynamic, you can add more mixins. +But ain't this too complicated? +On the web client side, it's also more work. Not to mention inventory, etc. integration with other systems. +ProductInfo & principal etc. also use the fully dynamic approach. + +4. Hybrid #2. Mixin is by default dynamic, which covers 80% of the customization. +And for things like category, tag, color, size, they're static, with code support. i.e. must be generated by EMF. + + + + + + + + + + + + 0 means optional, 1 means required, and so on. + + + + + 1 means singular. -1 means no maximum number of values. + + + + + + + + + EXPERIMENTAL. + +Two/three approaches: + +1. Mixin must be statically designed into Ecore EClass, e.g. BerbatikBags, which inherits from BerbatikMixin (inherits ClothingMixin = SizeMixin + ColorMixin), BatikMixin, and BagsMixin. The upside is all attributes/references merge into the EObject. Downside is we need to permutate all combinations into EClass. +Not sure yet how it goes with MongoDB, JSON, and XMI import/export. Not sure yet how it goes with VariedProduct, BundleProduct, SubscribedProduct, SharedProduct, etc. + +2. Mixin is dynamic. Each product object maintain a list of MixinTypes (which is by default specified when the product is created), and filled mixins are put in an EList. Mixins can be added and removed during runtime, without any build-time project rebuild or EMF regeneration. +So store owner, even staff, can define new mixin and manipulate existing products with ease. No Mall admin or schema changes required. +Store staff can browse available mixin types and just add any mixin they want. +Similar approach with Drupal taxonomy or JCR mixin. Magento is more restrictive because of its inflexible AttributeSet concept. Mixin is like AttributeSet but with cardinality 0..*. +Probably need better name than mixin though. +Seems to be most flexible, for Jackson we can have custom converter. My concern is MongoDB and XMI. +Not sure yet how it goes with MongoDB, JSON, and XMI import/export. Not sure yet how it goes with VariedProduct, BundleProduct, SubscribedProduct, SharedProduct, etc. + +3. Hybrid #1. Mixin is by default static, which hopefully covers 80% use case. +When you want dynamic, you can add more mixins. +But ain't this too complicated? +On the web client side, it's also more work. Not to mention inventory, etc. integration with other systems. +ProductInfo & principal etc. also use the fully dynamic approach. + +4. Hybrid #2. Mixin is by default dynamic, which covers 80% of the customization. +And for things like category, tag, color, size, they're static, with code support. i.e. must be generated by EMF. + + + + + + Attribute having single or multiple values. + +{ +attributes: + color: [{value: "red", displayValue: "Merah"}], + berbatikMaterial: [{value: "katun", displayValue: "Katun"}], + berbatikShawlLength: [{value: "90cm", displayValue: "90 cm"}], +mixins: { + "color": { + attributeTypes: { + color: {className: "TermValue", "name": "color", "label": "Warna"}, // nsPrefix: builtin + }, + "berbatik": { + attributeTypes: { + berbatikMaterial: {className: "TermValue", nsPrefix: "berbatik", name: "material", label: "Material"}, + berbatikBatikAge: {className: "TermValue", nsPrefix: "berbatik", name: "batikAge", label: "Batik Age"}, + } + }, +} + + +"berbatik:material": [{value: "Katun"}], + +nggak enak: +product['berbatik:material'][0].displayValue + +lebih enak: + +<p>Warna: {{product.attributes.color.0.displayValue}}</p> +<p>Material: {{product.attributes.berbatikMaterial.0.displayValue}}</p> + + + + + + + + + + Optional semantic of this value. + +i.e. value = 50 cm, semantic = less than, means "< 50 cm". + + + + + + + Attribute having single or multiple values. + +{ +attributes: + color: [{value: "red", displayValue: "Merah"}], + berbatikMaterial: [{value: "katun", displayValue: "Katun"}], + berbatikShawlLength: [{value: "90cm", displayValue: "90 cm"}], +mixins: { + "color": { + attributeTypes: { + color: {className: "TermValue", "name": "color", "label": "Warna"}, // nsPrefix: builtin + }, + "berbatik": { + attributeTypes: { + berbatikMaterial: {className: "TermValue", nsPrefix: "berbatik", name: "material", label: "Material"}, + berbatikBatikAge: {className: "TermValue", nsPrefix: "berbatik", name: "batikAge", label: "Batik Age"}, + } + }, +} + + +"berbatik:material": [{value: "Katun"}], + +nggak enak: +product['berbatik:material'][0].displayValue + +lebih enak: + +<p>Warna: {{product.attributes.color.0.displayValue}}</p> +<p>Material: {{product.attributes.berbatikMaterial.0.displayValue}}</p> + + + + + + Mixin with measured unit. + + + + + + + + + + + Mixin with measured unit. + + + + + Mixin with monetary value and currency code. + + + + + + + + + + Mixin with monetary value and currency code. + + + + + + + + + + + + + + + + + + + + + Range attribute's primary value can be either the start or end value. + + + + + + + + + + + Range attribute's primary value can be either the start or end value. + + + + + Use a taxonomy term. 'value' is the ID of the term. + + + + + + + + + + + '/'-separated slug path. + + + + + + + + + + Use a taxonomy term. 'value' is the ID of the term. + + + + + pindah jd attributetype. + + + + + + + + + + + + + + pindah jd attributetype. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + List of terms in a Vocabulary or if the Term is nested (tree vocabulary). + + + + + + + + + List of terms in a Vocabulary or if the Term is nested (tree vocabulary). + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/src/main/resources/org/soluvas/data/data.ecore b/data/src/main/resources/org/soluvas/data/data.ecore index 2cbc35011..9e52be154 100644 --- a/data/src/main/resources/org/soluvas/data/data.ecore +++ b/data/src/main/resources/org/soluvas/data/data.ecore @@ -2,42 +2,211 @@ - - -
- - + - -
- - - -
- - + - -
- - + + + + + + + +
+ + -
+
- - + + + + -
+
- + + + +
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + +
+ + + + +
+ + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+ + + + + + + +
+ + + + +
+ + + + +
+ + + + + +
+ + + + + +
+ + + + + + diff --git a/data/src/main/resources/org/soluvas/data/data.ecorediag b/data/src/main/resources/org/soluvas/data/data.ecorediag index 8c9e6c555..911e369e3 100644 --- a/data/src/main/resources/org/soluvas/data/data.ecorediag +++ b/data/src/main/resources/org/soluvas/data/data.ecorediag @@ -1,5 +1,5 @@ - + @@ -21,6 +21,689 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy-builtin.ecore b/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy-builtin.ecore index 7478bde82..b6609fdf6 100644 --- a/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy-builtin.ecore +++ b/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy-builtin.ecore @@ -3,4 +3,6 @@ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="taxonomy-builtin" nsURI="http://taxonomy-builtin/1.0" nsPrefix="taxonomy-builtin"> + + diff --git a/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy-builtin.ecorediag b/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy-builtin.ecorediag index 0e757643b..39d9b832f 100644 --- a/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy-builtin.ecorediag +++ b/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy-builtin.ecorediag @@ -1,43 +1,5 @@ - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - + @@ -70,22 +32,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - diff --git a/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy.ecore b/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy.ecore index 3aa51833b..b40868ef2 100644 --- a/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy.ecore +++ b/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy.ecore @@ -1,116 +1,4 @@ - - - -
- - - -
- - - - - - - - -
- - - - -
- - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - -
- - - - - -
- - - - -
- - - - - - - - - - - - -
- - - - - - - + diff --git a/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy.ecorediag b/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy.ecorediag index 9155473c6..ee1d4c273 100644 --- a/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy.ecorediag +++ b/taxonomy/src/main/resources/org/soluvas/taxonomy/taxonomy.ecorediag @@ -1,233 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
@@ -245,7 +17,7 @@ - + @@ -264,7 +36,7 @@ - + @@ -283,7 +55,7 @@ - + @@ -302,23 +74,7 @@ - - - - - - - - - - - - - - - - - + @@ -337,262 +93,8 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -