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


         {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

        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

        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

         {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

            return true;
        }


        private boolean checkIfParentChildRelationIsPossible(Class srcClass, Class targetClass) {
            XmlElements targetClassAnnotation = (XmlElements) getFieldAnnotation(targetClass, XmlElements.class);
            if (targetClassAnnotation == null) {
                return false;
            }
            for (XmlElement xe : targetClassAnnotation.value()) {
                if (srcClass.isAssignableFrom(xe.type())) {
                    return true;
                }
            }
            return false;
View Full Code Here

/*      */     {
/* 1441 */       elements = new XmlElement[] { xmlElement };
/*      */     }
/*      */     else
/*      */     {
/* 1447 */       XmlElements xmlElements = (XmlElements)property.getUnderlyingAnnotation(XmlElements.class);
/* 1448 */       if (xmlElements != null) {
/* 1449 */         elements = xmlElements.value();
/*      */       }
/*      */     }
/*      */
/* 1453 */     if ((elements == null) || (elements.length == 0)) {
/* 1454 */       elements = new XmlElement[1];
View Full Code Here

    }

    public XmlElement[] xmlElements(Property p) {
        FieldProperty<T> fp = field(p.name());
        if (fp != null) {
            XmlElements ann = fp.getField().getAnnotation(XmlElements.class);
            if (ann != null) {
                return ann.value();
            } else {
                return new XmlElement[0];
            }
        } else {
            return new XmlElement[0];
View Full Code Here

/* 103 */     if (this.types == null) {
/* 104 */       this.types = new FinalArrayList();
/* 105 */       XmlElement[] ann = null;
/*     */
/* 107 */       XmlElement xe = (XmlElement)this.seed.readAnnotation(XmlElement.class);
/* 108 */       XmlElements xes = (XmlElements)this.seed.readAnnotation(XmlElements.class);
/*     */
/* 110 */       if ((xe != null) && (xes != null)) {
/* 111 */         this.parent.builder.reportError(new IllegalAnnotationException(Messages.MUTUALLY_EXCLUSIVE_ANNOTATIONS.format(new Object[] { nav().getClassName(this.parent.getClazz()) + '#' + this.seed.getName(), xe.annotationType().getName(), xes.annotationType().getName() }), xe, xes));
/*     */       }
/*     */
/* 118 */       this.isRequired = Boolean.valueOf(true);
/*     */
/* 120 */       if (xe != null) {
/* 121 */         ann = new XmlElement[] { xe };
/*     */       }
/* 123 */       else if (xes != null) {
/* 124 */         ann = xes.value();
/*     */       }
/* 126 */       if (ann == null)
/*     */       {
/* 128 */         Object t = getIndividualType();
/* 129 */         if ((!nav().isPrimitive(t)) || (isCollection())) {
View Full Code Here

         elements = new XmlElement[]{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

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.