javax.xml.bind.annotation.XmlList Java Examples
The following examples show how to use
javax.xml.bind.annotation.XmlList.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TypeAndAnnotationImpl.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example #2
Source File: SingleTypePropertyInfoImpl.java From hottub with GNU General Public License v2.0 | 6 votes |
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
Example #3
Source File: SingleTypePropertyInfoImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
Example #4
Source File: TypeAndAnnotationImpl.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example #5
Source File: TypeAndAnnotationImpl.java From hottub with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example #6
Source File: SingleTypePropertyInfoImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
Example #7
Source File: SingleTypePropertyInfoImpl.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
Example #8
Source File: SingleTypePropertyInfoImpl.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
Example #9
Source File: TypeAndAnnotationImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example #10
Source File: TypeAndAnnotationImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example #11
Source File: TypeAndAnnotationImpl.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example #12
Source File: TypeAndAnnotationImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example #13
Source File: SingleTypePropertyInfoImpl.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
Example #14
Source File: SingleTypePropertyInfoImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
Example #15
Source File: SingleTypePropertyInfoImpl.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public void link() { super.link(); if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) { parent.builder.reportError(new IllegalAnnotationException( Messages.SIMPLE_TYPE_IS_REQUIRED.format(), seed )); } if(!isCollection() && seed.hasAnnotation(XmlList.class)) { parent.builder.reportError(new IllegalAnnotationException( Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this )); } }
Example #16
Source File: JAXBModelImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private NonElement<TypeMirror, TypeElement> getXmlType(Reference r) { if(r==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = r.annotations.getAnnotation(XmlJavaTypeAdapter.class); XmlList xl = r.annotations.getAnnotation(XmlList.class); Ref<TypeMirror, TypeElement> ref = new Ref<TypeMirror, TypeElement>( reader,types.getNavigator(),r.type,xjta,xl); return types.getTypeInfo(ref); }
Example #17
Source File: Ref.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public Ref(AnnotationReader<T,C,?,?> reader, Navigator<T,C,?,?> nav, T type, XmlJavaTypeAdapter xjta, XmlList xl ) { Adapter<T,C> adapter=null; if(xjta!=null) { adapter = new Adapter<T,C>(xjta,reader,nav); type = adapter.defaultType; } this.type = type; this.adapter = adapter; this.valueList = xl!=null; }
Example #18
Source File: JavaCompilerImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public J2SJAXBModel bind( Collection<Reference> rootClasses, Map<QName,Reference> additionalElementDecls, String defaultNamespaceRemap, ProcessingEnvironment env) { ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement> builder = new ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement>( InlineAnnotationReaderImpl.theInstance, new ApNavigator(env), Collections.<TypeElement, TypeElement>emptyMap(), defaultNamespaceRemap ); builder.setErrorHandler(new ErrorHandlerImpl(env.getMessager())); for ( Reference ref : rootClasses ) { TypeMirror t = ref.type; XmlJavaTypeAdapter xjta = ref.annotations.getAnnotation(XmlJavaTypeAdapter.class); XmlList xl = ref.annotations.getAnnotation(XmlList.class); builder.getTypeInfo(new Ref<TypeMirror, TypeElement>(builder, t, xjta, xl)); } TypeInfoSet<TypeMirror, TypeElement, VariableElement, ExecutableElement> r = builder.link(); if(r==null) return null; if(additionalElementDecls==null) additionalElementDecls = Collections.emptyMap(); else { // fool proof check for (Map.Entry<QName, ? extends Reference> e : additionalElementDecls.entrySet()) { if(e.getKey()==null) throw new IllegalArgumentException("nulls in additionalElementDecls"); } } return new JAXBModelImpl(r, builder.reader, rootClasses, new HashMap<QName, Reference>(additionalElementDecls)); }
Example #19
Source File: JAXBContextImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #20
Source File: Ref.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public Ref(AnnotationReader<T,C,?,?> reader, Navigator<T,C,?,?> nav, T type, XmlJavaTypeAdapter xjta, XmlList xl ) { Adapter<T,C> adapter=null; if(xjta!=null) { adapter = new Adapter<T,C>(xjta,reader,nav); type = adapter.defaultType; } this.type = type; this.adapter = adapter; this.valueList = xl!=null; }
Example #21
Source File: ElementPropertyInfoImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
ElementPropertyInfoImpl( ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> parent, PropertySeed<TypeT,ClassDeclT,FieldT,MethodT> propertySeed) { super(parent, propertySeed); isValueList = seed.hasAnnotation(XmlList.class); }
Example #22
Source File: Ref.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public Ref(AnnotationReader<T,C,?,?> reader, Navigator<T,C,?,?> nav, T type, XmlJavaTypeAdapter xjta, XmlList xl ) { Adapter<T,C> adapter=null; if(xjta!=null) { adapter = new Adapter<T,C>(xjta,reader,nav); type = adapter.defaultType; } this.type = type; this.adapter = adapter; this.valueList = xl!=null; }
Example #23
Source File: JAXBContextImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #24
Source File: Ref.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public Ref(AnnotationReader<T,C,?,?> reader, Navigator<T,C,?,?> nav, T type, XmlJavaTypeAdapter xjta, XmlList xl ) { Adapter<T,C> adapter=null; if(xjta!=null) { adapter = new Adapter<T,C>(xjta,reader,nav); type = adapter.defaultType; } this.type = type; this.adapter = adapter; this.valueList = xl!=null; }
Example #25
Source File: ElementPropertyInfoImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
ElementPropertyInfoImpl( ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> parent, PropertySeed<TypeT,ClassDeclT,FieldT,MethodT> propertySeed) { super(parent, propertySeed); isValueList = seed.hasAnnotation(XmlList.class); }
Example #26
Source File: JAXBModelImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private NonElement<TypeMirror, TypeElement> getXmlType(Reference r) { if(r==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = r.annotations.getAnnotation(XmlJavaTypeAdapter.class); XmlList xl = r.annotations.getAnnotation(XmlList.class); Ref<TypeMirror, TypeElement> ref = new Ref<TypeMirror, TypeElement>( reader,types.getNavigator(),r.type,xjta,xl); return types.getTypeInfo(ref); }
Example #27
Source File: JavaCompilerImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public J2SJAXBModel bind( Collection<Reference> rootClasses, Map<QName,Reference> additionalElementDecls, String defaultNamespaceRemap, ProcessingEnvironment env) { ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement> builder = new ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement>( InlineAnnotationReaderImpl.theInstance, new ApNavigator(env), Collections.<TypeElement, TypeElement>emptyMap(), defaultNamespaceRemap ); builder.setErrorHandler(new ErrorHandlerImpl(env.getMessager())); for ( Reference ref : rootClasses ) { TypeMirror t = ref.type; XmlJavaTypeAdapter xjta = ref.annotations.getAnnotation(XmlJavaTypeAdapter.class); XmlList xl = ref.annotations.getAnnotation(XmlList.class); builder.getTypeInfo(new Ref<TypeMirror, TypeElement>(builder, t, xjta, xl)); } TypeInfoSet<TypeMirror, TypeElement, VariableElement, ExecutableElement> r = builder.link(); if(r==null) return null; if(additionalElementDecls==null) additionalElementDecls = Collections.emptyMap(); else { // fool proof check for (Map.Entry<QName, ? extends Reference> e : additionalElementDecls.entrySet()) { if(e.getKey()==null) throw new IllegalArgumentException("nulls in additionalElementDecls"); } } return new JAXBModelImpl(r, builder.reader, rootClasses, new HashMap<QName, Reference>(additionalElementDecls)); }
Example #28
Source File: JavaCompilerImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public J2SJAXBModel bind( Collection<Reference> rootClasses, Map<QName,Reference> additionalElementDecls, String defaultNamespaceRemap, ProcessingEnvironment env) { ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement> builder = new ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement>( InlineAnnotationReaderImpl.theInstance, new ApNavigator(env), Collections.<TypeElement, TypeElement>emptyMap(), defaultNamespaceRemap ); builder.setErrorHandler(new ErrorHandlerImpl(env.getMessager())); for ( Reference ref : rootClasses ) { TypeMirror t = ref.type; XmlJavaTypeAdapter xjta = ref.annotations.getAnnotation(XmlJavaTypeAdapter.class); XmlList xl = ref.annotations.getAnnotation(XmlList.class); builder.getTypeInfo(new Ref<TypeMirror, TypeElement>(builder, t, xjta, xl)); } TypeInfoSet<TypeMirror, TypeElement, VariableElement, ExecutableElement> r = builder.link(); if(r==null) return null; if(additionalElementDecls==null) additionalElementDecls = Collections.emptyMap(); else { // fool proof check for (Map.Entry<QName, ? extends Reference> e : additionalElementDecls.entrySet()) { if(e.getKey()==null) throw new IllegalArgumentException("nulls in additionalElementDecls"); } } return new JAXBModelImpl(r, builder.reader, rootClasses, new HashMap<QName, Reference>(additionalElementDecls)); }
Example #29
Source File: JAXBContextImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #30
Source File: JavaCompilerImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public J2SJAXBModel bind( Collection<Reference> rootClasses, Map<QName,Reference> additionalElementDecls, String defaultNamespaceRemap, ProcessingEnvironment env) { ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement> builder = new ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement>( InlineAnnotationReaderImpl.theInstance, new ApNavigator(env), Collections.<TypeElement, TypeElement>emptyMap(), defaultNamespaceRemap ); builder.setErrorHandler(new ErrorHandlerImpl(env.getMessager())); for ( Reference ref : rootClasses ) { TypeMirror t = ref.type; XmlJavaTypeAdapter xjta = ref.annotations.getAnnotation(XmlJavaTypeAdapter.class); XmlList xl = ref.annotations.getAnnotation(XmlList.class); builder.getTypeInfo(new Ref<TypeMirror, TypeElement>(builder, t, xjta, xl)); } TypeInfoSet<TypeMirror, TypeElement, VariableElement, ExecutableElement> r = builder.link(); if(r==null) return null; if(additionalElementDecls==null) additionalElementDecls = Collections.emptyMap(); else { // fool proof check for (Map.Entry<QName, ? extends Reference> e : additionalElementDecls.entrySet()) { if(e.getKey()==null) throw new IllegalArgumentException("nulls in additionalElementDecls"); } } return new JAXBModelImpl(r, builder.reader, rootClasses, new HashMap<QName, Reference>(additionalElementDecls)); }