Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlElement.type()


     *  just ignore type if there is adapter annotation
     *  (we could check to see if intermediate type is compatible, but let's not yet
     *  bother)
     *
     */
    Class<?> allegedType = annotation.type();
    if (a.getAnnotation(XmlJavaTypeAdapter.class) != null) {
      return null;
    }
    return allegedType;
  }
View Full Code Here


    /* false for class, package, super-class, since annotation can
     * only be attached to fields and methods
     */
    XmlElement annotation = findAnnotation(XmlElement.class, a, false, false, false);
    if (annotation != null) {
      Class<?> type = annotation.type();
      if (type != XmlElement.DEFAULT.class) {
        return type;
      }
    }
    /* 16-Feb-2010, tatu: May also have annotation associated with field, not method
View Full Code Here

     *    itself... and findAnnotation() won't find that (nor property descriptor)
     */
    if ((a instanceof AnnotatedMethod) && propName != null) {
      AnnotatedMethod am = (AnnotatedMethod) a;
      annotation = this.findFieldAnnotation(XmlElement.class, am.getDeclaringClass(), propName);
      if (annotation != null && annotation.type() != XmlElement.DEFAULT.class) {
        return annotation.type();
      }
    }
    return null;
  }
View Full Code Here

     */
    if ((a instanceof AnnotatedMethod) && propName != null) {
      AnnotatedMethod am = (AnnotatedMethod) a;
      annotation = this.findFieldAnnotation(XmlElement.class, am.getDeclaringClass(), propName);
      if (annotation != null && annotation.type() != XmlElement.DEFAULT.class) {
        return annotation.type();
      }
    }
    return null;
  }

View Full Code Here

                        java.lang.annotation.Annotation nextAnnotation = annotations[j];

                        if (nextAnnotation != null) {
                            if (nextAnnotation instanceof XmlElement) {
                                XmlElement javaAnnotation = (XmlElement) nextAnnotation;
                                if (javaAnnotation.type() != XmlElement.DEFAULT.class) {
                                    xmlElementType = javaAnnotation.type();
                                }
                            }
                        }
                    }
View Full Code Here

                        if (nextAnnotation != null) {
                            if (nextAnnotation instanceof XmlElement) {
                                XmlElement javaAnnotation = (XmlElement) nextAnnotation;
                                if (javaAnnotation.type() != XmlElement.DEFAULT.class) {
                                    xmlElementType = javaAnnotation.type();
                                }
                            }
                        }
                    }
                }
View Full Code Here

    private void processXmlElement(Property property, TypeInfo info) {
        if (helper.isAnnotationPresent(property.getElement(), XmlElement.class)) {
            XmlElement element = (XmlElement) helper.getAnnotation(property.getElement(), XmlElement.class);
            property.setIsRequired(element.required());
            property.setNillable(element.nillable());
            if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
                property.setOriginalType(property.getType());
                if (isCollectionType(property.getType())) {
                    property.setGenericType(helper.getJavaClass(element.type()));
                } else {
                    property.setType(helper.getJavaClass(element.type()));
View Full Code Here

            property.setIsRequired(element.required());
            property.setNillable(element.nillable());
            if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
                property.setOriginalType(property.getType());
                if (isCollectionType(property.getType())) {
                    property.setGenericType(helper.getJavaClass(element.type()));
                } else {
                    property.setType(helper.getJavaClass(element.type()));
                }
                property.setHasXmlElementType(true);
            }
View Full Code Here

            if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
                property.setOriginalType(property.getType());
                if (isCollectionType(property.getType())) {
                    property.setGenericType(helper.getJavaClass(element.type()));
                } else {
                    property.setType(helper.getJavaClass(element.type()));
                }
                property.setHasXmlElementType(true);
            }
            // handle default value
            if (!element.defaultValue().equals(ELEMENT_DECL_DEFAULT)) {
View Full Code Here

            xmlElement.setDefaultValue(next.defaultValue());
            xmlElement.setName(next.name());
            xmlElement.setNamespace(next.namespace());
            xmlElement.setNillable(next.nillable());
            xmlElement.setRequired(next.required());
            xmlElement.setType(next.type().getName());
            xmlElements.getXmlElement().add(xmlElement);
        }
        choiceProperty.setXmlElements(xmlElements);

        // handle XmlElementsJoinNodes
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.