diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java deleted file mode 100644 index d89cff9ec8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java +++ /dev/null @@ -1,129 +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.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.GeneratorAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourceNode; -import org.eclipse.jpt.core.utility.TextRange; - -/** - * javax.persistence.SequenceGenerator - * javax.persistence.TableGenerator - */ -abstract class BinaryGeneratorAnnotation - extends BinaryAnnotation - implements GeneratorAnnotation -{ - String name; - Integer initialValue; - Integer allocationSize; - - - BinaryGeneratorAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) { - super(parent, jdtAnnotation); - this.name = this.buildName(); - this.initialValue = this.buildInitialValue(); - this.allocationSize = this.buildAllocationSize(); - } - - @Override - public void update() { - super.update(); - this.setName_(this.buildName()); - this.setInitialValue_(this.buildInitialValue()); - this.setAllocationSize_(this.buildAllocationSize()); - } - - @Override - public void toString(StringBuilder sb) { - sb.append(this.name); - } - - - // ********** GeneratorAnnotation 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()); - } - - abstract String getNameElementName(); - - public TextRange getNameTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** initial value - public Integer getInitialValue() { - return this.initialValue; - } - - public void setInitialValue(Integer initialValue) { - throw new UnsupportedOperationException(); - } - - private void setInitialValue_(Integer initialValue) { - Integer old = this.initialValue; - this.initialValue = initialValue; - this.firePropertyChanged(INITIAL_VALUE_PROPERTY, old, initialValue); - } - - private Integer buildInitialValue() { - return (Integer) this.getJdtMemberValue(this.getInitialValueElementName()); - } - - abstract String getInitialValueElementName(); - - public TextRange getInitialValueTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - - // ***** name - public Integer getAllocationSize() { - return this.allocationSize; - } - - public void setAllocationSize(Integer allocationSize) { - throw new UnsupportedOperationException(); - } - - private void setAllocationSize_(Integer allocationSize) { - Integer old = this.allocationSize; - this.allocationSize = allocationSize; - this.firePropertyChanged(NAME_PROPERTY, old, allocationSize); - } - - private Integer buildAllocationSize() { - return (Integer) this.getJdtMemberValue(this.getAllocationSizeElementName()); - } - - abstract String getAllocationSizeElementName(); - - public TextRange getAllocationSizeTextRange(CompilationUnit astRoot) { - throw new UnsupportedOperationException(); - } - -} |