diff options
Diffstat (limited to 'jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java')
-rw-r--r-- | jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java deleted file mode 100644 index d17b57fb22..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 2012 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.resource.java.source; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation; -import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; -import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; -import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; -import org.eclipse.jpt.jaxb.core.resource.java.JAXB; -import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation; - -/** - * javax.xml.bind.annotation.XmlElementRefs - */ -public class SourceXmlElementRefsAnnotation - extends SourceAnnotation - implements XmlElementRefsAnnotation { - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER - = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REFS); - - - private final XmlElementRefsAnnotationContainer xmlElementRefsContainer - = new XmlElementRefsAnnotationContainer(); - - - public SourceXmlElementRefsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { - this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); - } - - public SourceXmlElementRefsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) { - super(parent, annotatedElement, daa); - } - - - public String getAnnotationName() { - return JAXB.XML_ELEMENT_REFS; - } - - public void initialize(CompilationUnit astRoot) { - this.xmlElementRefsContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot)); - } - - public void synchronizeWith(CompilationUnit astRoot) { - this.xmlElementRefsContainer.synchronize(this.getAstAnnotation(astRoot)); - } - - - // **************** xml element refs ************************************** - - public ListIterable<XmlElementRefAnnotation> getXmlElementRefs() { - return this.xmlElementRefsContainer.getNestedAnnotations(); - } - - public int getXmlElementRefsSize() { - return this.xmlElementRefsContainer.getNestedAnnotationsSize(); - } - - public XmlElementRefAnnotation xmlElementRefAt(int index) { - return this.xmlElementRefsContainer.getNestedAnnotation(index); - } - - public XmlElementRefAnnotation addXmlElementRef(int index) { - return this.xmlElementRefsContainer.addNestedAnnotation(index); - } - - private XmlElementRefAnnotation buildXmlElementRef(int index) { - return SourceXmlElementRefAnnotation.buildNestedSourceXmlElementRefAnnotation( - this, this.annotatedElement, buildXmlElementRefIndexedDeclarationAnnotationAdapter(index)); - } - - private IndexedDeclarationAnnotationAdapter buildXmlElementRefIndexedDeclarationAnnotationAdapter(int index) { - return new NestedIndexedDeclarationAnnotationAdapter( - this.daa, JAXB.XML_ELEMENT_REFS__VALUE, index, JAXB.XML_ELEMENT_REF); - } - - public void moveXmlElementRef(int targetIndex, int sourceIndex) { - this.xmlElementRefsContainer.moveNestedAnnotation(targetIndex, sourceIndex); - } - - public void removeXmlElementRef(int index) { - this.xmlElementRefsContainer.removeNestedAnnotation(index); - } - - - class XmlElementRefsAnnotationContainer - extends AnnotationContainer<XmlElementRefAnnotation> { - - @Override - protected String getNestedAnnotationsListName() { - return XML_ELEMENT_REFS_LIST; - } - - @Override - protected String getElementName() { - return JAXB.XML_ELEMENT_REFS__VALUE; - } - - @Override - protected String getNestedAnnotationName() { - return JAXB.XML_ELEMENT_REF; - } - - @Override - protected XmlElementRefAnnotation buildNestedAnnotation(int index) { - return SourceXmlElementRefsAnnotation.this.buildXmlElementRef(index); - } - } -} |