类javax.xml.bind.annotation.XmlList源码实例Demo

下面列出了怎么用javax.xml.bind.annotation.XmlList的API类实例代码及写法,或者点击链接到github查看源代码。

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
        ));
    }
}
 
源代码2 项目: jdk8u60   文件: SingleTypePropertyInfoImpl.java
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
        ));
    }
}
 
源代码3 项目: jdk8u60   文件: TypeAndAnnotationImpl.java
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);
}
 
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
        ));
    }
}
 
源代码5 项目: openjdk-jdk8u   文件: TypeAndAnnotationImpl.java
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);
}
 
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
        ));
    }
}
 
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);
}
 
源代码8 项目: openjdk-jdk9   文件: TypeAndAnnotationImpl.java
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);
}
 
源代码9 项目: openjdk-jdk9   文件: SingleTypePropertyInfoImpl.java
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
        ));
    }
}
 
源代码10 项目: hottub   文件: SingleTypePropertyInfoImpl.java
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
        ));
    }
}
 
源代码11 项目: hottub   文件: TypeAndAnnotationImpl.java
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);
}
 
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
        ));
    }
}
 
源代码13 项目: openjdk-8-source   文件: TypeAndAnnotationImpl.java
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);
}
 
源代码14 项目: openjdk-8   文件: SingleTypePropertyInfoImpl.java
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
        ));
    }
}
 
源代码15 项目: openjdk-8   文件: TypeAndAnnotationImpl.java
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);
}
 
源代码16 项目: TencentKona-8   文件: ElementPropertyInfoImpl.java
ElementPropertyInfoImpl(
    ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> parent,
    PropertySeed<TypeT,ClassDeclT,FieldT,MethodT> propertySeed) {
    super(parent, propertySeed);

    isValueList = seed.hasAnnotation(XmlList.class);

}
 
源代码17 项目: TencentKona-8   文件: Ref.java
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;
}
 
源代码18 项目: TencentKona-8   文件: JAXBContextImpl.java
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);
}
 
源代码19 项目: openjdk-8   文件: JAXBModelImpl.java
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);
}
 
源代码20 项目: TencentKona-8   文件: JavaCompilerImpl.java
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));
}
 
源代码21 项目: TencentKona-8   文件: JAXBModelImpl.java
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);
}
 
源代码22 项目: jdk8u60   文件: ElementPropertyInfoImpl.java
ElementPropertyInfoImpl(
    ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> parent,
    PropertySeed<TypeT,ClassDeclT,FieldT,MethodT> propertySeed) {
    super(parent, propertySeed);

    isValueList = seed.hasAnnotation(XmlList.class);

}
 
源代码23 项目: jdk8u60   文件: Ref.java
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;
}
 
源代码24 项目: jdk8u60   文件: JAXBContextImpl.java
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);
}
 
源代码25 项目: jdk8u60   文件: JavaCompilerImpl.java
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));
}
 
源代码26 项目: jdk8u60   文件: JAXBModelImpl.java
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);
}
 
源代码27 项目: openjdk-jdk8u   文件: ElementPropertyInfoImpl.java
ElementPropertyInfoImpl(
    ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> parent,
    PropertySeed<TypeT,ClassDeclT,FieldT,MethodT> propertySeed) {
    super(parent, propertySeed);

    isValueList = seed.hasAnnotation(XmlList.class);

}
 
源代码28 项目: openjdk-jdk8u   文件: Ref.java
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;
}
 
源代码29 项目: openjdk-jdk8u   文件: JAXBContextImpl.java
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);
}
 
源代码30 项目: openjdk-jdk8u   文件: JavaCompilerImpl.java
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));
}
 
 同包方法