diff options
author | nhauge | 2011-03-21 17:55:01 +0000 |
---|---|---|
committer | nhauge | 2011-03-21 17:55:01 +0000 |
commit | 32cb4201a0cd3c8697bfd5bb4b28df3d3440fe6a (patch) | |
tree | 9fc4740099f45090d919424eaafd42c7a5a62c60 /jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java | |
parent | abc3a4ee2ecee5cff466e6f37706aabb89e19855 (diff) | |
download | webtools.dali-201103210000.tar.gz webtools.dali-201103210000.tar.xz webtools.dali-201103210000.zip |
This commit was manufactured by cvs2svn to create tag 'v201103210000'.v201103210000
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java deleted file mode 100644 index a77f1d3241..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; -import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping; -import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode; -import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned; -import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation; - -public class JavaEclipseLinkPrivateOwned - extends AbstractJavaJpaContextNode - implements EclipseLinkPrivateOwned -{ - protected boolean privateOwned; - - - public JavaEclipseLinkPrivateOwned(JavaAttributeMapping parent) { - super(parent); - this.privateOwned = this.buildPrivateOwned(); - } - - - // ********** synchronize/update ********** - - @Override - public void synchronizeWithResourceModel() { - super.synchronizeWithResourceModel(); - this.setPrivateOwned_(this.buildPrivateOwned()); - } - - - // ********** private owned ********** - - public boolean isPrivateOwned() { - return this.privateOwned; - } - - public void setPrivateOwned(boolean privateOwned) { - if (privateOwned != this.privateOwned) { - EclipseLinkPrivateOwnedAnnotation annotation = this.getPrivateOwnedAnnotation(); - if (privateOwned) { - if (annotation == null) { - this.addPrivateOwnedAnnotation(); - } - } else { - if (annotation != null) { - this.removePrivateOwnedAnnotation(); - } - } - - this.setPrivateOwned_(privateOwned); - } - } - - protected void setPrivateOwned_(boolean privateOwned) { - boolean old = this.privateOwned; - this.privateOwned = privateOwned; - this.firePropertyChanged(PRIVATE_OWNED_PROPERTY, old, privateOwned); - } - - protected boolean buildPrivateOwned() { - return this.getPrivateOwnedAnnotation() != null; - } - - - // ********** private owned annotation ********** - - protected EclipseLinkPrivateOwnedAnnotation getPrivateOwnedAnnotation() { - return (EclipseLinkPrivateOwnedAnnotation) this.getResourcePersistentAttribute().getAnnotation(this.getPrivateOwnedAnnotationName()); - } - - protected EclipseLinkPrivateOwnedAnnotation addPrivateOwnedAnnotation() { - return (EclipseLinkPrivateOwnedAnnotation) this.getResourcePersistentAttribute().addAnnotation(this.getPrivateOwnedAnnotationName()); - } - - protected void removePrivateOwnedAnnotation() { - this.getResourcePersistentAttribute().removeAnnotation(this.getPrivateOwnedAnnotationName()); - } - - protected String getPrivateOwnedAnnotationName() { - return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME; - } - - - // ********** misc ********** - - @Override - public JavaAttributeMapping getParent() { - return (JavaAttributeMapping) super.getParent(); - } - - protected JavaAttributeMapping getAttributeMapping() { - return this.getParent(); - } - - protected JavaResourcePersistentAttribute getResourcePersistentAttribute() { - return this.getAttributeMapping().getResourcePersistentAttribute(); - } - - - // ********** validation ********** - - public TextRange getValidationTextRange(CompilationUnit astRoot) { - EclipseLinkPrivateOwnedAnnotation annotation = this.getPrivateOwnedAnnotation(); - return (annotation == null) ? null : annotation.getTextRange(astRoot); - } -} |