Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlElements


        XmlTransient t = null;
        XmlAnyAttribute aa = null;
        XmlAttribute a = null;
        XmlValue v = null;
        XmlElement e1 = null;
        XmlElements e2 = null;
        XmlElementRef r1 = null;
        XmlElementRefs r2 = null;
        XmlAnyElement xae = null;
        XmlMixed mx = null;
        OverrideAnnotationOf ov = null;
View Full Code Here


        if(types==null) {
            types = new FinalArrayList<TypeRefImpl<TypeT,ClassDeclT>>();
            XmlElement[] ann=null;

            XmlElement xe = seed.readAnnotation(XmlElement.class);
            XmlElements xes = seed.readAnnotation(XmlElements.class);

            if(xe!=null && xes!=null) {
                parent.builder.reportError(new IllegalAnnotationException(
                        Messages.MUTUALLY_EXCLUSIVE_ANNOTATIONS.format(
                                nav().getClassName(parent.getClazz())+'#'+seed.getName(),
                                xe.annotationType().getName(), xes.annotationType().getName()),
                        xe, xes ));
            }

            isRequired = true;

            if(xe!=null)
                ann = new XmlElement[]{xe};
            else
            if(xes!=null)
                ann = xes.value();

            if(ann==null) {
                // default
                TypeT t = getIndividualType();
                if(!nav().isPrimitive(t) || isCollection())
View Full Code Here

      accessor.getAnnotation(XmlAttribute.class);
    XmlElement xmlElement =
      accessor.getAnnotation(XmlElement.class);
    XmlElementRef xmlElementRef =
      accessor.getAnnotation(XmlElementRef.class);
    XmlElements xmlElements =
      accessor.getAnnotation(XmlElements.class);
    XmlID xmlID =
      accessor.getAnnotation(XmlID.class);
    XmlIDREF xmlIDREF =
      accessor.getAnnotation(XmlIDREF.class);
View Full Code Here

    super(context, accessor);
   
    if (accessor.getAnnotation(XmlList.class) != null)
      throw new JAXBException(L.l("@XmlList cannot be used with @XmlElements"));

    XmlElements elements = accessor.getAnnotation(XmlElements.class);

    if (elements.value().length == 0) {
      // XXX special case : equivalent to unannotated
    }

    if (elements.value().length == 1) {
      // XXX special case : equivalent to @XmlElement
    }

    _qnameMap = new LinkedHashMap<Class,QName>();
    Map<QName,Property> qnameToPropertyMap =
      new LinkedHashMap<QName,Property>();
    Map<Class,Property> classToPropertyMap =
      new LinkedHashMap<Class,Property>();

    for (XmlElement element : elements.value()) {
      if (XmlElement.DEFAULT.class.equals(element.type()))
        throw new JAXBException(L.l("@XmlElement annotations in @XmlElements must specify a type"));

      QName qname = qnameFromXmlElement(element);
      Property property = _context.createProperty(element.type());
View Full Code Here

    else
      multiProperty = (MultiProperty) _property;

    Collection<Property> properties = multiProperty.getProperties();

    XmlElements xmlElements = _accessor.getAnnotation(XmlElements.class);
    XmlElement[] elements = xmlElements.value();

    int i = 0;

    for (Property property : properties) {
      out.writeEmptyElement(XML_SCHEMA_PREFIX, "element",
View Full Code Here

        if(types==null) {
            types = new FinalArrayList<TypeRefImpl<TypeT,ClassDeclT>>();
            XmlElement[] ann=null;

            XmlElement xe = seed.readAnnotation(XmlElement.class);
            XmlElements xes = seed.readAnnotation(XmlElements.class);

            if(xe!=null && xes!=null) {
                parent.builder.reportError(new IllegalAnnotationException(
                        Messages.MUTUALLY_EXCLUSIVE_ANNOTATIONS.format(
                                nav().getClassName(parent.getClazz())+'#'+seed.getName(),
                                xe.annotationType().getName(), xes.annotationType().getName()),
                        xe, xes ));
            }

            isRequired = true;

            if(xe!=null)
                ann = new XmlElement[]{xe};
            else
            if(xes!=null)
                ann = xes.value();

            if(ann==null) {
                // default
                TypeT t = getIndividualType();
                if(!nav().isPrimitive(t) || isCollection())
View Full Code Here

        XmlTransient t = null;
        XmlAnyAttribute aa = null;
        XmlAttribute a = null;
        XmlValue v = null;
        XmlElement e1 = null;
        XmlElements e2 = null;
        XmlElementRef r1 = null;
        XmlElementRefs r2 = null;
        XmlAnyElement xae = null;
        XmlMixed mx = null;
        OverrideAnnotationOf ov = null;
View Full Code Here

TOP

Related Classes of javax.xml.bind.annotation.XmlElements

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.