Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jaxb
diff options
context:
space:
mode:
authorpfullbright2010-10-18 16:43:52 -0400
committerpfullbright2010-10-18 16:43:52 -0400
commit75d8c77d4359c7cfaab93f6939b6f4c8d44245e7 (patch)
tree584e9cf76b14621fbc597db7a4c7557c67d280a6 /jaxb
parentb76d398a6dccf0a815cf6da13d0625395c669855 (diff)
downloadwebtools.dali-75d8c77d4359c7cfaab93f6939b6f4c8d44245e7.tar.gz
webtools.dali-75d8c77d4359c7cfaab93f6939b6f4c8d44245e7.tar.xz
webtools.dali-75d8c77d4359c7cfaab93f6939b6f4c8d44245e7.zip
package annotations - tweaked java type adapter annotations
Diffstat (limited to 'jaxb')
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdaptersAnnotation.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableXmlJavaTypeAdapterAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java147
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java106
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java18
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterAnnotationTests.java2
14 files changed, 562 insertions, 173 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
index b872ff6bec..b42e71491f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
@@ -15,67 +15,68 @@ 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.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableXmlJavaTypeAdapterAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
/**
* javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
*/
public final class BinaryXmlJavaTypeAdapterAnnotation
- extends BinaryAnnotation
- implements NestableXmlJavaTypeAdapterAnnotation
-{
+ extends BinaryAnnotation
+ implements XmlJavaTypeAdapterAnnotation {
+
private String value;
-
-
+
+
public BinaryXmlJavaTypeAdapterAnnotation(JavaResourceNode 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());
}
-
+
@Override
public void toString(StringBuilder sb) {
sb.append(this.value);
}
-
-
+
+
// ********** XmlJavaTypeAdapterAnnotation 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);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, value);
+ this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, value);
}
-
+
private String buildValue() {
return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__VALUE);
}
-
+
public TextRange getValueTextRange(CompilationUnit astRoot) {
throw new UnsupportedOperationException();
}
-
+
// ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
+
+ public String getFullyQualifiedValue() {
return this.value;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdaptersAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdaptersAnnotation.java
index 66e7fe823a..7e86122a19 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdaptersAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdaptersAnnotation.java
@@ -14,7 +14,7 @@ import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jpt.core.internal.resource.java.binary.BinaryContainerAnnotation;
import org.eclipse.jpt.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableXmlJavaTypeAdapterAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdaptersAnnotation;
import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
@@ -22,51 +22,50 @@ import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
* javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters
*/
public class BinaryXmlJavaTypeAdaptersAnnotation
- extends BinaryContainerAnnotation<NestableXmlJavaTypeAdapterAnnotation>
- implements XmlJavaTypeAdaptersAnnotation
-{
- private final Vector<NestableXmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters;
-
-
+ extends BinaryContainerAnnotation<XmlJavaTypeAdapterAnnotation>
+ implements XmlJavaTypeAdaptersAnnotation {
+
+ private final Vector<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters;
+
+
public BinaryXmlJavaTypeAdaptersAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.xmlJavaTypeAdapters = this.buildXmlJavaTypeAdapters();
}
-
+
public String getAnnotationName() {
return ANNOTATION_NAME;
}
-
- public Iterable<NestableXmlJavaTypeAdapterAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableXmlJavaTypeAdapterAnnotation>(this.xmlJavaTypeAdapters);
+
+ public Iterable<XmlJavaTypeAdapterAnnotation> getNestedAnnotations() {
+ return new LiveCloneIterable<XmlJavaTypeAdapterAnnotation>(this.xmlJavaTypeAdapters);
}
-
+
public int getNestedAnnotationsSize() {
return this.xmlJavaTypeAdapters.size();
}
-
- private Vector<NestableXmlJavaTypeAdapterAnnotation> buildXmlJavaTypeAdapters() {
+
+ private Vector<XmlJavaTypeAdapterAnnotation> buildXmlJavaTypeAdapters() {
Object[] jdtTypeAdapters = this.getJdtMemberValues(JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE);
- Vector<NestableXmlJavaTypeAdapterAnnotation> result = new Vector<NestableXmlJavaTypeAdapterAnnotation>(jdtTypeAdapters.length);
+ Vector<XmlJavaTypeAdapterAnnotation> result = new Vector<XmlJavaTypeAdapterAnnotation>(jdtTypeAdapters.length);
for (Object jdtJavaTypeAdapter : jdtTypeAdapters) {
result.add(this.buildXmlJavaTypeAdapterAnnotation(jdtJavaTypeAdapter));
}
return result;
}
-
- protected NestableXmlJavaTypeAdapterAnnotation buildXmlJavaTypeAdapterAnnotation(Object jdtJavaTypeAdapter) {
+
+ protected XmlJavaTypeAdapterAnnotation buildXmlJavaTypeAdapterAnnotation(Object jdtJavaTypeAdapter) {
return new BinaryXmlJavaTypeAdapterAnnotation(this, (IAnnotation) jdtJavaTypeAdapter);
}
-
+
@Override
public void update() {
super.update();
this.updateXmlJavaTypeAdapters();
}
-
+
// TODO
private void updateXmlJavaTypeAdapters() {
throw new UnsupportedOperationException();
}
-
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
index 64161ea5fd..0e212e459c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
@@ -12,8 +12,8 @@ package org.eclipse.jpt.jaxb.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.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
@@ -31,7 +31,6 @@ import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableXmlJavaTypeAdapterAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
/**
@@ -39,7 +38,7 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
*/
public final class SourceXmlJavaTypeAdapterAnnotation
extends SourceAnnotation<AnnotatedElement>
- implements NestableXmlJavaTypeAdapterAnnotation
+ implements XmlJavaTypeAdapterAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
@@ -47,7 +46,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private final AnnotationElementAdapter<String> valueAdapter;
private String value;
- private String fullyQualifiedValueClassName;
+ private String fullyQualifiedValue;
// ********** constructors **********
@@ -79,12 +78,12 @@ public final class SourceXmlJavaTypeAdapterAnnotation
public void initialize(CompilationUnit astRoot) {
this.value = this.buildValue(astRoot);
- this.fullyQualifiedValueClassName = this.buildFullyQualifiedValueClassName(astRoot);
+ this.fullyQualifiedValue = this.buildFullyQualifiedValue(astRoot);
}
public void synchronizeWith(CompilationUnit astRoot) {
this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedValueClassName(this.buildFullyQualifiedValueClassName(astRoot));
+ this.syncFullyQualifiedValue(this.buildFullyQualifiedValue(astRoot));
}
@Override
@@ -122,17 +121,17 @@ public final class SourceXmlJavaTypeAdapterAnnotation
}
// ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.fullyQualifiedValueClassName;
+ public String getFullyQualifiedValue() {
+ return this.fullyQualifiedValue;
}
- private void syncFullyQualifiedValueClassName(String name) {
- String old = this.fullyQualifiedValueClassName;
- this.fullyQualifiedValueClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, name);
+ private void syncFullyQualifiedValue(String name) {
+ String old = this.fullyQualifiedValue;
+ this.fullyQualifiedValue = name;
+ this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, name);
}
- private String buildFullyQualifiedValueClassName(CompilationUnit astRoot) {
+ private String buildFullyQualifiedValue(CompilationUnit astRoot) {
return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java
index 226435d596..f2aa4b5975 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java
@@ -19,7 +19,6 @@ import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableXmlJavaTypeAdapterAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdaptersAnnotation;
import org.eclipse.jpt.utility.internal.CollectionTools;
@@ -29,85 +28,84 @@ import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
* javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters
*/
public class SourceXmlJavaTypeAdaptersAnnotation
- extends SourceAnnotation<AnnotatedElement>
- implements XmlJavaTypeAdaptersAnnotation
-{
+ extends SourceAnnotation<AnnotatedElement>
+ implements XmlJavaTypeAdaptersAnnotation {
+
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableXmlJavaTypeAdapterAnnotation> adapters = new Vector<NestableXmlJavaTypeAdapterAnnotation>();
-
-
+
+ private final Vector<XmlJavaTypeAdapterAnnotation> adapters = new Vector<XmlJavaTypeAdapterAnnotation>();
+
+
public SourceXmlJavaTypeAdaptersAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
}
-
+
public String getAnnotationName() {
return ANNOTATION_NAME;
}
-
+
public void initialize(CompilationUnit astRoot) {
AnnotationContainerTools.initialize(this, astRoot);
}
-
+
public void synchronizeWith(CompilationUnit astRoot) {
AnnotationContainerTools.synchronize(this, astRoot);
}
-
+
@Override
public void toString(StringBuilder sb) {
sb.append(this.adapters);
}
-
-
+
+
// ********** AnnotationContainer implementation **********
-
+
public String getElementName() {
return JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE;
}
-
+
public String getNestedAnnotationName() {
return XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME;
}
-
- public Iterable<NestableXmlJavaTypeAdapterAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableXmlJavaTypeAdapterAnnotation>(this.adapters);
+
+ public Iterable<XmlJavaTypeAdapterAnnotation> getNestedAnnotations() {
+ return new LiveCloneIterable<XmlJavaTypeAdapterAnnotation>(this.adapters);
}
-
+
public int getNestedAnnotationsSize() {
return this.adapters.size();
}
-
- public NestableXmlJavaTypeAdapterAnnotation addNestedAnnotation() {
+
+ public XmlJavaTypeAdapterAnnotation addNestedAnnotation() {
return this.addNestedAnnotation(this.adapters.size());
}
-
- private NestableXmlJavaTypeAdapterAnnotation addNestedAnnotation(int index) {
- NestableXmlJavaTypeAdapterAnnotation adapter = this.buildXmlJavaTypeAdapterAnnotation(index);
+
+ private XmlJavaTypeAdapterAnnotation addNestedAnnotation(int index) {
+ XmlJavaTypeAdapterAnnotation adapter = this.buildXmlJavaTypeAdapterAnnotation(index);
this.adapters.add(adapter);
return adapter;
}
-
+
public void syncAddNestedAnnotation(Annotation astAnnotation) {
int index = this.adapters.size();
- NestableXmlJavaTypeAdapterAnnotation namedQuery = this.addNestedAnnotation(index);
+ XmlJavaTypeAdapterAnnotation namedQuery = this.addNestedAnnotation(index);
namedQuery.initialize((CompilationUnit) astAnnotation.getRoot());
this.fireItemAdded(XML_JAVA_TYPE_ADAPTERS_LIST, index, namedQuery);
}
-
- protected NestableXmlJavaTypeAdapterAnnotation buildXmlJavaTypeAdapterAnnotation(int index) {
+
+ protected XmlJavaTypeAdapterAnnotation buildXmlJavaTypeAdapterAnnotation(int index) {
return SourceXmlJavaTypeAdapterAnnotation.createNestedXmlJavaTypeAdapterAnnotation(this, this.annotatedElement, index, this.daa);
}
-
- public NestableXmlJavaTypeAdapterAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
+
+ public XmlJavaTypeAdapterAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
return CollectionTools.move(this.adapters, targetIndex, sourceIndex).get(targetIndex);
}
-
- public NestableXmlJavaTypeAdapterAnnotation removeNestedAnnotation(int index) {
+
+ public XmlJavaTypeAdapterAnnotation removeNestedAnnotation(int index) {
return this.adapters.remove(index);
}
-
+
public void syncRemoveNestedAnnotations(int index) {
this.removeItemsFromList(index, this.adapters, XML_JAVA_TYPE_ADAPTERS_LIST);
}
-
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
index 857e967bcc..5b525e7035 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
@@ -27,9 +27,10 @@ public interface JAXB {
// JAXB package
String PACKAGE = "javax.xml.bind.annotation";
String PACKAGE_ = PACKAGE + '.';
-
- String ADAPTERS_PACKAGE = "javax.xml.bind.annotation.adapters";
- String ADAPTERS_PACKAGE_ = ADAPTERS_PACKAGE + '.';
+
+ String ADAPTERS_PACKAGE = PACKAGE_ + "adapters";
+ String ADAPTERS_PACKAGE_ = ADAPTERS_PACKAGE + ".";
+
// ********** API **********
@@ -44,16 +45,42 @@ public interface JAXB {
String XML_ENUM__VALUE = "value";
String XML_INLINE_BINARY_DATA = PACKAGE_ + "XmlInlineBinaryData";
-
+
+ String XML_JAVA_TYPE_ADAPTER = ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapter";
+ String XML_JAVA_TYPE_ADAPTER__TYPE = "type";
+ String XML_JAVA_TYPE_ADAPTER__VALUE = "value";
+
+ String XML_JAVA_TYPE_ADAPTERS = ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapters";
+ String XML_JAVA_TYPE_ADAPTERS__VALUE = "value";
+
+ String XML_NS = PACKAGE_ + "XmlNs";
+ String XML_NS__NAMESPACE_URI = "namespaceURI";
+ String XML_NS__PREFIX = "prefix";
+
String XML_REGISTRY = PACKAGE_ + "XmlRegistry";
-
+
String XML_ROOT_ELEMENT = PACKAGE_ + "XmlRootElement";
String XML_ROOT_ELEMENT__NAME = "name";
String XML_ROOT_ELEMENT__NAMESPACE = "namespace";
-
+
+ String XML_SCHEMA = PACKAGE + "XmlSchema";
+ String XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT = "attributeFormDefault";
+ String XML_SCHEMA__ELEMENT_FORM_DEFAULT = "elementFormDefault";
+ String XML_SCHEMA__LOCATION = "location";
+ String XML_SCHEMA__NAMESPACE = "namespace";
+ String XML_SCHEMA__XMLNS = "xmlns";
+
+ String XML_SCHEMA_TYPE = PACKAGE + "XmlSchemaType";
+ String XML_SCHEMA_TYPE__NAME = "name";
+ String XML_SCHEMA_TYPE__NAMESPACE = "namespace";
+ String XML_SCHEMA_TYPE__TYPE = "type";
+
+ String XML_SCHEMA_TYPES = PACKAGE + "XmlSchemaTypes";
+ String XML_SCHEMA_TYPES__VALUE = "value";
+
String XML_SEE_ALSO = PACKAGE_ + "XmlSeeAlso";
String XML_SEE_ALSO__VALUE = "value";
-
+
String XML_TYPE = PACKAGE_ + "XmlType";
String XML_TYPE__FACTORY_CLASS = "factoryClass";
String XML_TYPE__FACTORY_METHOD = "factoryMethod";
@@ -63,15 +90,6 @@ public interface JAXB {
String XML_TRANSIENT = PACKAGE_ + "XmlTransient";
-
- // JAXB annotation adapters
- String XML_JAVA_TYPE_ADAPTER = ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapter";
- String XML_JAVA_TYPE_ADAPTER__VALUE = "value";
-
- String XML_JAVA_TYPE_ADAPTERS = ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapters";
- String XML_JAVA_TYPE_ADAPTERS__VALUE = "value";
-
-
// JAXB enums
String XML_ACCESS_ORDER = PACKAGE_ + "XmlAccessOrder";
String XML_ACCESS_ORDER_ = XML_ACCESS_ORDER + '.';
@@ -84,5 +102,10 @@ public interface JAXB {
String XML_ACCESS_TYPE__NONE = XML_ACCESS_TYPE_ + "NONE";
String XML_ACCESS_TYPE__PROPERTY = XML_ACCESS_TYPE_ + "PROPERTY";
String XML_ACCESS_TYPE__PUBLIC_MEMBER = XML_ACCESS_TYPE_ + "PUBLIC_MEMBER";
-
+
+ String XML_NS_FORM = PACKAGE_ + "XmlNsForm";
+ String XML_NS_FORM_ = XML_NS_FORM + ".";
+ String XML_NS_FORM__QUALIFIED = XML_NS_FORM_ + "QUALIFIED";
+ String XML_NS_FORM__UNQUALIFIED = XML_NS_FORM_ + "UNQUALIFIED";
+ String XML_NS_FORM__UNSET = XML_NS_FORM_ + "UNSET";
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableXmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 69cda336f2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,31 +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.resource.java;
-
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface NestableXmlJavaTypeAdapterAnnotation
- extends XmlJavaTypeAdapterAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
index 2c14f490e2..e6bdcd2b27 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
@@ -1,16 +1,16 @@
/*******************************************************************************
- * 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
- ******************************************************************************/
+ * 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.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
+import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
@@ -27,42 +27,36 @@ import org.eclipse.jpt.core.utility.TextRange;
* @since 3.0
*/
public interface XmlJavaTypeAdapterAnnotation
- extends Annotation
-{
+ extends NestableAnnotation {
+
String ANNOTATION_NAME = JAXB.XML_JAVA_TYPE_ADAPTER;
-
+
/**
* Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation.
* Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlJavaTypeAdapter(value=FooAdapter.class)
- * </pre>
- * will return "FooAdapter"
*/
String getValue();
String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
+
/**
* Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation.
* Set to null to remove the element.
*/
void setValue(String value);
+
/**
* Return the {@link TextRange} for the 'value' element. If the element
* does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
*/
TextRange getValueTextRange(CompilationUnit astRoot);
-
+
/**
- * Return the fully-qualified value class name as resolved by the AST's bindings.
+ * Return the value's fully-qualified class name as resolved by the AST's bindings.
* <pre>
- * &#64;XmlJavaTypeAdapter(value=FooAdapter.class)
+ * &#64;XmlJavaTypeAdapter(FooAdapter.class)
* </pre>
- * will return "model.FooAdapter" if there is an import for model.FooAdapter.
- * @return
+ * will return "example.FooAdapter" if there is an import for example.FooAdapter.
*/
- String getFullyQualifiedValueClassName();
- String FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY = "fullyQualifiedValueClassName"; //$NON-NLS-1$
-
+ String getFullyQualifiedValue();
+ String FULLY_QUALIFIED_VALUE_PROPERTY = "fullyQualifiedValue"; //$NON-NLS-1$
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java
index dc6dbd86a3..1a70c8a20f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * 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
- ******************************************************************************/
+ * 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.resource.java;
import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
@@ -25,9 +25,9 @@ import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
* @since 3.0
*/
public interface XmlJavaTypeAdaptersAnnotation
- extends ContainerAnnotation<NestableXmlJavaTypeAdapterAnnotation>
-{
+ extends ContainerAnnotation<XmlJavaTypeAdapterAnnotation> {
+
String ANNOTATION_NAME = JAXB.XML_JAVA_TYPE_ADAPTERS;
-
+
String XML_JAVA_TYPE_ADAPTERS_LIST = "xmlJavaTypeAdapters"; //$NON-NLS-1$
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
new file mode 100644
index 0000000000..6e4e76c18f
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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.resource.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.resource.java.Annotation;
+import org.eclipse.jpt.core.utility.TextRange;
+
+/**
+ * Corresponds to the JAXB annotation
+ * javax.xml.bind.annotation.XmlNs
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface XmlNsAnnotation
+ extends Annotation {
+
+ String ANNOTATION_NAME = JAXB.XML_NS;
+
+ /**
+ * Corresponds to the 'namespace' element of the XmlNs annotation.
+ * Return null if the element does not exist in Java.
+ */
+ String getNamespace();
+ String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'namespace' element of the XmlNs annotation.
+ * Set to null to remove the element.
+ */
+ void setNamespace(String namespace);
+
+ /**
+ * Return the {@link TextRange} for the 'namespace' element. If the element
+ * does not exist return the {@link TextRange} for the XmlNs annotation.
+ */
+ TextRange getNamespaceTextRange(CompilationUnit astRoot);
+
+ /**
+ * Corresponds to the 'prefix' element of the XmlNs annotation.
+ * Return null if the element does not exist in Java.
+ */
+ String getPrefix();
+ String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'prefix' element of the XmlNs annotation.
+ * Set to null to remove the element.
+ */
+ void setPrefix(String prefix);
+
+ /**
+ * Return the {@link TextRange} for the 'prefix' element. If the element
+ * does not exist return the {@link TextRange} for the XmlNs annotation.
+ */
+ TextRange getPrefixTextRange(CompilationUnit astRoot);
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java
new file mode 100644
index 0000000000..4d73541c8f
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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.resource.java;
+
+/**
+ * Corresponds to the JAXB enum
+ * javax.xml.bind.annotation.XmlNsForm
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public enum XmlNsForm {
+
+ QUALIFIED(JAXB.XML_NS_FORM__QUALIFIED),
+ UNQUALIFIED(JAXB.XML_NS_FORM__UNQUALIFIED),
+ UNSET(JAXB.XML_NS_FORM__UNSET);
+
+
+ private String javaAnnotationValue;
+
+ XmlNsForm(String javaAnnotationValue) {
+ if (javaAnnotationValue == null) {
+ throw new NullPointerException();
+ }
+ this.javaAnnotationValue = javaAnnotationValue;
+ }
+
+ public String getJavaAnnotationValue() {
+ return this.javaAnnotationValue;
+ }
+
+
+ // ********** static methods **********
+
+ public static XmlNsForm fromJavaAnnotationValue(Object javaAnnotationValue) {
+ return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
+ }
+
+ private static XmlNsForm fromJavaAnnotationValue_(Object javaAnnotationValue) {
+ for (XmlNsForm nsForm : XmlNsForm.values()) {
+ if (nsForm.getJavaAnnotationValue().equals(javaAnnotationValue)) {
+ return nsForm;
+ }
+ }
+ return null;
+ }
+
+ public static String toJavaAnnotationValue(XmlNsForm nsForm) {
+ return (nsForm == null) ? null : nsForm.getJavaAnnotationValue();
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java
new file mode 100644
index 0000000000..f33d928839
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * 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.resource.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.resource.java.Annotation;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.utility.internal.iterables.ListIterable;
+
+/**
+ * Corresponds to the JAXB annotation
+ * javax.xml.bind.annotation.XmlSchema
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface XmlSchemaAnnotation
+ extends Annotation {
+
+ String ANNOTATION_NAME = JAXB.XML_SCHEMA;
+
+ /**
+ * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation.
+ * Return null if the element does not exist in Java.
+ */
+ XmlNsForm getAttributeFormDefault();
+ String ATTRIBUTE_FORM_DEFAULT_PROPERTY = "attributeFormDefault"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation.
+ * Set to null to remove the element.
+ */
+ void setAttributeFormDefault(XmlNsForm attributeFormDefault);
+
+ /**
+ * Return the {@link TextRange} for the 'attributeFormDefault' element. If the element
+ * does not exist return the {@link TextRange} for the XmlSchema annotation.
+ */
+ TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot);
+
+ /**
+ * Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
+ * Return null if the element does not exist in Java.
+ */
+ XmlNsForm getElementFormDefault();
+ String ELEMENT_FORM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
+ * Set to null to remove the element.
+ */
+ void setElementFormDefault(XmlNsForm elementFormDefault);
+
+ /**
+ * Return the {@link TextRange} for the 'elementFormDefault' element. If the element
+ * does not exist return the {@link TextRange} for the XmlSchema annotation.
+ */
+ TextRange getElementFormDefaultTextRange(CompilationUnit astRoot);
+
+ /**
+ * Corresponds to the 'location' element of the XmlSchema annotation.
+ * Return null if the element does not exist in Java.
+ */
+ String getLocation();
+ String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'location' element of the XmlSchema annotation.
+ * Set to null to remove the element.
+ */
+ void setLocation(String location);
+
+ /**
+ * Return the {@link TextRange} for the 'location' element. If the element
+ * does not exist return the {@link TextRange} for the XmlSchema annotation.
+ */
+ TextRange getLocationTextRange(CompilationUnit astRoot);
+
+ /**
+ * Corresponds to the 'namespace' element of the XmlSchema annotation.
+ * Return null if the element does not exist in Java.
+ */
+ String getNamespace();
+ String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'namespace' element of the XmlSchema annotation.
+ * Set to null to remove the element.
+ */
+ void setNamespace(String namespace);
+
+ /**
+ * Return the {@link TextRange} for the 'namespace' element. If the element
+ * does not exist return the {@link TextRange} for the XmlSchema annotation.
+ */
+ TextRange getNamespaceTextRange(CompilationUnit astRoot);
+
+ /**
+ * Corresponds to the 'xmlns' element of the XmlSchema annotation.
+ * Return an empty iterator if the element does not exist in Java.
+ */
+ ListIterable<XmlNsAnnotation> getXmlns();
+ String XMLNS_LIST = "xmlns"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'xmlns' element of the XmlSchema annotation.
+ */
+ int getXmlnsSize();
+
+ /**
+ * Corresponds to the 'xmlns' element of the XmlSchema annotation.
+ */
+ void addXmlns(XmlNsAnnotation xmlns);
+
+ /**
+ * Corresponds to the 'xmlns' element of the XmlSchema annotation.
+ */
+ void addXmlns(int index, XmlNsAnnotation xmlns);
+
+ /**
+ * Corresponds to the 'xmlns' element of the XmlSchema annotation.
+ */
+ void moveXmlns(int targetIndex, int sourceIndex);
+
+ /**
+ * Corresponds to the 'xmlns' element of the XmlSchema annotation.
+ */
+ void removeXmlns(XmlNsAnnotation xmlns);
+
+ /**
+ * Corresponds to the 'xmlns' element of the XmlSchema annotation.
+ */
+ void removeXmlns(int index);
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
new file mode 100644
index 0000000000..4fe9cf5405
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * 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.resource.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.core.utility.TextRange;
+
+/**
+ * Corresponds to the JAXB annotation
+ * javax.xml.bind.annotation.XmlSchemaType
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface XmlSchemaTypeAnnotation
+ extends NestableAnnotation {
+
+ String ANNOTATION_NAME = JAXB.XML_SCHEMA_TYPE;
+
+ /**
+ * Corresponds to the 'name' element of the XmlSchemaType annotation.
+ * Return null if the element does not exist in Java.
+ */
+ String getName();
+ String NAME_PROPERTY = "name"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'name' element of the XmlSchemaType annotation.
+ * Set to null to remove the element.
+ */
+ void setName(String name);
+
+ /**
+ * Return the {@link TextRange} for the 'name' element. If the element
+ * does not exist return the {@link TextRange} for the XmlSchemaType annotation.
+ */
+ TextRange getNameTextRange(CompilationUnit astRoot);
+
+ /**
+ * Corresponds to the 'namespace' element of the XmlSchemaType annotation.
+ * Return null if the element does not exist in Java.
+ */
+ String getNamespace();
+ String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'namespace' element of the XmlSchemaType annotation.
+ * Set to null to remove the element.
+ */
+ void setNamespace(String namespace);
+
+ /**
+ * Return the {@link TextRange} for the 'namespace' element. If the element
+ * does not exist return the {@link TextRange} for the XmlSchemaType annotation.
+ */
+ TextRange getNamespaceTextRange(CompilationUnit astRoot);
+
+ /**
+ * Corresponds to the 'type' element of the XmlSchemaType annotation.
+ * Return null if the element does not exist in Java.
+ * Return the portion of the value preceding ".class".
+ * <pre>
+ * &#64;XmlSchemaType(name="date", type=XMLGregorianCalendar.class)
+ * </pre>
+ * will return "XMLGregorianCalendar"
+ */
+ String getType();
+ String TYPE_PROPERTY = "type"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'type' element of the XmlSchemaType annotation.
+ * Set to null to remove the element.
+ */
+ void setType(String type);
+ /**
+ * Return the {@link TextRange} for the 'type' element. If the element
+ * does not exist return the {@link TextRange} for the XmlSchemaType annotation.
+ */
+ TextRange getTypeTextRange(CompilationUnit astRoot);
+
+ /**
+ * Return the fully-qualified type name as resolved by the AST's bindings.
+ * <pre>
+ * &#64;XmlSchemaType(name="date", type=XMLGregorianCalendar.class)
+ * </pre>
+ * will return "javax.xml.datatype.XMLGregorianCalendar" if there is an import for
+ * javax.xml.datatype.XMLGregorianCalendar.
+ * @return
+ */
+ String getFullyQualifiedTypeName();
+ String FULLY_QUALIFIED_TYPE_NAME_PROPERTY = "fullyQualifiedTypeName"; //$NON-NLS-1$
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java
new file mode 100644
index 0000000000..e3e9ddc98f
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * 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.resource.java;
+
+import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
+
+public interface XmlSchemaTypesAnnotation
+ extends ContainerAnnotation<XmlSchemaTypeAnnotation> {
+
+ String ANNOTATION_NAME = JAXB.XML_SCHEMA_TYPES;
+}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterAnnotationTests.java
index fe9ab5e4f3..f8015d4711 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterAnnotationTests.java
@@ -80,7 +80,7 @@ public class XmlJavaTypeAdapterAnnotationTests extends JaxbJavaResourceModelTest
XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) typeResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
assertTrue(xmlJavaTypeAdapterAnnotation != null);
assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
- assertEquals("test." + XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getFullyQualifiedValueClassName());
+ assertEquals("test." + XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getFullyQualifiedValue());
}
public void testSetValue() throws Exception {

Back to the top