diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java')
72 files changed, 0 insertions, 6342 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java deleted file mode 100644 index 114103cc1c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkBasicCollectionAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkBasicCollectionAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation; - -/** - * org.eclipse.persistence.annotations.BasicCollection - */ -public class EclipseLinkBasicCollectionAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkBasicCollectionAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkBasicCollectionAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkBasicCollectionAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkBasicCollectionAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java deleted file mode 100644 index 6cb395f51a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkBasicMapAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkBasicMapAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation; - -/** - * org.eclipse.persistence.annotations.BasicMap - */ -public class EclipseLinkBasicMapAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkBasicMapAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkBasicMapAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkBasicMapAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkBasicMapAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java deleted file mode 100644 index a978013270..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkCacheAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkCacheAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation; - -/** - * org.eclipse.persistence.annotations.Cache - */ -public class EclipseLinkCacheAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkCacheAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkCacheAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkCacheAnnotation((JavaResourcePersistentType) parent, (Type) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - return new NullEclipseLinkCacheAnnotation((JavaResourcePersistentType) parent); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkCacheAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkCacheAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java deleted file mode 100644 index 4e12074f45..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkChangeTrackingAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkChangeTrackingAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation; - -/** - * org.eclipse.persistence.annotations.ChangeTracking - */ -public class EclipseLinkChangeTrackingAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkChangeTrackingAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkChangeTrackingAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkChangeTrackingAnnotation((JavaResourcePersistentType) parent, (Type) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkChangeTrackingAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java deleted file mode 100644 index 76a469bf9e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkConvertAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkConvertAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation; - -/** - * org.eclipse.persistence.annotations.Convert - */ -public class EclipseLinkConvertAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkConvertAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkConvertAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkConvertAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkConvertAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkConvertAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java deleted file mode 100644 index 6ef7e4bd31..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.Converter - */ -public class EclipseLinkConverterAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkConverterAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkConverterAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkConverterAnnotation(parent, member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkConverterAnnotation(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkConverterAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java deleted file mode 100644 index 0099287dff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkCustomizerAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkCustomizerAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation; - -/** - * org.eclipse.persistence.annotations.Customizer - */ -public class EclipseLinkCustomizerAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkCustomizerAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkCustomizerAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkCustomizerAnnotation(parent, (Type) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkCustomizerAnnotation(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkCustomizerAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java deleted file mode 100644 index 2fd4a71e5a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkExistenceCheckingAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkExistenceCheckingAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation; - -/** - * org.eclipse.persistence.annotations.ExistenceChecking - */ -public class EclipseLinkExistenceCheckingAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkExistenceCheckingAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkExistenceCheckingAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkExistenceCheckingAnnotation((JavaResourcePersistentType) parent, (Type) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkExistenceCheckingAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java deleted file mode 100644 index e74ae64cb2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkJoinFetchAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkJoinFetchAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation; - -/** - * org.eclipse.persistence.annotations.JoinFetch - */ -public class EclipseLinkJoinFetchAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkJoinFetchAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkJoinFetchAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkJoinFetchAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - return new NullEclipseLinkJoinFetchAnnotation((JavaResourcePersistentAttribute) parent); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkJoinFetchAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java deleted file mode 100644 index 8b69fbd85f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkMutableAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkMutableAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation; - -/** - * org.eclipse.persistence.annotations.Mutable - */ -public class EclipseLinkMutableAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkMutableAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkMutableAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkMutableAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkMutableAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkMutableAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java deleted file mode 100644 index d808dcac6f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkObjectTypeConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkObjectTypeConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.ObjectTypeConverter - */ -public class EclipseLinkObjectTypeConverterAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkObjectTypeConverterAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkObjectTypeConverterAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkObjectTypeConverterAnnotation(parent, member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkObjectTypeConverterAnnotation(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java deleted file mode 100644 index 740069f3d5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkPrivateOwnedAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkPrivateOwnedAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation; - -/** - * org.eclipse.persistence.annotations.PrivateOwned - */ -public class EclipseLinkPrivateOwnedAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkPrivateOwnedAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkPrivateOwnedAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkPrivateOwnedAnnotation(parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkPrivateOwnedAnnotation(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java deleted file mode 100644 index f12165269e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkReadOnlyAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkReadOnlyAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadOnly - */ -public class EclipseLinkReadOnlyAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkReadOnlyAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkReadOnlyAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkReadOnlyAnnotation(parent, (Type) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkReadOnlyAnnotation(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java deleted file mode 100644 index 2edc4ed3ef..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkReadTransformerAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkReadTransformerAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadTransformer - */ -public class EclipseLinkReadTransformerAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkReadTransformerAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkReadTransformerAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkReadTransformerAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkReadTransformerAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkReadTransformerAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java deleted file mode 100644 index a370f1e634..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkStructConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkStructConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.StructConverter - */ -public class EclipseLinkStructConverterAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkStructConverterAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkStructConverterAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkStructConverterAnnotation(parent, member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkStructConverterAnnotation(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkStructConverterAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java deleted file mode 100644 index 1908362bcd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTransformationAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTransformationAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation; - -/** - * org.eclipse.persistence.annotations.Transformation - */ -public class EclipseLinkTransformationAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkTransformationAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkTransformationAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkTransformationAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - return new NullEclipseLinkTransformationAnnotation((JavaResourcePersistentAttribute) parent); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkTransformationAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkTransformationAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java deleted file mode 100644 index 275528e984..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTypeConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTypeConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.TypeConverter - */ -public class EclipseLinkTypeConverterAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkTypeConverterAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkTypeConverterAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkTypeConverterAnnotation(parent, member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkTypeConverterAnnotation(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java deleted file mode 100644 index fea99e00e8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkVariableOneToOneAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkVariableOneToOneAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation; - -/** - * org.eclipse.persistence.annotations.VariableOneToOne - */ -public class EclipseLinkVariableOneToOneAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkVariableOneToOneAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkVariableOneToOneAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkVariableOneToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - return new NullEclipseLinkVariableOneToOneAnnotation((JavaResourcePersistentAttribute) parent); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkVariableOneToOneAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java deleted file mode 100644 index 5993a8fe13..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkWriteTransformerAnnotation; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkWriteTransformerAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation; - -/** - * org.eclipse.persistence.annotations.WriteTransformer - */ -public class EclipseLinkWriteTransformerAnnotationDefinition - implements AnnotationDefinition -{ - // singleton - private static final AnnotationDefinition INSTANCE = new EclipseLinkWriteTransformerAnnotationDefinition(); - - /** - * Return the singleton. - */ - public static AnnotationDefinition instance() { - return INSTANCE; - } - - /** - * Ensure single instance. - */ - private EclipseLinkWriteTransformerAnnotationDefinition() { - super(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEclipseLinkWriteTransformerAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); - } - - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - throw new UnsupportedOperationException(); - } - - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryEclipseLinkWriteTransformerAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); - } - - public String getAnnotationName() { - return EclipseLinkWriteTransformerAnnotation.ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java deleted file mode 100644 index de2eb61fee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.NullAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType; -import org.eclipse.jpt.eclipselink.core.resource.java.CacheType; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation; - -/** - * org.eclipse.persistence.annotations.Cache - */ -public class NullEclipseLinkCacheAnnotation - extends NullAnnotation - implements EclipseLinkCacheAnnotation -{ - - protected NullEclipseLinkCacheAnnotation(JavaResourcePersistentType parent) { - super(parent); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - protected EclipseLinkCacheAnnotation addAnnotation() { - return (EclipseLinkCacheAnnotation) super.addAnnotation(); - } - - // ***** type - public CacheType getType() { - return null; - } - - public void setType(CacheType type) { - if (type != null) { - this.addAnnotation().setType(type); - } - } - - public TextRange getTypeTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** size - public Integer getSize() { - return null; - } - - public void setSize(Integer size) { - if (size != null) { - this.addAnnotation().setSize(size); - } - } - - public TextRange getSizeTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** shared - public Boolean getShared() { - return null; - } - - public void setShared(Boolean shared) { - if (shared != null) { - this.addAnnotation().setShared(shared); - } - } - - public TextRange getSharedTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** expiry - public Integer getExpiry() { - return null; - } - - public void setExpiry(Integer expiry) { - if (expiry != null) { - this.addAnnotation().setExpiry(expiry); - } - } - - public TextRange getExpiryTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** expiry time of day - public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() { - return null; - } - - public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() { - return this.addAnnotation().addExpiryTimeOfDay(); - } - - public void removeExpiryTimeOfDay() { - // do nothing - } - - public TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** always refresh - public Boolean getAlwaysRefresh() { - return null; - } - - public void setAlwaysRefresh(Boolean alwaysRefresh) { - if (alwaysRefresh != null) { - this.addAnnotation().setAlwaysRefresh(alwaysRefresh); - } - } - - public TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** refresh only if newer - public Boolean getRefreshOnlyIfNewer() { - return null; - } - - public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) { - if (refreshOnlyIfNewer != null) { - this.addAnnotation().setRefreshOnlyIfNewer(refreshOnlyIfNewer); - } - } - - public TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** disable hits - public Boolean getDisableHits() { - return null; - } - - public void setDisableHits(Boolean disableHits) { - if (disableHits != null) { - this.addAnnotation().setDisableHits(disableHits); - } - } - - public TextRange getDisablesHitsTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** coordination type - public CacheCoordinationType getCoordinationType() { - return null; - } - - public void setCoordinationType(CacheCoordinationType coordinationType) { - if (coordinationType != null) { - this.addAnnotation().setCoordinationType(coordinationType); - } - } - - public TextRange getCoordinationTypeTextRange(CompilationUnit astRoot) { - return null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java deleted file mode 100644 index a54e42a3d5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.NullAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType; - -/** - * org.eclipse.persistence.annotations.JoinFetch - */ -public class NullEclipseLinkJoinFetchAnnotation - extends NullAnnotation - implements EclipseLinkJoinFetchAnnotation -{ - protected NullEclipseLinkJoinFetchAnnotation(JavaResourcePersistentAttribute parent) { - super(parent); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - protected EclipseLinkJoinFetchAnnotation addAnnotation() { - return (EclipseLinkJoinFetchAnnotation) super.addAnnotation(); - } - - // ***** value - public JoinFetchType getValue() { - return null; - } - - public void setValue(JoinFetchType value) { - if (value != null) { - this.addAnnotation().setValue(value); - } - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - return null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java deleted file mode 100644 index f08f045eb8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.NullAnnotation; -import org.eclipse.jpt.core.resource.java.FetchType; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation; - -/** - * org.eclipse.persistence.annotations.Transformation - */ -public class NullEclipseLinkTransformationAnnotation - extends NullAnnotation - implements EclipseLinkTransformationAnnotation -{ - protected NullEclipseLinkTransformationAnnotation(JavaResourcePersistentAttribute parent) { - super(parent); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - protected EclipseLinkTransformationAnnotation addAnnotation() { - return (EclipseLinkTransformationAnnotation) super.addAnnotation(); - } - - // ***** fetch - public FetchType getFetch() { - return null; - } - - public void setFetch(FetchType fetch) { - if (fetch != null) { - this.addAnnotation().setFetch(fetch); - } - } - - public TextRange getFetchTextRange(CompilationUnit astRoot) { - return null; - } - - // ***** optional - public Boolean getOptional() { - return null; - } - - public void setOptional(Boolean optional) { - if (optional != null) { - this.addAnnotation().setOptional(optional); - } - } - - public TextRange getOptionalTextRange(CompilationUnit astRoot) { - return null; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkVariableOneToOneAnnotation.java deleted file mode 100644 index 3a3fe83e65..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkVariableOneToOneAnnotation.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jpt.core.internal.resource.java.NullAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation; - -/** - * org.eclipse.persistence.annotations.VariableOneToOne - */ -public class NullEclipseLinkVariableOneToOneAnnotation - extends NullAnnotation - implements EclipseLinkVariableOneToOneAnnotation -{ - protected NullEclipseLinkVariableOneToOneAnnotation(JavaResourcePersistentAttribute parent) { - super(parent); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - protected EclipseLinkVariableOneToOneAnnotation addAnnotation() { - return (EclipseLinkVariableOneToOneAnnotation) super.addAnnotation(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java deleted file mode 100644 index c35e60ca8e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2009 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.eclipselink.core.internal.resource.java; - -import org.eclipse.jpt.core.internal.resource.java.NullColumnAnnotation; -import org.eclipse.jpt.core.resource.java.ColumnAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation; - -/** - * javax.persistence.Column - */ -public class NullEclipseLinkWriteTransformerColumnAnnotation - extends NullColumnAnnotation -{ - public NullEclipseLinkWriteTransformerColumnAnnotation(EclipseLinkWriteTransformerAnnotation parent) { - super(parent); - } - - private EclipseLinkWriteTransformerAnnotation getWriteTransformerAnnotation() { - return (EclipseLinkWriteTransformerAnnotation) this.parent; - } - - @Override - protected ColumnAnnotation addAnnotation() { - return this.getWriteTransformerAnnotation().addColumn(); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java deleted file mode 100644 index 8cdde8f181..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.BaseEclipseLinkTypeConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.ObjectTypeConverter - * org.eclipse.persistence.annotations.TypeConverter - */ -abstract class BinaryBaseEclipseLinkTypeConverterAnnotation - extends BinaryEclipseLinkNamedConverterAnnotation - implements BaseEclipseLinkTypeConverterAnnotation -{ - String dataType; - String objectType; - - - BinaryBaseEclipseLinkTypeConverterAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.dataType = this.buildDataType(); - this.objectType = this.buildObjectType(); - } - - @Override - public void update() { - super.update(); - this.setDataType_(this.buildDataType()); - this.setObjectType_(this.buildObjectType()); - } - - - // ********** ObjectTypeConverterAnnotation implementation ********** - - // ***** data type - public String getDataType() { - return this.dataType; - } - - public void setDataType(String dataType) { - throw new UnsupportedOperationException(); - } - - private void setDataType_(String dataType) { - String old = this.dataType; - this.dataType = dataType; - this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType); - } - - private String buildDataType() { - return (String) this.getJdtMemberValue(this.getDataTypeElementName()); - } - - public TextRange getDataTypeTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - abstract String getDataTypeElementName(); - - // ***** object type - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - throw new UnsupportedOperationException(); - } - - private void setObjectType_(String objectType) { - String old = this.objectType; - this.objectType = objectType; - this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType); - } - - private String buildObjectType() { - return (String) this.getJdtMemberValue(this.getObjectTypeElementName()); - } - - public TextRange getObjectTypeTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - abstract String getObjectTypeElementName(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java deleted file mode 100644 index fa347a9abb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation; - -/** - * org.eclipse.persistence.annotations.BasicCollection - */ -public final class BinaryEclipseLinkBasicCollectionAnnotation - extends BinaryAnnotation - implements EclipseLinkBasicCollectionAnnotation -{ - public BinaryEclipseLinkBasicCollectionAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java deleted file mode 100644 index 1595c2f343..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation; - -/** - * org.eclipse.persistence.annotations.BasicMap - */ -public final class BinaryEclipseLinkBasicMapAnnotation - extends BinaryAnnotation - implements EclipseLinkBasicMapAnnotation -{ - public BinaryEclipseLinkBasicMapAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java deleted file mode 100644 index a7fa58bceb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java +++ /dev/null @@ -1,311 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType; -import org.eclipse.jpt.eclipselink.core.resource.java.CacheType; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation; - -/** - * org.eclipse.persistence.annotations.Cache - */ -public final class BinaryEclipseLinkCacheAnnotation - extends BinaryAnnotation - implements EclipseLinkCacheAnnotation -{ - private CacheType type; - private Integer size; - private Boolean shared; - private Integer expiry; - private EclipseLinkTimeOfDayAnnotation expiryTimeOfDay; - private Boolean alwaysRefresh; - private Boolean refreshOnlyIfNewer; - private Boolean disableHits; - private CacheCoordinationType coordinationType; - - - public BinaryEclipseLinkCacheAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.type = this.buildType(); - this.size = this.buildSize(); - this.shared = this.buildShared(); - this.expiry = this.buildExpiry(); - this.expiryTimeOfDay = this.buildExpiryTimeOfDay(); - this.alwaysRefresh = this.buildAlwaysRefresh(); - this.refreshOnlyIfNewer = this.buildRefreshOnlyIfNewer(); - this.disableHits = this.buildDisableHits(); - this.coordinationType = this.buildCoordinationType(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - // TODO - @Override - public void update() { - super.update(); - this.setType_(this.buildType()); - this.setSize_(this.buildSize()); - this.setShared_(this.buildShared()); - this.setExpiry_(this.buildExpiry()); - this.updateExpiryTimeOfDay(); - this.setAlwaysRefresh_(this.buildAlwaysRefresh()); - this.setRefreshOnlyIfNewer_(this.buildRefreshOnlyIfNewer()); - this.setDisableHits_(this.buildDisableHits()); - this.setCoordinationType_(this.buildCoordinationType()); - } - - - // ********** CacheAnnotation implementation ********** - - // ***** type - public CacheType getType() { - return this.type; - } - - public void setType(CacheType type) { - throw new UnsupportedOperationException(); - } - - private void setType_(CacheType type) { - CacheType old = this.type; - this.type = type; - this.firePropertyChanged(TYPE_PROPERTY, old, type); - } - - private CacheType buildType() { - return CacheType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CACHE__TYPE)); - } - - public TextRange getTypeTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** size - public Integer getSize() { - return this.size; - } - - public void setSize(Integer size) { - throw new UnsupportedOperationException(); - } - - private void setSize_(Integer size) { - Integer old = this.size; - this.size = size; - this.firePropertyChanged(SIZE_PROPERTY, old, size); - } - - private Integer buildSize() { - return (Integer) this.getJdtMemberValue(EclipseLink.CACHE__SIZE); - } - - public TextRange getSizeTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** shared - public Boolean getShared() { - return this.shared; - } - - public void setShared(Boolean shared) { - throw new UnsupportedOperationException(); - } - - private void setShared_(Boolean shared) { - Boolean old = this.shared; - this.shared = shared; - this.firePropertyChanged(SHARED_PROPERTY, old, shared); - } - - private Boolean buildShared() { - return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__SHARED); - } - - public TextRange getSharedTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** expiry - public Integer getExpiry() { - return this.expiry; - } - - public void setExpiry(Integer expiry) { - throw new UnsupportedOperationException(); - } - - private void setExpiry_(Integer expiry) { - Integer old = this.expiry; - this.expiry = expiry; - this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry); - } - - private Integer buildExpiry() { - return (Integer) this.getJdtMemberValue(EclipseLink.CACHE__EXPIRY); - } - - public TextRange getExpiryTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** expiry time of day - public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() { - return this.expiryTimeOfDay; - } - - public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() { - throw new UnsupportedOperationException(); - } - - public void removeExpiryTimeOfDay() { - throw new UnsupportedOperationException(); - } - - private EclipseLinkTimeOfDayAnnotation buildExpiryTimeOfDay() { - IAnnotation jdtTimeOfDay = this.getJdtExpiryTimeOfDay(); - return (jdtTimeOfDay == null) ? null : this.buildTimeOfDay(jdtTimeOfDay); - } - - private EclipseLinkTimeOfDayAnnotation buildTimeOfDay(IAnnotation jdtTimeOfDay) { - return new BinaryEclipseLinkTimeOfDayAnnotation(this, jdtTimeOfDay); - } - - private IAnnotation getJdtExpiryTimeOfDay() { - return (IAnnotation) this.getJdtMemberValue(EclipseLink.CACHE__EXPIRY_TIME_OF_DAY); - } - - private void setExpiryTimeOfDay(EclipseLinkTimeOfDayAnnotation expiryTimeOfDay) { - EclipseLinkTimeOfDayAnnotation old = this.expiryTimeOfDay; - this.expiryTimeOfDay = expiryTimeOfDay; - this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, expiryTimeOfDay); - } - - // TODO - private void updateExpiryTimeOfDay() { - throw new UnsupportedOperationException(); -// IAnnotation jdtTimeOfDay = this.getJdtExpiryTimeOfDay(); -// if (jdtTimeOfDay == null) { -// this.setExpiryTimeOfDay(null); -// } else { -// if (this.expiryTimeOfDay == null) { -// this.setExpiryTimeOfDay(this.buildTimeOfDay(jdtTimeOfDay)); -// } else { -// this.expiryTimeOfDay.update(jdtTimeOfDay); -// } -// } - } - - public TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** always refresh - public Boolean getAlwaysRefresh() { - return this.alwaysRefresh; - } - - public void setAlwaysRefresh(Boolean alwaysRefresh) { - throw new UnsupportedOperationException(); - } - - private void setAlwaysRefresh_(Boolean alwaysRefresh) { - Boolean old = this.alwaysRefresh; - this.alwaysRefresh = alwaysRefresh; - this.firePropertyChanged(ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh); - } - - private Boolean buildAlwaysRefresh() { - return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__ALWAYS_REFRESH); - } - - public TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** refresh only if newer - public Boolean getRefreshOnlyIfNewer() { - return this.refreshOnlyIfNewer; - } - - public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) { - throw new UnsupportedOperationException(); - } - - private void setRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) { - Boolean old = this.refreshOnlyIfNewer; - this.refreshOnlyIfNewer = refreshOnlyIfNewer; - this.firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer); - } - - private Boolean buildRefreshOnlyIfNewer() { - return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__REFRESH_ONLY_IF_NEWER); - } - - public TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** disable hits - public Boolean getDisableHits() { - return this.disableHits; - } - - public void setDisableHits(Boolean disableHits) { - throw new UnsupportedOperationException(); - } - - private void setDisableHits_(Boolean disableHits) { - Boolean old = this.disableHits; - this.disableHits = disableHits; - this.firePropertyChanged(DISABLE_HITS_PROPERTY, old, disableHits); - } - - private Boolean buildDisableHits() { - return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__DISABLE_HITS); - } - - public TextRange getDisablesHitsTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** coordination type - public CacheCoordinationType getCoordinationType() { - return this.coordinationType; - } - - public void setCoordinationType(CacheCoordinationType coordinationType) { - throw new UnsupportedOperationException(); - } - - private void setCoordinationType_(CacheCoordinationType coordinationType) { - CacheCoordinationType old = this.coordinationType; - this.coordinationType = coordinationType; - this.firePropertyChanged(TYPE_PROPERTY, old, coordinationType); - } - - private CacheCoordinationType buildCoordinationType() { - return CacheCoordinationType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CACHE__COORDINATION_TYPE)); - } - - public TextRange getCoordinationTypeTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java deleted file mode 100644 index 21c8ff091f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.ChangeTracking - */ -public final class BinaryEclipseLinkChangeTrackingAnnotation - extends BinaryAnnotation - implements EclipseLinkChangeTrackingAnnotation -{ - private ChangeTrackingType value; - - - public BinaryEclipseLinkChangeTrackingAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.value = this.buildValue(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - // TODO - @Override - public void update() { - super.update(); - this.setValue_(this.buildValue()); - } - - - // ********** ChangeTrackingAnnotation implementation ********** - - // ***** value - public ChangeTrackingType getValue() { - return this.value; - } - - public void setValue(ChangeTrackingType value) { - throw new UnsupportedOperationException(); - } - - private void setValue_(ChangeTrackingType value) { - ChangeTrackingType old = this.value; - this.value = value; - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private ChangeTrackingType buildValue() { - return ChangeTrackingType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CHANGE_TRACKING__VALUE)); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java deleted file mode 100644 index 8868c555e8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.ConversionValue - */ -final class BinaryEclipseLinkConversionValueAnnotation - extends BinaryAnnotation - implements EclipseLinkConversionValueAnnotation -{ - private String dataValue; - private String objectValue; - - - BinaryEclipseLinkConversionValueAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.dataValue = this.buildDataValue(); - this.objectValue = this.buildObjectValue(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setDataValue_(this.buildDataValue()); - this.setObjectValue_(this.buildObjectValue()); - } - - - // ********** ConversionValueAnnotation implementation ********** - - // ***** data value - public String getDataValue() { - return this.dataValue; - } - - public void setDataValue(String dataValue) { - throw new UnsupportedOperationException(); - } - - private void setDataValue_(String dataValue) { - String old = this.dataValue; - this.dataValue = dataValue; - this.firePropertyChanged(DATA_VALUE_PROPERTY, old, dataValue); - } - - private String buildDataValue() { - return (String) this.getJdtMemberValue(EclipseLink.CONVERSION_VALUE__DATA_VALUE); - } - - public TextRange getDataValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** object value - public String getObjectValue() { - return this.objectValue; - } - - public void setObjectValue(String objectValue) { - throw new UnsupportedOperationException(); - } - - private void setObjectValue_(String objectValue) { - String old = this.objectValue; - this.objectValue = objectValue; - this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, objectValue); - } - - private String buildObjectValue() { - return (String) this.getJdtMemberValue(EclipseLink.CONVERSION_VALUE__OBJECT_VALUE); - } - - public TextRange getObjectValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java deleted file mode 100644 index 8c1d409fb2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.Convert - */ -public final class BinaryEclipseLinkConvertAnnotation - extends BinaryAnnotation - implements EclipseLinkConvertAnnotation -{ - private String value; - - public BinaryEclipseLinkConvertAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.value = this.buildValue(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setValue_(this.buildValue()); - } - - - // ********** ConvertAnnotation implementation ********** - - // ***** value - public String getValue() { - return this.value; - } - - public void setValue(String value) { - throw new UnsupportedOperationException(); - } - - private void setValue_(String value) { - String old = this.value; - this.value = value; - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private String buildValue() { - return (String) this.getJdtMemberValue(EclipseLink.CONVERT__VALUE); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - public boolean valueTouches(int pos, CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java deleted file mode 100644 index a20191a960..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.Converter - */ -public final class BinaryEclipseLinkConverterAnnotation - extends BinaryEclipseLinkNamedConverterAnnotation - implements EclipseLinkConverterAnnotation -{ - private String converterClass; - - - public BinaryEclipseLinkConverterAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.converterClass = this.buildConverterClass(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setConverterClass_(this.buildConverterClass()); - } - - - // ********** BinaryNamedConverterAnnotation implementation ********** - - @Override - String getNameElementName() { - return EclipseLink.CONVERTER__NAME; - } - - // ********** ConverterAnnotation implementation ********** - - // ***** converter class - public String getConverterClass() { - return this.converterClass; - } - - public void setConverterClass(String converterClass) { - throw new UnsupportedOperationException(); - } - - private void setConverterClass_(String converterClass) { - String old = this.converterClass; - this.converterClass = converterClass; - this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, converterClass); - } - - private String buildConverterClass() { - return (String) this.getJdtMemberValue(EclipseLink.CONVERTER__CONVERTER_CLASS); - } - - public TextRange getConverterClassTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - public boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java deleted file mode 100644 index a3bd13bc84..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.Customizer - */ -public final class BinaryEclipseLinkCustomizerAnnotation - extends BinaryAnnotation - implements EclipseLinkCustomizerAnnotation -{ - private String value; - - - public BinaryEclipseLinkCustomizerAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.value = this.buildValue(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setValue_(this.buildValue()); - } - - - // ********** CustomizerAnnotation implementation ********** - - // ***** value - public String getValue() { - return this.value; - } - - public void setValue(String value) { - throw new UnsupportedOperationException(); - } - - private void setValue_(String value) { - String old = this.value; - this.value = value; - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private String buildValue() { - return (String) this.getJdtMemberValue(EclipseLink.CUSTOMIZER__VALUE); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - public boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java deleted file mode 100644 index 5f4add2b68..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType; - -/** - * org.eclipse.persistence.annotations.ExistenceChecking - */ -public final class BinaryEclipseLinkExistenceCheckingAnnotation - extends BinaryAnnotation - implements EclipseLinkExistenceCheckingAnnotation -{ - private ExistenceType value; - - - public BinaryEclipseLinkExistenceCheckingAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.value = this.buildValue(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setValue_(this.buildValue()); - } - - - // ********** ExistenceCheckingAnnotation implementation ********** - - // ***** value - public ExistenceType getValue() { - return this.value; - } - - public void setValue(ExistenceType value) { - throw new UnsupportedOperationException(); - } - - private void setValue_(ExistenceType value) { - ExistenceType old = this.value; - this.value = value; - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private ExistenceType buildValue() { - return ExistenceType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.EXISTENCE_CHECKING__VALUE)); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java deleted file mode 100644 index a772ff26e5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType; - -/** - * org.eclipse.persistence.annotations.JoinFetch - */ -public final class BinaryEclipseLinkJoinFetchAnnotation - extends BinaryAnnotation - implements EclipseLinkJoinFetchAnnotation -{ - private JoinFetchType value; - - - public BinaryEclipseLinkJoinFetchAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.value = this.buildValue(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setValue_(this.buildValue()); - } - - - // ********** BinaryJoinFetchAnnotation implementation ********** - - // ***** value - public JoinFetchType getValue() { - return this.value; - } - - public void setValue(JoinFetchType value) { - throw new UnsupportedOperationException(); - } - - private void setValue_(JoinFetchType value) { - JoinFetchType old = this.value; - this.value = value; - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private JoinFetchType buildValue() { - return JoinFetchType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.JOIN_FETCH__VALUE)); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java deleted file mode 100644 index 50deeb43a6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation; - -/** - * org.eclipse.persistence.annotations.Mutable - */ -public final class BinaryEclipseLinkMutableAnnotation - extends BinaryAnnotation - implements EclipseLinkMutableAnnotation -{ - private Boolean value; - - - public BinaryEclipseLinkMutableAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.value = this.buildValue(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setValue_(this.buildValue()); - } - - - // ********** MutableAnnotation implementation ********** - - // ***** value - public Boolean getValue() { - return this.value; - } - - public void setValue(Boolean value) { - throw new UnsupportedOperationException(); - } - - private void setValue_(Boolean value) { - Boolean old = this.value; - this.value = value; - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private Boolean buildValue() { - return (Boolean) this.getJdtMemberValue(EclipseLink.MUTABLE__VALUE); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java deleted file mode 100644 index b49f177ef4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.Converter - * org.eclipse.persistence.annotations.StructConverter - * org.eclipse.persistence.annotations.TypeConverter - * org.eclipse.persistence.annotations.ObjectTypeConverter - */ -abstract class BinaryEclipseLinkNamedConverterAnnotation - extends BinaryAnnotation - implements EclipseLinkNamedConverterAnnotation -{ - String name; - - BinaryEclipseLinkNamedConverterAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.name = this.buildName(); - } - - @Override - public void update() { - super.update(); - this.setName_(this.buildName()); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.name); - } - - - // ********** NamedConverterAnnotation implementation ********** - - // ***** name - public String getName() { - return this.name; - } - - public void setName(String name) { - throw new UnsupportedOperationException(); - } - - private void setName_(String name) { - String old = this.name; - this.name = name; - this.firePropertyChanged(NAME_PROPERTY, old, name); - } - - private String buildName() { - return (String) this.getJdtMemberValue(this.getNameElementName()); - } - - public TextRange getNameTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - abstract String getNameElementName(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java deleted file mode 100644 index 4b23b13af6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import java.util.ListIterator; -import java.util.Vector; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation; -import org.eclipse.jpt.utility.internal.iterators.CloneListIterator; - -/** - * org.eclipse.persistence.annotations.ObjectTypeConverter - */ -public final class BinaryEclipseLinkObjectTypeConverterAnnotation - extends BinaryBaseEclipseLinkTypeConverterAnnotation - implements EclipseLinkObjectTypeConverterAnnotation -{ - private String defaultObjectValue; - private final Vector<EclipseLinkConversionValueAnnotation> conversionValues; - - - public BinaryEclipseLinkObjectTypeConverterAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.defaultObjectValue = this.buildDefaultObjectValue(); - this.conversionValues = this.buildConversionValues(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setDefaultObjectValue_(this.buildDefaultObjectValue()); - this.updateConversionValues(); - } - - - // ********** BinaryNamedConverterAnnotation implementation ********** - - @Override - String getNameElementName() { - return EclipseLink.OBJECT_TYPE_CONVERTER__NAME; - } - - // ********** BinaryBaseTypeConverterAnnotation implementation ********** - - @Override - String getDataTypeElementName() { - return EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE; - } - - @Override - String getObjectTypeElementName() { - return EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE; - } - - // ********** ObjectTypeConverterAnnotation implementation ********** - - // ***** default object value - public String getDefaultObjectValue() { - return this.defaultObjectValue; - } - - public void setDefaultObjectValue(String defaultObjectValue) { - throw new UnsupportedOperationException(); - } - - private void setDefaultObjectValue_(String defaultObjectValue) { - String old = this.defaultObjectValue; - this.defaultObjectValue = defaultObjectValue; - this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, defaultObjectValue); - } - - private String buildDefaultObjectValue() { - return (String) this.getJdtMemberValue(EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE); - } - - public TextRange getDefaultObjectValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** conversion values - public ListIterator<EclipseLinkConversionValueAnnotation> conversionValues() { - return new CloneListIterator<EclipseLinkConversionValueAnnotation>(this.conversionValues); - } - - public int conversionValuesSize() { - return this.conversionValues.size(); - } - - public EclipseLinkConversionValueAnnotation conversionValueAt(int index) { - return this.conversionValues.get(index); - } - - public int indexOfConversionValue(EclipseLinkConversionValueAnnotation conversionValue) { - return this.conversionValues.indexOf(conversionValue); - } - - public EclipseLinkConversionValueAnnotation addConversionValue(int index) { - throw new UnsupportedOperationException(); - } - - public void moveConversionValue(int targetIndex, int sourceIndex) { - throw new UnsupportedOperationException(); - } - - public void removeConversionValue(int index) { - throw new UnsupportedOperationException(); - } - - private Vector<EclipseLinkConversionValueAnnotation> buildConversionValues() { - Object[] jdtConversionValues = this.getJdtMemberValues(EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES); - Vector<EclipseLinkConversionValueAnnotation> result = new Vector<EclipseLinkConversionValueAnnotation>(jdtConversionValues.length); - for (Object jdtConversionValue : jdtConversionValues) { - result.add(new BinaryEclipseLinkConversionValueAnnotation(this, (IAnnotation) jdtConversionValue)); - } - return result; - } - - // TODO - private void updateConversionValues() { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java deleted file mode 100644 index 5902f32d17..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation; - -/** - * org.eclipse.persistence.annotations.PrivateOwned - */ -public final class BinaryEclipseLinkPrivateOwnedAnnotation - extends BinaryAnnotation - implements EclipseLinkPrivateOwnedAnnotation -{ - - public BinaryEclipseLinkPrivateOwnedAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java deleted file mode 100644 index 4764dafa82..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadOnly - */ -public final class BinaryEclipseLinkReadOnlyAnnotation - extends BinaryAnnotation - implements EclipseLinkReadOnlyAnnotation -{ - - public BinaryEclipseLinkReadOnlyAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java deleted file mode 100644 index f8b37ade18..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadTransformer - */ -public final class BinaryEclipseLinkReadTransformerAnnotation - extends BinaryEclipseLinkTransformerAnnotation - implements EclipseLinkReadTransformerAnnotation -{ - - public BinaryEclipseLinkReadTransformerAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - - // ********** BinaryTransformerAnnotation implementation ********** - - @Override - String getTransformerClassElementName() { - return EclipseLink.READ_TRANSFORMER__TRANSFORMER_CLASS; - } - - @Override - String getMethodElementName() { - return EclipseLink.READ_TRANSFORMER__METHOD; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java deleted file mode 100644 index a2d9654131..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.StructConverter - */ -public final class BinaryEclipseLinkStructConverterAnnotation - extends BinaryEclipseLinkNamedConverterAnnotation - implements EclipseLinkStructConverterAnnotation -{ - private String converter; - - - public BinaryEclipseLinkStructConverterAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.converter = this.buildConverter(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setConverter_(this.buildConverter()); - } - - - // ********** BinaryNamedConverterAnnotation implementation ********** - - @Override - String getNameElementName() { - return EclipseLink.STRUCT_CONVERTER__NAME; - } - - - // ********** StructConverterAnnotation implementation ********** - - // ***** converter - public String getConverter() { - return this.converter; - } - - public void setConverter(String converter) { - throw new UnsupportedOperationException(); - } - - private void setConverter_(String converter) { - String old = this.converter; - this.converter = converter; - this.firePropertyChanged(CONVERTER_PROPERTY, old, converter); - } - - private String buildConverter() { - return (String) this.getJdtMemberValue(EclipseLink.STRUCT_CONVERTER__CONVERTER); - } - - public TextRange getConverterTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java deleted file mode 100644 index bde9507d1d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java +++ /dev/null @@ -1,149 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation; - -/** - * org.eclipse.persistence.annotations.TimeOfDay - */ -public final class BinaryEclipseLinkTimeOfDayAnnotation - extends BinaryAnnotation - implements EclipseLinkTimeOfDayAnnotation -{ - private Integer hour; - private Integer minute; - private Integer second; - private Integer millisecond; - - - public BinaryEclipseLinkTimeOfDayAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.hour = this.buildHour(); - this.minute = this.buildMinute(); - this.second = this.buildSecond(); - this.millisecond = this.buildMillisecond(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setHour_(this.buildHour()); - this.setMinute_(this.buildMinute()); - this.setSecond_(this.buildSecond()); - this.setMillisecond_(this.buildMillisecond()); - } - - - // ********** TimeOfDayAnnotation implementation ********** - - // ***** hour - public Integer getHour() { - return this.hour; - } - - public void setHour(Integer hour) { - throw new UnsupportedOperationException(); - } - - private void setHour_(Integer hour) { - Integer old = this.hour; - this.hour = hour; - this.firePropertyChanged(HOUR_PROPERTY, old, hour); - } - - private Integer buildHour() { - return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__HOUR); - } - - public TextRange getHourTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** minute - public Integer getMinute() { - return this.minute; - } - - public void setMinute(Integer newMinute) { - throw new UnsupportedOperationException(); - } - - private void setMinute_(Integer newMinute) { - Integer oldMinute = this.minute; - this.minute = newMinute; - this.firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute); - } - - private Integer buildMinute() { - return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__MINUTE); - } - - public TextRange getMinuteTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** second - public Integer getSecond() { - return this.second; - } - - public void setSecond(Integer newSecond) { - throw new UnsupportedOperationException(); - } - - private void setSecond_(Integer newSecond) { - Integer oldSecond = this.second; - this.second = newSecond; - this.firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond); - } - - private Integer buildSecond() { - return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__SECOND); - } - - public TextRange getSecondTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** millisecond - public Integer getMillisecond() { - return this.millisecond; - } - - public void setMillisecond(Integer newMillisecond) { - throw new UnsupportedOperationException(); - } - - private void setMillisecond_(Integer newMillisecond) { - Integer oldMillisecond = this.millisecond; - this.millisecond = newMillisecond; - this.firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond); - } - - private Integer buildMillisecond() { - return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__MILLISECOND); - } - - public TextRange getMillisecondTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java deleted file mode 100644 index ae2c60afb3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.FetchType; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation; - -/** - * org.eclipse.persistence.annotations.Transformation - */ -public class BinaryEclipseLinkTransformationAnnotation - extends BinaryAnnotation - implements EclipseLinkTransformationAnnotation -{ - private FetchType fetch; - private Boolean optional; - - - public BinaryEclipseLinkTransformationAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.fetch = this.buildFetch(); - this.optional = this.buildOptional(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.setFetch_(this.buildFetch()); - this.setOptional_(this.buildOptional()); - } - - - // ********** TransformationAnnotation implementation ********** - - // ***** fetch - public FetchType getFetch() { - return this.fetch; - } - - public void setFetch(FetchType fetch) { - throw new UnsupportedOperationException(); - } - - private void setFetch_(FetchType fetch) { - FetchType old = this.fetch; - this.fetch = fetch; - this.firePropertyChanged(FETCH_PROPERTY, old, fetch); - } - - private FetchType buildFetch() { - return FetchType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.TRANSFORMATION__FETCH)); - } - - public TextRange getFetchTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** optional - public Boolean getOptional() { - return this.optional; - } - - public void setOptional(Boolean optional) { - throw new UnsupportedOperationException(); - } - - private void setOptional_(Boolean optional) { - Boolean old = this.optional; - this.optional = optional; - this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional); - } - - private Boolean buildOptional() { - return (Boolean) this.getJdtMemberValue(EclipseLink.TRANSFORMATION__OPTIONAL); - } - - public TextRange getOptionalTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java deleted file mode 100644 index bf6f16fb69..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformerAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadTransformer - * org.eclipse.persistence.annotations.WriteTransformer - */ -abstract class BinaryEclipseLinkTransformerAnnotation - extends BinaryAnnotation - implements EclipseLinkTransformerAnnotation -{ - private String transformerClass; - private String method; - - - BinaryEclipseLinkTransformerAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.transformerClass = this.buildTransformerClass(); - this.method = this.buildMethod(); - } - - @Override - public void update() { - super.update(); - this.setTransformerClass_(this.buildTransformerClass()); - this.setMethod_(this.buildMethod()); - } - - - // ********** TransformerAnnotation implementation ********** - - // ***** transformer class - public String getTransformerClass() { - return this.transformerClass; - } - - public void setTransformerClass(String transformerClass) { - throw new UnsupportedOperationException(); - } - - private void setTransformerClass_(String transformerClass) { - String old = this.transformerClass; - this.transformerClass = transformerClass; - this.firePropertyChanged(TRANSFORMER_CLASS_PROPERTY, old, transformerClass); - } - - private String buildTransformerClass() { - return (String) this.getJdtMemberValue(this.getTransformerClassElementName()); - } - - public TextRange getTransformerClassTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - abstract String getTransformerClassElementName(); - - // ***** method - public String getMethod() { - return this.method; - } - - public void setMethod(String method) { - throw new UnsupportedOperationException(); - } - - private void setMethod_(String method) { - String old = this.method; - this.method = method; - this.firePropertyChanged(METHOD_PROPERTY, old, method); - } - - private String buildMethod() { - return (String) this.getJdtMemberValue(this.getMethodElementName()); - } - - public TextRange getMethodTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - abstract String getMethodElementName(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java deleted file mode 100644 index d266c8c157..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.TypeConverter - */ -public final class BinaryEclipseLinkTypeConverterAnnotation - extends BinaryBaseEclipseLinkTypeConverterAnnotation - implements EclipseLinkTypeConverterAnnotation -{ - public BinaryEclipseLinkTypeConverterAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - - // ********** BinaryNamedConverterAnnotation implementation ********** - - @Override - String getNameElementName() { - return EclipseLink.TYPE_CONVERTER__NAME; - } - - - // ********** BinaryBaseTypeConverterAnnotation implementation ********** - - @Override - String getDataTypeElementName() { - return EclipseLink.TYPE_CONVERTER__DATA_TYPE; - } - - @Override - String getObjectTypeElementName() { - return EclipseLink.TYPE_CONVERTER__OBJECT_TYPE; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java deleted file mode 100644 index f8a2ffdb93..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation; - -/** - * org.eclipse.persistence.annotations.VariableOneToOne - */ -public class BinaryEclipseLinkVariableOneToOneAnnotation - extends BinaryAnnotation - implements EclipseLinkVariableOneToOneAnnotation -{ - public BinaryEclipseLinkVariableOneToOneAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java deleted file mode 100644 index 5cf7dfc322..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.binary; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.binary.BinaryColumnAnnotation; -import org.eclipse.jpt.core.resource.java.ColumnAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.NullEclipseLinkWriteTransformerColumnAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadTransformer - */ -public class BinaryEclipseLinkWriteTransformerAnnotation - extends BinaryEclipseLinkTransformerAnnotation - implements EclipseLinkWriteTransformerAnnotation -{ - private ColumnAnnotation column; - - - public BinaryEclipseLinkWriteTransformerAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.column = this.buildColumn(); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void update() { - super.update(); - this.updateColumn(); - } - - - // ********** BinaryTransformerAnnotation implementation ********** - - @Override - String getTransformerClassElementName() { - return EclipseLink.WRITE_TRANSFORMER__TRANSFORMER_CLASS; - } - - @Override - String getMethodElementName() { - return EclipseLink.WRITE_TRANSFORMER__METHOD; - } - - - // ********** WriteTransformerAnnotation implementation ********** - - // ***** column - public ColumnAnnotation getColumn() { - return this.column; - } - - public ColumnAnnotation getNonNullColumn() { - return (this.column != null) ? this.column : new NullEclipseLinkWriteTransformerColumnAnnotation(this); - } - - public ColumnAnnotation addColumn() { - throw new UnsupportedOperationException(); - } - - public void removeColumn() { - throw new UnsupportedOperationException(); - } - - public TextRange getColumnTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - private ColumnAnnotation buildColumn() { - IAnnotation jdtColumn = this.getJdtColumn(); - return (jdtColumn == null) ? null : this.buildColumn(jdtColumn); - } - - private ColumnAnnotation buildColumn(IAnnotation jdtColumn) { - return new BinaryColumnAnnotation(this, jdtColumn); - } - - private IAnnotation getJdtColumn() { - return (IAnnotation) this.getJdtMemberValue(EclipseLink.WRITE_TRANSFORMER__COLUMN); - } - - private void setColumn(ColumnAnnotation column) { - ColumnAnnotation old = this.column; - this.column = column; - this.firePropertyChanged(COLUMN_PROPERTY, old, column); - } - - // TODO - private void updateColumn() { - throw new UnsupportedOperationException(); -// IAnnotation jdtColumn = this.getJdtColumn(); -// if (jdtColumn == null) { -// this.setColumn(null); -// } else { -// if (this.column == null) { -// this.setColumn(this.buildColumn(jdtColumn)); -// } else { -// this.column.update(jdtColumn); -// } -// } - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java deleted file mode 100644 index 03151ed322..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.TypeStringExpressionConverter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.resource.java.BaseEclipseLinkTypeConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.TypeConverter - * org.eclipse.persistence.annotations.ObjectTypeConverter - */ -abstract class SourceBaseEclipseLinkTypeConverterAnnotation - extends SourceEclipseLinkNamedConverterAnnotation - implements BaseEclipseLinkTypeConverterAnnotation -{ - final DeclarationAnnotationElementAdapter<String> dataTypeDeclarationAdapter; - final AnnotationElementAdapter<String> dataTypeAdapter; - String dataType; - - final DeclarationAnnotationElementAdapter<String> objectTypeDeclarationAdapter; - final AnnotationElementAdapter<String> objectTypeAdapter; - String objectType; - - - SourceBaseEclipseLinkTypeConverterAnnotation(JavaResourcePersistentMember parent, Member member, DeclarationAnnotationAdapter daa) { - super(parent, member, daa); - this.dataTypeDeclarationAdapter = this.buildTypeAdapter(this.getDataTypeElementName()); - this.dataTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.member, this.dataTypeDeclarationAdapter); - - this.objectTypeDeclarationAdapter = this.buildTypeAdapter(this.getObjectTypeElementName()); - this.objectTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.member, this.objectTypeDeclarationAdapter); - } - - private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(String elementName) { - // false = do not remove annotation when empty - return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, elementName, false, TypeStringExpressionConverter.instance()); - } - - @Override - public void initialize(CompilationUnit astRoot) { - super.initialize(astRoot); - this.dataType = this.buildDataType(astRoot); - this.objectType = this.buildObjectType(astRoot); - } - - @Override - public void update(CompilationUnit astRoot) { - super.update(astRoot); - this.setDataType(this.buildDataType(astRoot)); - this.setObjectType(this.buildObjectType(astRoot)); - } - - - // ********** BaseTypeConverterAnnotation implementation ********** - - // ***** data type - public String getDataType() { - return this.dataType; - } - - public void setDataType(String dataType) { - if (this.attributeValueHasNotChanged(this.dataType, dataType)) { - return; - } - String old = this.dataType; - this.dataType = dataType; - this.dataTypeAdapter.setValue(dataType); - this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType); - } - - private String buildDataType(CompilationUnit astRoot) { - return this.dataTypeAdapter.getValue(astRoot); - } - - public TextRange getDataTypeTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.dataTypeDeclarationAdapter, astRoot); - } - - abstract String getDataTypeElementName(); - - // ***** object type - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - if (this.attributeValueHasNotChanged(this.objectType, objectType)) { - return; - } - String old = this.objectType; - this.objectType = objectType; - this.objectTypeAdapter.setValue(objectType); - this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType); - } - - public TextRange getObjectTypeTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.objectTypeDeclarationAdapter, astRoot); - } - - private String buildObjectType(CompilationUnit astRoot) { - return this.objectTypeAdapter.getValue(astRoot); - } - - abstract String getObjectTypeElementName(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java deleted file mode 100644 index 9e3642c5a8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation; - -/** - * org.eclipse.persistence.annotations.BasicCollection - */ -public final class SourceEclipseLinkBasicCollectionAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkBasicCollectionAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - - public SourceEclipseLinkBasicCollectionAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - // do nothing - } - - public void update(CompilationUnit astRoot) { - // do nothing - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java deleted file mode 100644 index 10dcfd80d9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation; - -/** - * org.eclipse.persistence.annotations.BasicMap - */ -public final class SourceEclipseLinkBasicMapAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkBasicMapAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - - public SourceEclipseLinkBasicMapAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - // do nothing - } - - public void update(CompilationUnit astRoot) { - // do nothing - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java deleted file mode 100644 index a2c9163dba..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java +++ /dev/null @@ -1,411 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType; -import org.eclipse.jpt.eclipselink.core.resource.java.CacheType; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation; - -/** - * org.eclipse.persistence.annotations.Cache - */ -public final class SourceEclipseLinkCacheAnnotation - extends SourceAnnotation<Type> - implements EclipseLinkCacheAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> TYPE_ADAPTER = buildTypeAdapter(); - private final AnnotationElementAdapter<String> typeAdapter; - private CacheType type; - - private static final DeclarationAnnotationElementAdapter<Integer> SIZE_ADAPTER = buildSizeAdapter(); - private final AnnotationElementAdapter<Integer> sizeAdapter; - private Integer size; - - private static final DeclarationAnnotationElementAdapter<Boolean> SHARED_ADAPTER = buildSharedAdapter(); - private final AnnotationElementAdapter<Boolean> sharedAdapter; - private Boolean shared; - - private static final DeclarationAnnotationElementAdapter<Integer> EXPIRY_ADAPTER = buildExpiryAdapter(); - private final AnnotationElementAdapter<Integer> expiryAdapter; - private Integer expiry; - - private static final DeclarationAnnotationElementAdapter<Boolean> ALWAYS_REFRESH_ADAPTER = buildAlwaysRefreshAdapter(); - private final AnnotationElementAdapter<Boolean> alwaysRefreshAdapter; - private EclipseLinkTimeOfDayAnnotation expiryTimeOfDay; - - private static final DeclarationAnnotationElementAdapter<Boolean> REFRESH_ONLY_IF_NEWER_ADAPTER = buildRefreshOnlyIfNewerAdapter(); - private final AnnotationElementAdapter<Boolean> refreshOnlyIfNewerAdapter; - private Boolean alwaysRefresh; - - private static final DeclarationAnnotationElementAdapter<Boolean> DISABLE_HITS_ADAPTER = buildDisableHitsAdapter(); - private final AnnotationElementAdapter<Boolean> disableHitsAdapter; - private Boolean refreshOnlyIfNewer; - - private static final DeclarationAnnotationElementAdapter<String> COORDINATION_TYPE_ADAPTER = buildCoordinationTypeAdapter(); - private final AnnotationElementAdapter<String> coordinationTypeAdapter; - private Boolean disableHits; - - private static final NestedDeclarationAnnotationAdapter EXPIRY_TIME_OF_DAY_ADAPTER = buildExpiryTimeOfDayAdapter(); - private final MemberAnnotationAdapter expiryTimeOfDayAdapter; - private CacheCoordinationType coordinationType; - - - public SourceEclipseLinkCacheAnnotation(JavaResourcePersistentType parent, Type type) { - super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.typeAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, TYPE_ADAPTER); - this.sizeAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, SIZE_ADAPTER); - this.sharedAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(type, SHARED_ADAPTER); - this.expiryAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, EXPIRY_ADAPTER); - this.alwaysRefreshAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(type, ALWAYS_REFRESH_ADAPTER); - this.refreshOnlyIfNewerAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(type, REFRESH_ONLY_IF_NEWER_ADAPTER); - this.disableHitsAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(type, DISABLE_HITS_ADAPTER); - this.coordinationTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, COORDINATION_TYPE_ADAPTER); - this.expiryTimeOfDayAdapter = new MemberAnnotationAdapter(type, EXPIRY_TIME_OF_DAY_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.type = this.buildType(astRoot); - this.size = this.buildSize(astRoot); - this.shared = this.buildShared(astRoot); - this.expiry = this.buildExpiry(astRoot); - this.initializeExpiryTimeOfDay(astRoot); - this.alwaysRefresh = this.buildAlwaysRefresh(astRoot); - this.refreshOnlyIfNewer = this.buildRefreshOnlyIfNewer(astRoot); - this.disableHits = this.buildDisableHits(astRoot); - this.coordinationType = this.buildCoordinationType(astRoot); - } - - private void initializeExpiryTimeOfDay(CompilationUnit astRoot) { - if (this.expiryTimeOfDayAdapter.getAnnotation(astRoot) != null) { - this.expiryTimeOfDay = this.buildExpiryTimeOfDay(); - this.expiryTimeOfDay.initialize(astRoot); - } - } - - public void update(CompilationUnit astRoot) { - this.setType(this.buildType(astRoot)); - this.setSize(this.buildSize(astRoot)); - this.setShared(this.buildShared(astRoot)); - this.setExpiry(this.buildExpiry(astRoot)); - this.updateExpiryTimeOfDay(astRoot); - this.setAlwaysRefresh(this.buildAlwaysRefresh(astRoot)); - this.setRefreshOnlyIfNewer(this.buildRefreshOnlyIfNewer(astRoot)); - this.setDisableHits(this.buildDisableHits(astRoot)); - this.setCoordinationType(this.buildCoordinationType(astRoot)); - } - - private void updateExpiryTimeOfDay(CompilationUnit astRoot) { - if (this.expiryTimeOfDayAdapter.getAnnotation(astRoot) == null) { - this.setExpiryTimeOfDay(null); - } else { - if (this.getExpiryTimeOfDay() == null) { - EclipseLinkTimeOfDayAnnotation etod = this.buildExpiryTimeOfDay(); - etod.initialize(astRoot); - this.setExpiryTimeOfDay(etod); - } else { - this.getExpiryTimeOfDay().update(astRoot); - } - } - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.type); - } - - - // ********** CacheAnnotation implementation ********** - - // ***** type - public CacheType getType() { - return this.type; - } - - public void setType(CacheType type) { - if (this.attributeValueHasNotChanged(this.type, type)) { - return; - } - CacheType old = this.type; - this.type = type; - this.typeAdapter.setValue(CacheType.toJavaAnnotationValue(type)); - this.firePropertyChanged(TYPE_PROPERTY, old, type); - } - - private CacheType buildType(CompilationUnit astRoot) { - return CacheType.fromJavaAnnotationValue(this.typeAdapter.getValue(astRoot)); - } - - public TextRange getTypeTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(TYPE_ADAPTER, astRoot); - } - - // ***** size - public Integer getSize() { - return this.size; - } - - public void setSize(Integer size) { - if (this.attributeValueHasNotChanged(this.size, size)) { - return; - } - Integer old = this.size; - this.size = size; - this.sizeAdapter.setValue(size); - this.firePropertyChanged(SIZE_PROPERTY, old, size); - } - - private Integer buildSize(CompilationUnit astRoot) { - return this.sizeAdapter.getValue(astRoot); - } - - public TextRange getSizeTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(SIZE_ADAPTER, astRoot); - } - - // ***** shared - public Boolean getShared() { - return this.shared; - } - - public void setShared(Boolean shared) { - if (this.attributeValueHasNotChanged(this.shared, shared)) { - return; - } - Boolean old = this.shared; - this.shared = shared; - this.sharedAdapter.setValue(shared); - this.firePropertyChanged(SHARED_PROPERTY, old, shared); - } - - private Boolean buildShared(CompilationUnit astRoot) { - return this.sharedAdapter.getValue(astRoot); - } - - public TextRange getSharedTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(SHARED_ADAPTER, astRoot); - } - - // ***** expiry - public Integer getExpiry() { - return this.expiry; - } - - public void setExpiry(Integer expiry) { - if (this.attributeValueHasNotChanged(this.expiry, expiry)) { - return; - } - Integer old = this.expiry; - this.expiry = expiry; - this.expiryAdapter.setValue(expiry); - this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry); - } - - private Integer buildExpiry(CompilationUnit astRoot) { - return this.expiryAdapter.getValue(astRoot); - } - - public TextRange getExpiryTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(EXPIRY_ADAPTER, astRoot); - } - - // ***** expiry time of day - public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() { - return this.expiryTimeOfDay; - } - - public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() { - if (this.expiryTimeOfDay != null) { - throw new IllegalStateException("'expiryTimeOfDay' element already exists"); //$NON-NLS-1$ - } - this.expiryTimeOfDay = this.buildExpiryTimeOfDay(); - this.expiryTimeOfDayAdapter.newMarkerAnnotation(); - this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, null, this.expiryTimeOfDay); - return this.expiryTimeOfDay; - } - - public void removeExpiryTimeOfDay() { - if (this.expiryTimeOfDay == null) { - throw new IllegalStateException("No expiryTimeOfDay element exists"); //$NON-NLS-1$ - } - this.expiryTimeOfDay = null; - this.expiryTimeOfDayAdapter.removeAnnotation(); - this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, this.expiryTimeOfDay, null); - } - - private void setExpiryTimeOfDay(EclipseLinkTimeOfDayAnnotation expiryTimeOfDay) { - EclipseLinkTimeOfDayAnnotation old = this.expiryTimeOfDay; - this.expiryTimeOfDay = expiryTimeOfDay; - this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, expiryTimeOfDay); - } - - private EclipseLinkTimeOfDayAnnotation buildExpiryTimeOfDay() { - return new SourceEclipseLinkTimeOfDayAnnotation(this, this.member, EXPIRY_TIME_OF_DAY_ADAPTER); - } - - public TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot) { - return null;//TODO return this.getElementTextRange(EXPIRY_TIME_OF_DAY_ADAPTER, astRoot); - } - - // ***** always refresh - public Boolean getAlwaysRefresh() { - return this.alwaysRefresh; - } - - public void setAlwaysRefresh(Boolean alwaysRefresh) { - if (this.attributeValueHasNotChanged(this.alwaysRefresh, alwaysRefresh)) { - return; - } - Boolean old = this.alwaysRefresh; - this.alwaysRefresh = alwaysRefresh; - this.alwaysRefreshAdapter.setValue(alwaysRefresh); - this.firePropertyChanged(ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh); - } - - private Boolean buildAlwaysRefresh(CompilationUnit astRoot) { - return this.alwaysRefreshAdapter.getValue(astRoot); - } - - public TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(ALWAYS_REFRESH_ADAPTER, astRoot); - } - - // ***** refresh only if newer - public Boolean getRefreshOnlyIfNewer() { - return this.refreshOnlyIfNewer; - } - - public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) { - if (this.attributeValueHasNotChanged(this.refreshOnlyIfNewer, refreshOnlyIfNewer)) { - return; - } - Boolean old = this.refreshOnlyIfNewer; - this.refreshOnlyIfNewer = refreshOnlyIfNewer; - this.refreshOnlyIfNewerAdapter.setValue(refreshOnlyIfNewer); - this.firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer); - } - - private Boolean buildRefreshOnlyIfNewer(CompilationUnit astRoot) { - return this.refreshOnlyIfNewerAdapter.getValue(astRoot); - } - - public TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(REFRESH_ONLY_IF_NEWER_ADAPTER, astRoot); - } - - // ***** disable hits - public Boolean getDisableHits() { - return this.disableHits; - } - - public void setDisableHits(Boolean disableHits) { - if (this.attributeValueHasNotChanged(this.disableHits, disableHits)) { - return; - } - Boolean old = this.disableHits; - this.disableHits = disableHits; - this.disableHitsAdapter.setValue(disableHits); - this.firePropertyChanged(DISABLE_HITS_PROPERTY, old, disableHits); - } - - private Boolean buildDisableHits(CompilationUnit astRoot) { - return this.disableHitsAdapter.getValue(astRoot); - } - - public TextRange getDisablesHitsTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(DISABLE_HITS_ADAPTER, astRoot); - } - - // ***** coordination type - public CacheCoordinationType getCoordinationType() { - return this.coordinationType; - } - - public void setCoordinationType(CacheCoordinationType coordinationType) { - if (this.attributeValueHasNotChanged(this.coordinationType, coordinationType)) { - return; - } - CacheCoordinationType old = this.coordinationType; - this.coordinationType = coordinationType; - this.coordinationTypeAdapter.setValue(CacheCoordinationType.toJavaAnnotationValue(coordinationType)); - this.firePropertyChanged(TYPE_PROPERTY, old, coordinationType); - } - - private CacheCoordinationType buildCoordinationType(CompilationUnit astRoot) { - return CacheCoordinationType.fromJavaAnnotationValue(this.coordinationTypeAdapter.getValue(astRoot)); - } - - public TextRange getCoordinationTypeTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(COORDINATION_TYPE_ADAPTER, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildTypeAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__TYPE); - } - - private static DeclarationAnnotationElementAdapter<Integer> buildSizeAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<Integer>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__SIZE, NumberIntegerExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<Boolean> buildSharedAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__SHARED, BooleanExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<Integer> buildExpiryAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<Integer>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__EXPIRY, NumberIntegerExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<Boolean> buildAlwaysRefreshAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__ALWAYS_REFRESH, BooleanExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<Boolean> buildRefreshOnlyIfNewerAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__REFRESH_ONLY_IF_NEWER, BooleanExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<Boolean> buildDisableHitsAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__DISABLE_HITS, BooleanExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<String> buildCoordinationTypeAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__COORDINATION_TYPE); - } - - private static NestedDeclarationAnnotationAdapter buildExpiryTimeOfDayAdapter() { - return new NestedDeclarationAnnotationAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__EXPIRY_TIME_OF_DAY, EclipseLink.TIME_OF_DAY); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java deleted file mode 100644 index 270bc9a78b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.ChangeTracking - */ -public final class SourceEclipseLinkChangeTrackingAnnotation - extends SourceAnnotation<Type> - implements EclipseLinkChangeTrackingAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter(); - private final AnnotationElementAdapter<String> valueAdapter; - private ChangeTrackingType value; - - - public SourceEclipseLinkChangeTrackingAnnotation(JavaResourcePersistentType parent, Type type) { - super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.value = this.buildValue(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setValue(this.buildValue(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.value); - } - - - // ********** ChangeTrackingAnnotation implementation ********** - - // ***** value - public ChangeTrackingType getValue() { - return this.value; - } - - public void setValue(ChangeTrackingType value) { - if (this.attributeValueHasNotChanged(this.value, value)) { - return; - } - ChangeTrackingType old = this.value; - this.value = value; - this.valueAdapter.setValue(ChangeTrackingType.toJavaAnnotationValue(value)); - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private ChangeTrackingType buildValue(CompilationUnit astRoot) { - return ChangeTrackingType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot)); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(VALUE_ADAPTER, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CHANGE_TRACKING__VALUE, false); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java deleted file mode 100644 index 7833912a1c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java +++ /dev/null @@ -1,165 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.resource.java.NestableAnnotation; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.NestableEclipseLinkConversionValueAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.ConversionValue - */ -final class SourceEclipseLinkConversionValueAnnotation - extends SourceAnnotation<Member> - implements NestableEclipseLinkConversionValueAnnotation -{ - private final DeclarationAnnotationElementAdapter<String> dataValueDeclarationAdapter; - private final AnnotationElementAdapter<String> dataValueAdapter; - private String dataValue; - - private final DeclarationAnnotationElementAdapter<String> objectValueDeclarationAdapter; - private final AnnotationElementAdapter<String> objectValueAdapter; - private String objectValue; - - - SourceEclipseLinkConversionValueAnnotation(EclipseLinkObjectTypeConverterAnnotation parent, Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa)); - this.dataValueDeclarationAdapter = this.buildDataValueAdapter(idaa); - this.dataValueAdapter = this.buildAdapter(this.dataValueDeclarationAdapter); - this.objectValueDeclarationAdapter = this.buildObjectValueAdapter(idaa); - this.objectValueAdapter = this.buildAdapter(this.objectValueDeclarationAdapter); - } - - private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) { - return new ShortCircuitAnnotationElementAdapter<String>(this.member, daea); - } - - private DeclarationAnnotationElementAdapter<String> buildDataValueAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, EclipseLink.CONVERSION_VALUE__DATA_VALUE, false); - } - - private DeclarationAnnotationElementAdapter<String> buildObjectValueAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) { - return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, EclipseLink.CONVERSION_VALUE__OBJECT_VALUE, false); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.dataValue = this.buildDataValue(astRoot); - this.objectValue = this.buildObjectValue(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setDataValue(this.buildDataValue(astRoot)); - this.setObjectValue(this.buildObjectValue(astRoot)); - } - - public IndexedAnnotationAdapter getIndexedAnnotationAdapter() { - return (IndexedAnnotationAdapter) this.annotationAdapter; - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.dataValue); - sb.append("=>"); //$NON-NLS-1$ - sb.append(this.objectValue); - } - - - // ********** ConversionValueAnnotation implementation ********** - - // ***** data value - public String getDataValue() { - return this.dataValue; - } - - public void setDataValue(String dataValue) { - if (this.attributeValueHasNotChanged(this.dataValue, dataValue)) { - return; - } - String old = this.dataValue; - this.dataValue = dataValue; - this.dataValueAdapter.setValue(dataValue); - this.firePropertyChanged(DATA_VALUE_PROPERTY, old, dataValue); - } - - private String buildDataValue(CompilationUnit astRoot) { - return this.dataValueAdapter.getValue(astRoot); - } - - public TextRange getDataValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.dataValueDeclarationAdapter, astRoot); - } - - // ***** object value - public String getObjectValue() { - return this.objectValue; - } - - public void setObjectValue(String objectValue) { - if (this.attributeValueHasNotChanged(this.objectValue, objectValue)) { - return; - } - String old = this.objectValue; - this.objectValue = objectValue; - this.objectValueAdapter.setValue(objectValue); - this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, objectValue); - } - - private String buildObjectValue(CompilationUnit astRoot) { - return this.objectValueAdapter.getValue(astRoot); - } - - public TextRange getObjectValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.objectValueDeclarationAdapter, astRoot); - } - - - //************ NestableAnnotation implementation - - public void initializeFrom(NestableAnnotation oldAnnotation) { - EclipseLinkConversionValueAnnotation oldConversionValue = (EclipseLinkConversionValueAnnotation) oldAnnotation; - this.setDataValue(oldConversionValue.getDataValue()); - this.setObjectValue(oldConversionValue.getObjectValue()); - } - - public void moveAnnotation(int newIndex) { - this.getIndexedAnnotationAdapter().moveAnnotation(newIndex); - } - - - // ********** static methods ********** - - static NestableEclipseLinkConversionValueAnnotation createConversionValue(EclipseLinkObjectTypeConverterAnnotation parent, Member member, DeclarationAnnotationAdapter daa, int index) { - return new SourceEclipseLinkConversionValueAnnotation(parent, member, buildConversionValueAnnotationAdapter(daa, index)); - } - - private static IndexedDeclarationAnnotationAdapter buildConversionValueAnnotationAdapter(DeclarationAnnotationAdapter daa, int index) { - return new NestedIndexedDeclarationAnnotationAdapter(daa, EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES, index, EclipseLink.CONVERSION_VALUE, false); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java deleted file mode 100644 index 05665f1c3f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.Convert - */ -public final class SourceEclipseLinkConvertAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkConvertAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter(); - private final AnnotationElementAdapter<String> valueAdapter; - private String value; - - - public SourceEclipseLinkConvertAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.value = this.buildValue(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setValue(this.buildValue(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.value); - } - - - // ********** ConvertAnnotation implementation ********** - - // ***** value - public String getValue() { - return this.value; - } - - public void setValue(String value) { - if (this.attributeValueHasNotChanged(this.value, value)) { - return; - } - String old = this.value; - this.value = value; - this.valueAdapter.setValue(value); - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private String buildValue(CompilationUnit astRoot) { - return this.valueAdapter.getValue(astRoot); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(VALUE_ADAPTER, astRoot); - } - - public boolean valueTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(VALUE_ADAPTER, pos, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CONVERT__VALUE, false, StringExpressionConverter.instance()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java deleted file mode 100644 index ba69e17342..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.JDTTools; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.Converter - */ -public final class SourceEclipseLinkConverterAnnotation - extends SourceEclipseLinkNamedConverterAnnotation - implements EclipseLinkConverterAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> CONVERTER_CLASS_ADAPTER = buildConverterClassAdapter(); - private final AnnotationElementAdapter<String> converterClassAdapter; - private String converterClass; - - - public SourceEclipseLinkConverterAnnotation(JavaResourcePersistentMember parent, Member member) { - super(parent, member, DECLARATION_ANNOTATION_ADAPTER); - this.converterClassAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, CONVERTER_CLASS_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void initialize(CompilationUnit astRoot) { - super.initialize(astRoot); - this.converterClass = this.buildConverterClass(astRoot); - } - - @Override - public void update(CompilationUnit astRoot) { - super.update(astRoot); - this.setConverterClass(this.buildConverterClass(astRoot)); - } - - - // ********** SourceNamedConverterAnnotation implementation ********** - - @Override - String getNameElementName() { - return EclipseLink.CONVERTER__NAME; - } - - - // ********** ConverterAnnotation implementation ********** - - // ***** converter class - public String getConverterClass() { - return this.converterClass; - } - - public void setConverterClass(String converterClass) { - if (this.attributeValueHasNotChanged(this.converterClass, converterClass)) { - return; - } - String old = this.converterClass; - this.converterClass = converterClass; - this.converterClassAdapter.setValue(converterClass); - this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, converterClass); - } - - private String buildConverterClass(CompilationUnit astRoot) { - return this.converterClassAdapter.getValue(astRoot); - } - - public TextRange getConverterClassTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(CONVERTER_CLASS_ADAPTER, astRoot); - } - - public boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot) { - return (this.converterClass != null) - && JDTTools.typeIsSubTypeOf(this.converterClassAdapter.getExpression(astRoot), interfaceName); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildConverterClassAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CONVERTER__CONVERTER_CLASS, false, SimpleTypeStringExpressionConverter.instance()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java deleted file mode 100644 index 17d32d1be8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.JDTTools; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; - -/** - * org.eclipse.persistence.annotations.Customizer - */ -public final class SourceEclipseLinkCustomizerAnnotation - extends SourceAnnotation<Type> - implements EclipseLinkCustomizerAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter(); - private final AnnotationElementAdapter<String> valueAdapter; - private String value; - - - public SourceEclipseLinkCustomizerAnnotation(JavaResourcePersistentMember parent, Type type) { - super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.value = this.buildValue(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setValue(this.buildValue(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.value); - } - - - // ********** CustomizerAnnotation implementation ********** - - // ***** value - public String getValue() { - return this.value; - } - - public void setValue(String value) { - if (this.attributeValueHasNotChanged(this.value, value)) { - return; - } - String old = this.value; - this.value = value; - this.valueAdapter.setValue(value); - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private String buildValue(CompilationUnit astRoot) { - return this.valueAdapter.getValue(astRoot); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(VALUE_ADAPTER, astRoot); - } - - public boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot) { - return (this.value != null) - && JDTTools.typeIsSubTypeOf(this.valueAdapter.getExpression(astRoot), interfaceName); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CUSTOMIZER__VALUE, false, SimpleTypeStringExpressionConverter.instance()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java deleted file mode 100644 index 1b56da9366..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType; - -/** - * org.eclipse.persistence.annotations.ExistenceChecking - */ -public final class SourceEclipseLinkExistenceCheckingAnnotation - extends SourceAnnotation<Type> - implements EclipseLinkExistenceCheckingAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter(); - private final AnnotationElementAdapter<String> valueAdapter; - private ExistenceType value; - - - public SourceEclipseLinkExistenceCheckingAnnotation(JavaResourcePersistentType parent, Type type) { - super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.value = this.buildValue(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setValue(this.buildValue(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.value); - } - - - // ********** ExistenceCheckingAnnotation implementation ********** - - // ***** value - public ExistenceType getValue() { - return this.value; - } - - public void setValue(ExistenceType value) { - if (this.attributeValueHasNotChanged(this.value, value)) { - return; - } - ExistenceType old = this.value; - this.value = value; - this.valueAdapter.setValue(ExistenceType.toJavaAnnotationValue(value)); - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private ExistenceType buildValue(CompilationUnit astRoot) { - return ExistenceType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot)); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(VALUE_ADAPTER, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.EXISTENCE_CHECKING__VALUE, false); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java deleted file mode 100644 index 54be00aed4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType; - -/** - * org.eclipse.persistence.annotations.JoinFetch - */ -public final class SourceEclipseLinkJoinFetchAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkJoinFetchAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter(); - private final AnnotationElementAdapter<String> valueAdapter; - private JoinFetchType value; - - - public SourceEclipseLinkJoinFetchAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.value = this.buildValue(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setValue(this.buildValue(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.value); - } - - - // ********** JoinFetchAnnotation implementation ********** - - // ***** value - public JoinFetchType getValue() { - return this.value; - } - - public void setValue(JoinFetchType value) { - if (this.attributeValueHasNotChanged(this.value, value)) { - return; - } - JoinFetchType old = this.value; - this.value = value; - this.valueAdapter.setValue(JoinFetchType.toJavaAnnotationValue(value)); - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private JoinFetchType buildValue(CompilationUnit astRoot) { - return JoinFetchType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot)); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(VALUE_ADAPTER, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.JOIN_FETCH__VALUE, false); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java deleted file mode 100644 index 1b258d84cd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation; - -/** - * org.eclipse.persistence.annotations.Mutable - */ -public final class SourceEclipseLinkMutableAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkMutableAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<Boolean> VALUE_ADAPTER = buildValueAdapter(); - private final AnnotationElementAdapter<Boolean> valueAdapter; - private Boolean value; - - - public SourceEclipseLinkMutableAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(attribute, VALUE_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.value = this.buildValue(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setValue(this.buildValue(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.value); - } - - - // ********** MutableAnnotation implementation ********** - - // ***** value - public Boolean getValue() { - return this.value; - } - - public void setValue(Boolean value) { - if (this.attributeValueHasNotChanged(this.value, value)) { - return; - } - Boolean old = this.value; - this.value = value; - this.valueAdapter.setValue(value); - this.firePropertyChanged(VALUE_PROPERTY, old, value); - } - - private Boolean buildValue(CompilationUnit astRoot) { - return this.valueAdapter.getValue(astRoot); - } - - public TextRange getValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(VALUE_ADAPTER, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<Boolean> buildValueAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.MUTABLE__VALUE, false, BooleanExpressionConverter.instance()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java deleted file mode 100644 index fda7787b0a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.core.resource.java.OverrideAnnotation; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.Converter - * org.eclipse.persistence.annotations.StructConverter - * org.eclipse.persistence.annotations.TypeConverter - * org.eclipse.persistence.annotations.ObjectTypeConverter - */ -abstract class SourceEclipseLinkNamedConverterAnnotation - extends SourceAnnotation<Member> - implements EclipseLinkNamedConverterAnnotation -{ - final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter; - final AnnotationElementAdapter<String> nameAdapter; - String name; - - - // ********** construction/initialization ********** - - SourceEclipseLinkNamedConverterAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) { - super(parent, member, daa); - this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getNameElementName(), false); // false = do not remove annotation when empty - this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.member, this.nameDeclarationAdapter); - } - - public void initialize(CompilationUnit astRoot) { - this.name = this.buildName(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setName(this.buildName(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.name); - } - - - // ********** NamedConverterAnnotation implementation ********** - - // ***** name - public String getName() { - return this.name; - } - - public void setName(String name) { - if (this.attributeValueHasNotChanged(this.name, name)) { - return; - } - String old = this.name; - this.name = name; - this.nameAdapter.setValue(name); - this.firePropertyChanged(OverrideAnnotation.NAME_PROPERTY, old, name); - } - - private String buildName(CompilationUnit astRoot) { - return this.nameAdapter.getValue(astRoot); - } - - public TextRange getNameTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.nameDeclarationAdapter, astRoot); - } - - public boolean nameTouches(int pos, CompilationUnit astRoot) { - return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot); - } - - abstract String getNameElementName(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java deleted file mode 100644 index ef9c5c7546..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java +++ /dev/null @@ -1,258 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import java.util.ListIterator; -import java.util.Vector; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter; -import org.eclipse.jpt.core.resource.java.AnnotationContainer; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.NestableEclipseLinkConversionValueAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.jpt.utility.internal.iterators.CloneListIterator; - -/** - * org.eclipse.persistence.annotations.ObjectTypeConverter - */ -public final class SourceEclipseLinkObjectTypeConverterAnnotation - extends SourceBaseEclipseLinkTypeConverterAnnotation - implements EclipseLinkObjectTypeConverterAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> DEFAULT_OBJECT_VALUE_ADAPTER = buildDefaultObjectValueAdapter(); - private final AnnotationElementAdapter<String> defaultObjectValueAdapter; - private String defaultObjectValue; - - private final Vector<NestableEclipseLinkConversionValueAnnotation> conversionValues = new Vector<NestableEclipseLinkConversionValueAnnotation>(); - private final ConversionValuesAnnotationContainer conversionValuesContainer = new ConversionValuesAnnotationContainer(); - - - public SourceEclipseLinkObjectTypeConverterAnnotation(JavaResourcePersistentMember parent, Member member) { - super(parent, member, DECLARATION_ANNOTATION_ADAPTER); - this.defaultObjectValueAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, DEFAULT_OBJECT_VALUE_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void initialize(CompilationUnit astRoot) { - super.initialize(astRoot); - this.defaultObjectValue = this.buildDefaultObjectValue(astRoot); - AnnotationContainerTools.initialize(this.conversionValuesContainer, astRoot); - } - - @Override - public void update(CompilationUnit astRoot) { - super.update(astRoot); - this.setDefaultObjectValue(this.buildDefaultObjectValue(astRoot)); - AnnotationContainerTools.update(this.conversionValuesContainer, astRoot); - } - - - // ********** SourceNamedConverterAnnotation implementation ********** - - @Override - String getNameElementName() { - return EclipseLink.OBJECT_TYPE_CONVERTER__NAME; - } - - - // ********** SourceBaseTypeConverterAnnotation implementation ********** - - @Override - String getDataTypeElementName() { - return EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE; - } - - @Override - String getObjectTypeElementName() { - return EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE; - } - - - // ********** ObjectTypeConverterAnnotation implementation ********** - - // ***** default object value - public String getDefaultObjectValue() { - return this.defaultObjectValue; - } - - public void setDefaultObjectValue(String defaultObjectValue) { - if (this.attributeValueHasNotChanged(this.defaultObjectValue, defaultObjectValue)) { - return; - } - String old = this.defaultObjectValue; - this.defaultObjectValue = defaultObjectValue; - this.defaultObjectValueAdapter.setValue(defaultObjectValue); - this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, defaultObjectValue); - } - - private String buildDefaultObjectValue(CompilationUnit astRoot) { - return this.defaultObjectValueAdapter.getValue(astRoot); - } - - public TextRange getDefaultObjectValueTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(DEFAULT_OBJECT_VALUE_ADAPTER, astRoot); - } - - // ***** conversion values - public ListIterator<EclipseLinkConversionValueAnnotation> conversionValues() { - return new CloneListIterator<EclipseLinkConversionValueAnnotation>(this.conversionValues); - } - - ListIterator<NestableEclipseLinkConversionValueAnnotation> nestableConversionValues() { - return new CloneListIterator<NestableEclipseLinkConversionValueAnnotation>(this.conversionValues); - } - - public int conversionValuesSize() { - return this.conversionValues.size(); - } - - public NestableEclipseLinkConversionValueAnnotation conversionValueAt(int index) { - return this.conversionValues.get(index); - } - - public int indexOfConversionValue(EclipseLinkConversionValueAnnotation conversionValue) { - return this.conversionValues.indexOf(conversionValue); - } - - public NestableEclipseLinkConversionValueAnnotation addConversionValue(int index) { - return (NestableEclipseLinkConversionValueAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.conversionValuesContainer); - } - - NestableEclipseLinkConversionValueAnnotation addConversionValueInternal() { - NestableEclipseLinkConversionValueAnnotation conversionValue = this.buildConversionValue(this.conversionValues.size()); - this.conversionValues.add(conversionValue); - return conversionValue; - } - - private NestableEclipseLinkConversionValueAnnotation buildConversionValue(int index) { - return SourceEclipseLinkConversionValueAnnotation.createConversionValue(this, this.member, this.daa, index); - } - - void conversionValueAdded(int index, NestableEclipseLinkConversionValueAnnotation conversionValue) { - this.fireItemAdded(CONVERSION_VALUES_LIST, index, conversionValue); - } - - public void moveConversionValue(int targetIndex, int sourceIndex) { - AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.conversionValuesContainer); - } - - NestableEclipseLinkConversionValueAnnotation moveConversionValueInternal(int targetIndex, int sourceIndex) { - return CollectionTools.move(this.conversionValues, targetIndex, sourceIndex).get(targetIndex); - } - - void conversionValueMoved(int targetIndex, int sourceIndex) { - this.fireItemMoved(CONVERSION_VALUES_LIST, targetIndex, sourceIndex); - } - - public void removeConversionValue(int index) { - AnnotationContainerTools.removeNestedAnnotation(index, this.conversionValuesContainer); - } - - NestableEclipseLinkConversionValueAnnotation removeConversionValueInternal(int index) { - return this.conversionValues.remove(index); - } - - void conversionValueRemoved(int index, NestableEclipseLinkConversionValueAnnotation conversionValue) { - this.fireItemRemoved(CONVERSION_VALUES_LIST, index, conversionValue); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildDefaultObjectValueAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, false, StringExpressionConverter.instance()); - } - - - // ********** conversion value container ********** - - /** - * adapt the AnnotationContainer interface to the object type converter's - * conversion values - */ - class ConversionValuesAnnotationContainer - implements AnnotationContainer<NestableEclipseLinkConversionValueAnnotation> - { - public String getContainerAnnotationName() { - return SourceEclipseLinkObjectTypeConverterAnnotation.this.getAnnotationName(); - } - - public org.eclipse.jdt.core.dom.Annotation getContainerJdtAnnotation(CompilationUnit astRoot) { - return SourceEclipseLinkObjectTypeConverterAnnotation.this.getJdtAnnotation(astRoot); - } - - public String getElementName() { - return EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES; - } - - public String getNestableAnnotationName() { - return EclipseLinkConversionValueAnnotation.ANNOTATION_NAME; - } - - public ListIterator<NestableEclipseLinkConversionValueAnnotation> nestedAnnotations() { - return SourceEclipseLinkObjectTypeConverterAnnotation.this.nestableConversionValues(); - } - - public int nestedAnnotationsSize() { - return SourceEclipseLinkObjectTypeConverterAnnotation.this.conversionValuesSize(); - } - - public NestableEclipseLinkConversionValueAnnotation addNestedAnnotationInternal() { - return SourceEclipseLinkObjectTypeConverterAnnotation.this.addConversionValueInternal(); - } - - public void nestedAnnotationAdded(int index, NestableEclipseLinkConversionValueAnnotation nestedAnnotation) { - SourceEclipseLinkObjectTypeConverterAnnotation.this.conversionValueAdded(index, nestedAnnotation); - } - - public NestableEclipseLinkConversionValueAnnotation moveNestedAnnotationInternal(int targetIndex, int sourceIndex) { - return SourceEclipseLinkObjectTypeConverterAnnotation.this.moveConversionValueInternal(targetIndex, sourceIndex); - } - - public void nestedAnnotationMoved(int targetIndex, int sourceIndex) { - SourceEclipseLinkObjectTypeConverterAnnotation.this.conversionValueMoved(targetIndex, sourceIndex); - } - - public NestableEclipseLinkConversionValueAnnotation removeNestedAnnotationInternal(int index) { - return SourceEclipseLinkObjectTypeConverterAnnotation.this.removeConversionValueInternal(index); - } - - public void nestedAnnotationRemoved(int index, NestableEclipseLinkConversionValueAnnotation nestedAnnotation) { - SourceEclipseLinkObjectTypeConverterAnnotation.this.conversionValueRemoved(index, nestedAnnotation); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java deleted file mode 100644 index 2118bbfb28..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation; - -/** - * org.eclipse.persistence.annotations.PrivateOwned - */ -public final class SourceEclipseLinkPrivateOwnedAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkPrivateOwnedAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - - public SourceEclipseLinkPrivateOwnedAnnotation(JavaResourceNode parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - // nothing to initialize - } - - public void update(CompilationUnit astRoot) { - // nothing to update - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java deleted file mode 100644 index f57fb0f5f6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadOnly - */ -public final class SourceEclipseLinkReadOnlyAnnotation - extends SourceAnnotation<Type> - implements EclipseLinkReadOnlyAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - - public SourceEclipseLinkReadOnlyAnnotation(JavaResourceNode parent, Type type) { - super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - // nothing to initialize - } - - public void update(CompilationUnit astRoot) { - // nothing to update - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java deleted file mode 100644 index c2274c4378..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadTransformer - */ -public final class SourceEclipseLinkReadTransformerAnnotation - extends SourceEclipseLinkTransformerAnnotation - implements EclipseLinkReadTransformerAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - - public SourceEclipseLinkReadTransformerAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - - // ********** SourceTransformerAnnotation implementation ********** - - @Override - String getTransformerClassElementName() { - return EclipseLink.READ_TRANSFORMER__TRANSFORMER_CLASS; - } - - @Override - String getMethodElementName() { - return EclipseLink.READ_TRANSFORMER__METHOD; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java deleted file mode 100644 index 6b14438286..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.StructConverter - */ -public final class SourceEclipseLinkStructConverterAnnotation - extends SourceEclipseLinkNamedConverterAnnotation - implements EclipseLinkStructConverterAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> CONVERTER_ADAPTER = buildConverterAdapter(); - private final AnnotationElementAdapter<String> converterAdapter; - private String converter; - - - public SourceEclipseLinkStructConverterAnnotation(JavaResourcePersistentMember parent, Member member) { - super(parent, member, DECLARATION_ANNOTATION_ADAPTER); - this.converterAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, CONVERTER_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void initialize(CompilationUnit astRoot) { - super.initialize(astRoot); - this.converter = this.buildConverter(astRoot); - } - - @Override - public void update(CompilationUnit astRoot) { - super.update(astRoot); - this.setConverter(this.buildConverter(astRoot)); - } - - - // ********** SourceNamedConverterAnnotation implementation ********** - - @Override - String getNameElementName() { - return EclipseLink.STRUCT_CONVERTER__NAME; - } - - - // ********** StructConverterAnnotation implementation ********** - - // ***** converter - public String getConverter() { - return this.converter; - } - - public void setConverter(String converter) { - if (this.attributeValueHasNotChanged(this.converter, converter)) { - return; - } - String old = this.converter; - this.converter = converter; - this.converterAdapter.setValue(converter); - this.firePropertyChanged(CONVERTER_PROPERTY, old, converter); - } - - private String buildConverter(CompilationUnit astRoot) { - return this.converterAdapter.getValue(astRoot); - } - - public TextRange getConverterTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(CONVERTER_ADAPTER, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildConverterAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.STRUCT_CONVERTER__CONVERTER, false, StringExpressionConverter.instance()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java deleted file mode 100644 index b3e36bb6ea..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java +++ /dev/null @@ -1,194 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation; - -/** - * org.eclipse.persistence.annotations.TimeOfDay - */ -public final class SourceEclipseLinkTimeOfDayAnnotation - extends SourceAnnotation<Type> - implements EclipseLinkTimeOfDayAnnotation -{ - private final DeclarationAnnotationElementAdapter<Integer> hourDeclarationAdapter; - private final AnnotationElementAdapter<Integer> hourAdapter; - private Integer hour; - - private final DeclarationAnnotationElementAdapter<Integer> minuteDeclarationAdapter; - private final AnnotationElementAdapter<Integer> minuteAdapter; - private Integer minute; - - private final DeclarationAnnotationElementAdapter<Integer> secondDeclarationAdapter; - private final AnnotationElementAdapter<Integer> secondAdapter; - private Integer second; - - private final DeclarationAnnotationElementAdapter<Integer> millisecondDeclarationAdapter; - private final AnnotationElementAdapter<Integer> millisecondAdapter; - private Integer millisecond; - - - public SourceEclipseLinkTimeOfDayAnnotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa) { - super(parent, type, daa); - this.hourDeclarationAdapter = buildHourAdapter(daa); - this.hourAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, this.hourDeclarationAdapter); - this.minuteDeclarationAdapter = buildMinuteAdapter(daa); - this.minuteAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, this.minuteDeclarationAdapter); - this.secondDeclarationAdapter = buildSecondAdapter(daa); - this.secondAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, this.secondDeclarationAdapter); - this.millisecondDeclarationAdapter = buildMillisecondAdapter(daa); - this.millisecondAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, this.millisecondDeclarationAdapter); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.hour = this.buildHour(astRoot); - this.minute = this.buildMinute(astRoot); - this.second = this.buildSecond(astRoot); - this.millisecond = this.buildMillisecond(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setHour(this.buildHour(astRoot)); - this.setMinute(this.buildMinute(astRoot)); - this.setSecond(this.buildSecond(astRoot)); - this.setMillisecond(this.buildMillisecond(astRoot)); - } - - - // ********** TimeOfDayAnnotation implementation ********** - - // ***** hour - public Integer getHour() { - return this.hour; - } - - public void setHour(Integer hour) { - if (this.attributeValueHasNotChanged(this.hour, hour)) { - return; - } - Integer old = this.hour; - this.hour = hour; - this.hourAdapter.setValue(hour); - this.firePropertyChanged(HOUR_PROPERTY, old, hour); - } - - private Integer buildHour(CompilationUnit astRoot) { - return this.hourAdapter.getValue(astRoot); - } - - public TextRange getHourTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.hourDeclarationAdapter, astRoot); - } - - // ***** minute - public Integer getMinute() { - return this.minute; - } - - public void setMinute(Integer newMinute) { - if (attributeValueHasNotChanged(this.minute, newMinute)) { - return; - } - Integer oldMinute = this.minute; - this.minute = newMinute; - this.minuteAdapter.setValue(newMinute); - firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute); - } - - private Integer buildMinute(CompilationUnit astRoot) { - return this.minuteAdapter.getValue(astRoot); - } - - public TextRange getMinuteTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.minuteDeclarationAdapter, astRoot); - } - - // ***** second - public Integer getSecond() { - return this.second; - } - - public void setSecond(Integer newSecond) { - if (attributeValueHasNotChanged(this.second, newSecond)) { - return; - } - Integer oldSecond = this.second; - this.second = newSecond; - this.secondAdapter.setValue(newSecond); - firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond); - } - - private Integer buildSecond(CompilationUnit astRoot) { - return this.secondAdapter.getValue(astRoot); - } - - public TextRange getSecondTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.secondDeclarationAdapter, astRoot); - } - - // ***** millisecond - public Integer getMillisecond() { - return this.millisecond; - } - - public void setMillisecond(Integer newMillisecond) { - if (attributeValueHasNotChanged(this.millisecond, newMillisecond)) { - return; - } - Integer oldMillisecond = this.millisecond; - this.millisecond = newMillisecond; - this.millisecondAdapter.setValue(newMillisecond); - firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond); - } - - private Integer buildMillisecond(CompilationUnit astRoot) { - return this.millisecondAdapter.getValue(astRoot); - } - - public TextRange getMillisecondTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.millisecondDeclarationAdapter, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<Integer> buildHourAdapter(DeclarationAnnotationAdapter daa) { - return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__HOUR, false, NumberIntegerExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<Integer> buildMinuteAdapter(DeclarationAnnotationAdapter daa) { - return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__MINUTE, false, NumberIntegerExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<Integer> buildSecondAdapter(DeclarationAnnotationAdapter daa) { - return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__SECOND, false, NumberIntegerExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<Integer> buildMillisecondAdapter(DeclarationAnnotationAdapter daa) { - return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__MILLISECOND, false, NumberIntegerExpressionConverter.instance()); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java deleted file mode 100644 index 1b4e6e6227..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.FetchType; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation; - -/** - * org.eclipse.persistence.annotations.Transformation - */ -public final class SourceEclipseLinkTransformationAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkTransformationAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter(); - private final AnnotationElementAdapter<String> fetchAdapter; - private FetchType fetch; - - private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter(); - private final AnnotationElementAdapter<Boolean> optionalAdapter; - private Boolean optional; - - - public SourceEclipseLinkTransformationAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.fetchAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER); - this.optionalAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - this.optional = this.buildOptional(astRoot); - this.fetch = this.buildFetch(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setOptional(this.buildOptional(astRoot)); - this.setFetch(this.buildFetch(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.fetch); - } - - - // ********** TransformationAnnotation implementation ********** - - // ***** fetch - public FetchType getFetch() { - return this.fetch; - } - - public void setFetch(FetchType fetch) { - if (this.attributeValueHasNotChanged(this.fetch, fetch)) { - return; - } - FetchType old = this.fetch; - this.fetch = fetch; - this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(fetch)); - this.firePropertyChanged(FETCH_PROPERTY, old, fetch); - } - - private FetchType buildFetch(CompilationUnit astRoot) { - return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot)); - } - - public TextRange getFetchTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(FETCH_ADAPTER, astRoot); - } - - // ***** optional - public Boolean getOptional() { - return this.optional; - } - - public void setOptional(Boolean optional) { - if (this.attributeValueHasNotChanged(this.optional, optional)) { - return; - } - Boolean old = this.optional; - this.optional = optional; - this.optionalAdapter.setValue(optional); - this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional); - } - - private Boolean buildOptional(CompilationUnit astRoot) { - return this.optionalAdapter.getValue(astRoot); - } - - public TextRange getOptionalTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(OPTIONAL_ADAPTER, astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() { - return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.TRANSFORMATION__OPTIONAL, false, BooleanExpressionConverter.instance()); - } - - private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.TRANSFORMATION__FETCH, false); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java deleted file mode 100644 index 86eace3576..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformerAnnotation; - -/** - * org.eclipse.persistence.annotations.ReadTransformer - * org.eclipse.persistence.annotations.WriteTransformer - */ -abstract class SourceEclipseLinkTransformerAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkTransformerAnnotation -{ - final DeclarationAnnotationElementAdapter<String> transformerClassDeclarationAdapter; - final AnnotationElementAdapter<String> transformerClassAdapter; - String transformerClass; - - final DeclarationAnnotationElementAdapter<String> methodDeclarationAdapter; - final AnnotationElementAdapter<String> methodAdapter; - String method; - - - SourceEclipseLinkTransformerAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa) { - super(parent, attribute, daa); - this.transformerClassDeclarationAdapter = new ConversionDeclarationAnnotationElementAdapter<String>(daa, this.getTransformerClassElementName(), false, SimpleTypeStringExpressionConverter.instance()); - this.transformerClassAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, this.transformerClassDeclarationAdapter); - - this.methodDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getMethodElementName(), false); - this.methodAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, this.methodDeclarationAdapter); - } - - public void initialize(CompilationUnit astRoot) { - this.transformerClass = this.buildTransformerClass(astRoot); - this.method = this.buildMethod(astRoot); - } - - public void update(CompilationUnit astRoot) { - this.setTransformerClass(this.buildTransformerClass(astRoot)); - this.setMethod(this.buildMethod(astRoot)); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.transformerClass); - } - - - // ********** TransformerAnnotation implementation ********** - - // ***** transformer class - public String getTransformerClass() { - return this.transformerClass; - } - - public void setTransformerClass(String transformerClass) { - if (this.attributeValueHasNotChanged(this.transformerClass, transformerClass)) { - return; - } - String old = this.transformerClass; - this.transformerClass = transformerClass; - this.transformerClassAdapter.setValue(transformerClass); - this.firePropertyChanged(TRANSFORMER_CLASS_PROPERTY, old, transformerClass); - } - - private String buildTransformerClass(CompilationUnit astRoot) { - return this.transformerClassAdapter.getValue(astRoot); - } - - public TextRange getTransformerClassTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.transformerClassDeclarationAdapter, astRoot); - } - - abstract String getTransformerClassElementName(); - - // ***** method - public String getMethod() { - return this.method; - } - - public void setMethod(String method) { - if (this.attributeValueHasNotChanged(this.method, method)) { - return; - } - String old = this.method; - this.method = method; - this.methodAdapter.setValue(method); - this.firePropertyChanged(METHOD_PROPERTY, old, method); - } - - private String buildMethod(CompilationUnit astRoot) { - return this.methodAdapter.getValue(astRoot); - } - - public TextRange getMethodTextRange(CompilationUnit astRoot) { - return this.getElementTextRange(this.methodDeclarationAdapter, astRoot); - } - - abstract String getMethodElementName(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java deleted file mode 100644 index e6f7670b1e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation; - -/** - * org.eclipse.persistence.annotations.TypeConverter - */ -public final class SourceEclipseLinkTypeConverterAnnotation - extends SourceBaseEclipseLinkTypeConverterAnnotation - implements EclipseLinkTypeConverterAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - - public SourceEclipseLinkTypeConverterAnnotation(JavaResourcePersistentMember parent, Member member) { - super(parent, member, DECLARATION_ANNOTATION_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - - // ********** SourceNamedConverterAnnotation implementation ********** - - @Override - String getNameElementName() { - return EclipseLink.TYPE_CONVERTER__NAME; - } - - - // ********** SourceBaseTypeConverterAnnotation implementation ********** - - @Override - String getDataTypeElementName() { - return EclipseLink.TYPE_CONVERTER__DATA_TYPE; - } - - @Override - String getObjectTypeElementName() { - return EclipseLink.TYPE_CONVERTER__OBJECT_TYPE; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java deleted file mode 100644 index 268190206f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation; - -/** - * org.eclipse.persistence.annotations.VariableOneToOne - */ -public final class SourceEclipseLinkVariableOneToOneAnnotation - extends SourceAnnotation<Attribute> - implements EclipseLinkVariableOneToOneAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - - public SourceEclipseLinkVariableOneToOneAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - public void initialize(CompilationUnit astRoot) { - // nothing to initialize - } - - public void update(CompilationUnit astRoot) { - // nothing to update - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java deleted file mode 100644 index 7026f15b44..0000000000 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 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.eclipselink.core.internal.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.resource.java.source.SourceColumnAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.resource.java.ColumnAnnotation; -import org.eclipse.jpt.core.resource.java.JPA; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.eclipselink.core.internal.resource.java.NullEclipseLinkWriteTransformerColumnAnnotation; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink; -import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation; - -/** - * org.eclipse.persistence.annotations.WriteTransformer - */ -public final class SourceEclipseLinkWriteTransformerAnnotation - extends SourceEclipseLinkTransformerAnnotation - implements EclipseLinkWriteTransformerAnnotation -{ - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - - private final MemberAnnotationAdapter columnAdapter; - private ColumnAnnotation column; - - - public SourceEclipseLinkWriteTransformerAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { - super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.columnAdapter = new MemberAnnotationAdapter(this.member, buildColumnAnnotationAdapter(this.daa)); - } - - public String getAnnotationName() { - return ANNOTATION_NAME; - } - - @Override - public void initialize(CompilationUnit astRoot) { - super.initialize(astRoot); - if (this.columnAdapter.getAnnotation(astRoot) != null) { - this.column = createColumn(this, this.member, this.daa); - this.column.initialize(astRoot); - } - } - - @Override - public void update(CompilationUnit astRoot) { - super.update(astRoot); - if (this.columnAdapter.getAnnotation(astRoot) == null) { - this.setColumn(null); - } else { - if (this.column == null) { - ColumnAnnotation col = createColumn(this, this.member, this.daa); - col.initialize(astRoot); - this.setColumn(col); - } else { - this.column.update(astRoot); - } - } - } - - - // ********** SourceTransformerAnnotation implementation ********** - - @Override - String getTransformerClassElementName() { - return EclipseLink.WRITE_TRANSFORMER__TRANSFORMER_CLASS; - } - - @Override - String getMethodElementName() { - return EclipseLink.WRITE_TRANSFORMER__METHOD; - } - - - // ********** WriteTransformerAnnotation implementation ********** - - // ***** column - public ColumnAnnotation getColumn() { - return this.column; - } - - public ColumnAnnotation getNonNullColumn() { - return (this.column != null) ? this.column : new NullEclipseLinkWriteTransformerColumnAnnotation(this); - } - - public ColumnAnnotation addColumn() { - ColumnAnnotation col = createColumn(this, this.member, this.daa); - col.newAnnotation(); - this.setColumn(col); - return col; - } - - public void removeColumn() { - this.column.removeAnnotation(); - this.setColumn(null); - } - - private void setColumn(ColumnAnnotation newColumn) { - ColumnAnnotation old = this.column; - this.column = newColumn; - this.firePropertyChanged(COLUMN_PROPERTY, old, newColumn); - } - - public TextRange getColumnTextRange(CompilationUnit astRoot) { - if (this.column != null) { - return this.column.getTextRange(astRoot); - } - return getTextRange(astRoot); - } - - - // ********** static methods ********** - - private static DeclarationAnnotationAdapter buildColumnAnnotationAdapter(DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) { - return new NestedDeclarationAnnotationAdapter(writeTransformerAnnotationAdapter, EclipseLink.WRITE_TRANSFORMER__COLUMN, JPA.COLUMN, false); - } - - private static ColumnAnnotation createColumn(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) { - return new SourceColumnAnnotation(parent, member, buildColumnAnnotationAdapter(writeTransformerAnnotationAdapter)); - } - -} |