Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlAccessorType


   private AccessorFactory getAccessorFactory(Class faultBean)
   {
      // This should catch all cases due to the constraints that JAX-WS puts on the fault bean
      // However, if issues arrise then switch this to a full jaxb reflection library
      XmlAccessorType type = (XmlAccessorType)faultBean.getAnnotation(XmlAccessorType.class);
      if (type != null && type.value() == XmlAccessType.FIELD)
         return new ReflectiveFieldAccessorFactoryCreator().create(this);

      return new ReflectiveMethodAccessorFactoryCreator().create(this);
   }
View Full Code Here


     * @param packageNamespace
     */
    private void preProcessXmlAccessorType(JavaClass javaClass, TypeInfo info, NamespaceInfo packageNamespace) {
        org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType xmlAccessType;
        if (javaClass.getDeclaredAnnotation(helper.getJavaClass(XmlAccessorType.class)) != null) {
            XmlAccessorType accessorType = (XmlAccessorType) helper.getAnnotation(javaClass, XmlAccessorType.class);
            xmlAccessType = org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType.fromValue(accessorType.value().name());
            info.setXmlAccessType(xmlAccessType);
        }
    }
View Full Code Here

            // if it's still null, generate based on package name
            if (namespaceInfo.getNamespace() == null) {
                namespaceInfo.setNamespace(EMPTY_STRING);
            }
            if (helper.isAnnotationPresent(pack, XmlAccessorType.class)) {
                XmlAccessorType xmlAccessorType = (XmlAccessorType) helper.getAnnotation(pack, XmlAccessorType.class);
                packageInfo.setAccessType(XmlAccessType.fromValue(xmlAccessorType.value().name()));
            }
            if (helper.isAnnotationPresent(pack, XmlAccessorOrder.class)) {
                XmlAccessorOrder xmlAccessorOrder = (XmlAccessorOrder) helper.getAnnotation(pack, XmlAccessorOrder.class);
                packageInfo.setAccessOrder(XmlAccessOrder.fromValue(xmlAccessorOrder.value().name()));
            }
View Full Code Here

       
        XmlSchemaSequence seq = new XmlSchemaSequence();
        ct.setParticle(seq);
        String namespace = part.getElementQName().getNamespaceURI();
       
        XmlAccessorType accessorType = cls.getAnnotation(XmlAccessorType.class);
        if (accessorType == null && cls.getPackage() != null) {
            accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);
        }
        XmlAccessType accessType = accessorType != null ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;

       
        for (Field f : cls.getDeclaredFields()) {
            if (JAXBContextInitializer.isFieldAccepted(f, accessType)) {
                //map field
View Full Code Here

    /**
     * Computes the {@link XmlAccessType} on this class by looking at {@link XmlAccessorType}
     * annotations.
     */
    private XmlAccessType getAccessType() {
        XmlAccessorType xat = getClassOrPackageAnnotation(XmlAccessorType.class);
        if(xat!=null)
            return xat.value();
        else
            return XmlAccessType.PUBLIC_MEMBER;
    }
View Full Code Here

    /**
     * Computes the {@link XmlAccessType} on this class by looking at {@link XmlAccessorType}
     * annotations.
     */
    private XmlAccessType getAccessType() {
        XmlAccessorType xat = getClassOrPackageAnnotation(XmlAccessorType.class);
        if(xat!=null)
            return xat.value();
        else
            return XmlAccessType.PUBLIC_MEMBER;
    }
View Full Code Here

        //EXACT classes in the fields/methods if they are in a different package. Thus,
        //subclasses won't be found and the xsi:type stuff won't work at all.
        //We'll grab the public field/method types and then add the ObjectFactory stuff
        //as well as look for jaxb.index files in those packages.

        XmlAccessorType accessorType = cls.getAnnotation(XmlAccessorType.class);
        if (accessorType == null && cls.getPackage() != null) {
            accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);
        }
        XmlAccessType accessType = accessorType != null ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;

        if (accessType != XmlAccessType.PROPERTY) {   // only look for fields if we are instructed to
            //fields are accessible even if not public, must look at the declared fields
            //then walk to parents declared fields, etc...
            Field fields[] = cls.getDeclaredFields();
View Full Code Here

   * its ancestors (in JAXB sense, package etc). Returns null if
   * nothing has been explicitly defined.
   */
  protected XmlAccessType findAccessType(Annotated ac)
  {
    XmlAccessorType at = findAnnotation(XmlAccessorType.class, ac, true, true, true);
    return (at == null) ? null : at.value();
  }
View Full Code Here

      if (isHandled(annotation)) {
        return true;
      }
    }
    XmlAccessType accessType = XmlAccessType.PUBLIC_MEMBER;
    XmlAccessorType at = findAnnotation(XmlAccessorType.class, f, true, true, true);
    if (at != null) {
      accessType = at.value();
    }
    if (accessType == XmlAccessType.FIELD) {
      return true;
    }
    if (accessType == XmlAccessType.PUBLIC_MEMBER) {
View Full Code Here

      if (isHandled(annotation)) {
        return true;
      }
    }
    XmlAccessType accessType = XmlAccessType.PUBLIC_MEMBER;
    XmlAccessorType at = findAnnotation(XmlAccessorType.class, m, true, true, true);
    if (at != null) {
      accessType = at.value();
    }
    if (accessType == XmlAccessType.PROPERTY || accessType == XmlAccessType.PUBLIC_MEMBER) {
      return Modifier.isPublic(m.getModifiers());
    }
    return false;
View Full Code Here

TOP

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

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.