diff options
Diffstat (limited to 'hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/property/EcoreAccess.java')
-rwxr-xr-x | hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/property/EcoreAccess.java | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/property/EcoreAccess.java b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/property/EcoreAccess.java index 56a50970d..4497a6950 100755 --- a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/property/EcoreAccess.java +++ b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/property/EcoreAccess.java @@ -32,45 +32,38 @@ public class EcoreAccess { /** Return the DynamicValueHolder */ public static DynamicValueHolder getValueHolder(BasicEObjectImpl deo) { - if (deo instanceof DynamicValueHolder - && !(deo instanceof DynamicEObjectImpl)) { + if (deo instanceof DynamicValueHolder && !(deo instanceof DynamicEObjectImpl)) { return (DynamicValueHolder) deo; } - return (DynamicValueHolder) FieldUtil - .callMethod(deo, "eSettings", null); + return (DynamicValueHolder) FieldUtil.callMethod(deo, "eSettings", null); } /** Sets an elist using the passed feature */ - public static void setManyEFeatureValue(EStructuralFeature eFeature, - Object value, BasicEObjectImpl owner) { + public static void setManyEFeatureValue(EStructuralFeature eFeature, Object value, + BasicEObjectImpl owner) { final DynamicValueHolder dvh = getValueHolder(owner); dvh.dynamicSet(getFeatureId(owner, eFeature), value); } /** Gets an elist using the passed feature */ - public static EList<?> getManyEFeatureValue(EStructuralFeature eFeature, - BasicEObjectImpl owner) { + public static EList<?> getManyEFeatureValue(EStructuralFeature eFeature, BasicEObjectImpl owner) { final DynamicValueHolder dvh = getValueHolder(owner); return (EList<?>) dvh.dynamicGet(getFeatureId(owner, eFeature)); } - public static int getFeatureId(BasicEObjectImpl owner, - EStructuralFeature eFeature) { + public static int getFeatureId(BasicEObjectImpl owner, EStructuralFeature eFeature) { int featureId = owner.eClass().getFeatureID(eFeature); if (!isStaticFeature(eFeature, owner)) { - final int staticFeatureCount = (Integer) FieldUtil.callMethod( - owner, "eStaticFeatureCount", null); + final int staticFeatureCount = (Integer) FieldUtil.callMethod(owner, "eStaticFeatureCount", + null); featureId = featureId - staticFeatureCount; } return featureId; } /** Determines if a passed feature is a static feature */ - public static boolean isStaticFeature(EStructuralFeature eFeature, - BasicEObjectImpl owner) { - Integer staticFeatureCount = (Integer) FieldUtil.callMethod(owner, - "eStaticFeatureCount", null); - return owner.eClass().getFeatureID(eFeature) < staticFeatureCount - .intValue(); + public static boolean isStaticFeature(EStructuralFeature eFeature, BasicEObjectImpl owner) { + Integer staticFeatureCount = (Integer) FieldUtil.callMethod(owner, "eStaticFeatureCount", null); + return owner.eClass().getFeatureID(eFeature) < staticFeatureCount.intValue(); } }
\ No newline at end of file |