diff options
Diffstat (limited to 'jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java')
-rw-r--r-- | jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java deleted file mode 100644 index 8c10a7a29b..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jaxb.core.internal.context.java; - -import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant; -import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum; -import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode; -import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant; -import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation; - -public class GenericJavaEnumConstant - extends AbstractJaxbContextNode - implements JaxbEnumConstant { - - final protected JavaResourceEnumConstant resourceEnumConstant; - - protected String specifiedValue; - - public GenericJavaEnumConstant(JaxbPersistentEnum parent, JavaResourceEnumConstant resourceEnumConstant) { - super(parent); - this.resourceEnumConstant = resourceEnumConstant; - this.specifiedValue = this.getResourceEnumValue(); - } - - public JavaResourceEnumConstant getResourceEnumConstant() { - return this.resourceEnumConstant; - } - - - // ********** synchronize/update ********** - - @Override - public void synchronizeWithResourceModel() { - super.synchronizeWithResourceModel(); - this.setSpecifiedValue_(this.getResourceEnumValue()); - } - - - // ********** xml enum value annotation ********** - - protected XmlEnumValueAnnotation getXmlEnumValueAnnotation() { - return (XmlEnumValueAnnotation) this.getResourceEnumConstant().getNonNullAnnotation(XmlEnumValueAnnotation.ANNOTATION_NAME); - } - - - // ********** name ********** - - public String getName() { - return this.resourceEnumConstant.getName(); - } - - // ********** value ********** - - public String getValue() { - return this.getSpecifiedValue() != null ? this.getSpecifiedValue() : this.getDefaultValue(); - } - - public String getDefaultValue() { - return this.getName(); - } - - public String getSpecifiedValue() { - return this.specifiedValue; - } - - public void setSpecifiedValue(String value) { - this.getXmlEnumValueAnnotation().setValue(value); - this.setSpecifiedValue_(value); - } - - protected void setSpecifiedValue_(String value) { - String old = this.specifiedValue; - this.specifiedValue = value; - this.firePropertyChanged(SPECIFIED_VALUE_PROPERTY, old, value); - } - - protected String getResourceEnumValue() { - return this.getXmlEnumValueAnnotation().getValue(); - } -} |