Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlElements


         {xmlElement};
      }
      else
      {
         // Mutlple elements
         XmlElements xmlElements = property.getUnderlyingAnnotation(XmlElements.class);
         if (xmlElements != null)
            elements = xmlElements.value();
      }

      // A single element not annotated
      if (elements == null || elements.length == 0)
         elements = new XmlElement[1];
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

        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

         {xmlElement};
      }
      else
      {
         // Mutlple elements
         XmlElements xmlElements = property.getUnderlyingAnnotation(XmlElements.class);
         if (xmlElements != null)
            elements = xmlElements.value();
      }

      // A single element not annotated
      if (elements == null || elements.length == 0)
         elements = new XmlElement[1];
View Full Code Here

    /* If simple type, @XmlElements and @XmlElementRefs are applicable.
     * Note: @XmlElement and @XmlElementRef are NOT handled here, since they
     * are handled specifically as non-polymorphic indication
     * of the actual type
     */
    XmlElements elems = findAnnotation(XmlElements.class, am, false, false, false);
    XmlElementRefs elemRefs = findAnnotation(XmlElementRefs.class, am, false, false, false);
    if (elems == null && elemRefs == null) {
      return null;
    }

View Full Code Here

  @Override
  public List<NamedType> findSubtypes(Annotated a)
  {
    // No package/superclass defaulting (only used with fields, methods)
    XmlElements elems = findAnnotation(XmlElements.class, a, false, false, false);
    if (elems != null) {
      ArrayList<NamedType> result = new ArrayList<NamedType>();
      for (XmlElement elem : elems.value()) {
        String name = elem.name();
        if (MARKER_FOR_DEFAULT.equals(name)) name = null;
        result.add(new NamedType(elem.type(), name));
      }
      return result;
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

        return property;
    }

    private Property buildChoiceProperty(TypeInfo info, JavaClass cls, JavaHasAnnotations javaHasAnnotations, String propertyName, JavaClass propertyType){
      ChoiceProperty property = new ChoiceProperty(helper);
        XmlElements xmlElements = (XmlElements) helper.getAnnotation(javaHasAnnotations, XmlElements.class);
        XmlElement[] elements = xmlElements.value();
        ArrayList<Property> choiceProperties = new ArrayList<Property>(elements.length);
        validateElementIsInPropOrder(info, propertyName);
        for (int i = 0; i < elements.length; i++) {
            XmlElement next = elements[i];
            Property choiceProp = new Property(helper);
View Full Code Here

        return property;
    }

    private Property buildChoiceProperty(TypeInfo info, JavaClass cls, JavaHasAnnotations javaHasAnnotations, String propertyName, JavaClass propertyType){
      ChoiceProperty property = new ChoiceProperty(helper);
        XmlElements xmlElements = (XmlElements) helper.getAnnotation(javaHasAnnotations, XmlElements.class);
        XmlElement[] elements = xmlElements.value();
        ArrayList<Property> choiceProperties = new ArrayList<Property>(elements.length);
        boolean isIdRef = helper.isAnnotationPresent(javaHasAnnotations, XmlIDREF.class);
        property.setIsXmlIdRef(isIdRef);
        validateElementIsInPropOrder(info, propertyName);
        for (int i = 0; i < elements.length; i++) {
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.