diff options
Diffstat (limited to 'core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/mapping/elist/PersistableEList.java')
-rwxr-xr-x | core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/mapping/elist/PersistableEList.java | 97 |
1 files changed, 34 insertions, 63 deletions
diff --git a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/mapping/elist/PersistableEList.java b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/mapping/elist/PersistableEList.java index 006ed40ae..1a65ace8d 100755 --- a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/mapping/elist/PersistableEList.java +++ b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/mapping/elist/PersistableEList.java @@ -35,24 +35,23 @@ import org.eclipse.emf.ecore.util.DelegatingEcoreEList; import org.eclipse.emf.teneo.util.StoreUtil; /** - * A persistable elist which can be used by different or mappers. This - * persistable elist works around the idea that the persisted list (e.g. - * PersistentList in Hibernate) is the delegate for this elist. + * A persistable elist which can be used by different or mappers. This persistable elist works + * around the idea that the persisted list (e.g. PersistentList in Hibernate) is the delegate for + * this elist. * * @author <a href="mailto:mtaal@elver.org">Martin Taal</a> * @version $Revision: 1.26 $ */ -public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> - implements PersistableDelegateList<E> { +public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> implements + PersistableDelegateList<E> { private static final long serialVersionUID = 1L; /** The logger */ private static Log log = LogFactory.getLog(PersistableEList.class); /** - * The actual list, must never be an elist as notifications etc. are done by - * this list + * The actual list, must never be an elist as notifications etc. are done by this list */ protected List<E> delegate; @@ -74,8 +73,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> protected Boolean isThisListWrapped; /** Constructor */ - public PersistableEList(InternalEObject owner, EStructuralFeature feature, - List<E> list) { + public PersistableEList(InternalEObject owner, EStructuralFeature feature, List<E> list) { super(owner); estructuralFeature = feature; if (list == null) { @@ -93,9 +91,8 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> } if (log.isDebugEnabled()) { - logString = "EList of type: " + this.getClass().getName() - + " of member " + estructuralFeature.getName() - + " owned by " + owner.getClass().getName() + logString = "EList of type: " + this.getClass().getName() + " of member " + + estructuralFeature.getName() + " owned by " + owner.getClass().getName() + " with delegate list " + delegate.getClass().getName(); if (log.isDebugEnabled()) { @@ -121,8 +118,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> } /** Takes care of deserializing the efeature */ - private void readObject(java.io.ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); estructuralFeature = StoreUtil.stringToStructureFeature(eFeaturePath); } @@ -130,8 +126,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * Get the underlying efeature * - * @see - * org.eclipse.emf.ecore.util.DelegatingEcoreEList#getEStructuralFeature() + * @see org.eclipse.emf.ecore.util.DelegatingEcoreEList#getEStructuralFeature() */ @Override public EStructuralFeature getEStructuralFeature() { @@ -181,13 +176,11 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> } /** - * If this instance is again wrapped by a NotifyingList then assume that the - * wrapper will be smart enough to do all the inverse things.... Note that - * the check if a list is wrapped is done once and then the result is - * cached. So this assumes that a list will not be re-wrapped. + * If this instance is again wrapped by a NotifyingList then assume that the wrapper will be smart + * enough to do all the inverse things.... Note that the check if a list is wrapped is done once + * and then the result is cached. So this assumes that a list will not be re-wrapped. * - * @return false if the list is wrapped, otherwise the super hasInverse is - * called. + * @return false if the list is wrapped, otherwise the super hasInverse is called. */ @Override protected boolean hasInverse() { @@ -210,8 +203,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> private boolean isWrapped() { if (isThisListWrapped == null) { final Object value = getEObject().eGet(getEStructuralFeature()); - isThisListWrapped = value != this - && value instanceof NotifyingList<?>; + isThisListWrapped = value != this && value instanceof NotifyingList<?>; } return isThisListWrapped; } @@ -234,8 +226,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> } /** - * Performs the load action if not yet oaded and sends out the load - * notification. + * Performs the load action if not yet oaded and sends out the load notification. */ protected void load() { if (isLoaded) { @@ -260,8 +251,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> // only set to false if it was true if (eDeliver) { if (log.isDebugEnabled()) { - log.debug("Owner " + owner.getClass() - + " set eDeliver to false"); + log.debug("Owner " + owner.getClass() + " set eDeliver to false"); } owner.eSetDeliver(false); setDeliver = true; @@ -319,8 +309,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> } /** - * The load method which should be overridden by the subclass to add - * lazyloading + * The load method which should be overridden by the subclass to add lazyloading */ protected abstract void doLoad(); @@ -336,8 +325,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see org.eclipse.emf.common.util.DelegatingEList#delegateAdd(int, - * java.lang.Object) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateAdd(int, java.lang.Object) */ @Override protected void delegateAdd(int index, E object) { @@ -348,8 +336,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see - * org.eclipse.emf.common.util.DelegatingEList#delegateAdd(java.lang.Object) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateAdd(java.lang.Object) */ @Override protected void delegateAdd(E object) { @@ -382,9 +369,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see - * org.eclipse.emf.common.util.DelegatingEList#delegateContains(java.lang - * .Object) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateContains(java.lang .Object) */ @Override protected boolean delegateContains(Object object) { @@ -395,9 +380,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see - * org.eclipse.emf.common.util.DelegatingEList#delegateContainsAll(java. - * util.Collection) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateContainsAll(java. util.Collection) */ @Override protected boolean delegateContainsAll(Collection<?> collection) { @@ -408,9 +391,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see - * org.eclipse.emf.common.util.DelegatingEList#delegateEquals(java.lang. - * Object) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateEquals(java.lang. Object) */ @Override protected boolean delegateEquals(Object object) { @@ -443,9 +424,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see - * org.eclipse.emf.common.util.DelegatingEList#delegateIndexOf(java.lang - * .Object) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateIndexOf(java.lang .Object) */ @Override protected int delegateIndexOf(Object object) { @@ -478,9 +457,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see - * org.eclipse.emf.common.util.DelegatingEList#delegateLastIndexOf(java. - * lang.Object) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateLastIndexOf(java. lang.Object) */ @Override protected int delegateLastIndexOf(Object object) { @@ -512,8 +489,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see org.eclipse.emf.common.util.DelegatingEList#delegateSet(int, - * java.lang.Object) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateSet(int, java.lang.Object) */ @Override protected E delegateSet(int index, E object) { @@ -546,9 +522,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> /* * (non-Javadoc) * - * @see - * org.eclipse.emf.common.util.DelegatingEList#delegateToArray(java.lang - * .Object[]) + * @see org.eclipse.emf.common.util.DelegatingEList#delegateToArray(java.lang .Object[]) */ @Override protected <T> T[] delegateToArray(T[] array) { @@ -585,8 +559,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> } /** - * If not loaded then basicIterator will always return a false for - * hasNext/hasPrevious + * If not loaded then basicIterator will always return a false for hasNext/hasPrevious */ @Override @SuppressWarnings("deprecation") @@ -611,8 +584,7 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> } /** - * If not loaded then basicIterator will always return a false for - * hasNext/hasPrevious + * If not loaded then basicIterator will always return a false for hasNext/hasPrevious */ @Override @SuppressWarnings("deprecation") @@ -638,12 +610,11 @@ public abstract class PersistableEList<E> extends DelegatingEcoreEList<E> } /** - * Is overridden because it can't use delegates for equality because the - * delegate (a hibernate or jpox list) will try to be equal with this - * persistable elist. + * Is overridden because it can't use delegates for equality because the delegate (a hibernate or + * jpox list) will try to be equal with this persistable elist. * - * This method does jvm instance equality because doing a full-fledge equal - * would result in a load of the list. + * This method does jvm instance equality because doing a full-fledge equal would result in a load + * of the list. */ @Override public boolean equals(Object object) { |