Package javax.xml.bind.annotation.adapters

Examples of javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters


            if (t != null) {
                addType(t);
            }
        }
        if (clazz.getPackage() != null) {
            XmlJavaTypeAdapters adapt = clazz.getPackage().getAnnotation(XmlJavaTypeAdapters.class);
            if (adapt != null) {
                for (XmlJavaTypeAdapter a: adapt.value()) {
                    globalAdapters.add(a.type());
                }
                for (XmlJavaTypeAdapter a: adapt.value()) {
                    Type t = Utils.getTypeFromXmlAdapter(a);
                    if (t != null) {
                        addType(t);
                    }
                }
View Full Code Here


        XmlJavaTypeAdapter adapter = f.getAnnotation(XmlJavaTypeAdapter.class);
        if (adapter == null) {
            adapter = f.getType().getAnnotation(XmlJavaTypeAdapter.class);
        }
        if (adapter == null) {
            XmlJavaTypeAdapters adapters = f.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
            if (adapters != null) {
                for (XmlJavaTypeAdapter candidate : adapters.value()) {
                    if (candidate != null && candidate.type().equals(f.getType())) {
                        adapter = candidate;
                        break;
                    }
                }
View Full Code Here

        XmlJavaTypeAdapter adapter = m.getAnnotation(XmlJavaTypeAdapter.class);
        if (adapter == null) {
            adapter = m.getReturnType().getAnnotation(XmlJavaTypeAdapter.class);
        }
        if (adapter == null) {
            XmlJavaTypeAdapters adapters = m.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
            if (adapters != null) {
                for (XmlJavaTypeAdapter candidate : adapters.value()) {
                    if (candidate != null && candidate.type().equals(m.getGenericReturnType())) {
                        adapter = candidate;
                        break;
                    }
                }
View Full Code Here

            if (t != null) {
                addType(t);
            }
        }
        if (clazz.getPackage() != null) {
            XmlJavaTypeAdapters adapt = clazz.getPackage().getAnnotation(XmlJavaTypeAdapters.class);
            if (adapt != null) {
                for (XmlJavaTypeAdapter a : adapt.value()) {
                    globalAdapters.add(a.type());
                }
                for (XmlJavaTypeAdapter a : adapt.value()) {
                    Type t = Utils.getTypeFromXmlAdapter(a);
                    if (t != null) {
                        addType(t);
                    }
                }
View Full Code Here

            if (t != null) {
                addType(t);
            }
        }
        if (clazz.getPackage() != null) {
            XmlJavaTypeAdapters adapt = clazz.getPackage().getAnnotation(XmlJavaTypeAdapters.class);
            if (adapt != null) {
                for (XmlJavaTypeAdapter a : adapt.value()) {
                    globalAdapters.add(a.type());
                }
                for (XmlJavaTypeAdapter a : adapt.value()) {
                    Type t = Utils.getTypeFromXmlAdapter(a);
                    if (t != null) {
                        addType(t);
                    }
                }
View Full Code Here

    if (adaptersOfPackage == null) {
      adaptersOfPackage = new HashMap<String, XmlJavaTypeAdapter>();
      ADAPTERS_BY_PACKAGE.put(pckg.getQualifiedName(), adaptersOfPackage);

      XmlJavaTypeAdapter javaType = pckg.getAnnotation(XmlJavaTypeAdapter.class);
      XmlJavaTypeAdapters javaTypes = pckg.getAnnotation(XmlJavaTypeAdapters.class);

      if ((javaType != null) || (javaTypes != null)) {
        ArrayList<XmlJavaTypeAdapter> allAdaptedTypes = new ArrayList<XmlJavaTypeAdapter>();
        if (javaType != null) {
          allAdaptedTypes.add(javaType);
        }

        if (javaTypes != null) {
          allAdaptedTypes.addAll(Arrays.asList(javaTypes.value()));
        }

        for (XmlJavaTypeAdapter adaptedTypeInfo : allAdaptedTypes) {
          String typeFqn;
View Full Code Here

     * @param info
     */
    private void processPackageLevelAdapters(JavaClass javaClass, TypeInfo info) {
        JavaPackage pack = javaClass.getPackage();
        if (helper.isAnnotationPresent(pack, XmlJavaTypeAdapters.class)) {
            XmlJavaTypeAdapters adapters = (XmlJavaTypeAdapters) helper.getAnnotation(pack, XmlJavaTypeAdapters.class);
            XmlJavaTypeAdapter[] adapterArray = adapters.value();
            for (XmlJavaTypeAdapter next : adapterArray) {
                processPackageLevelAdapter(next, info);
            }
        }
       
View Full Code Here

      XmlJavaTypeAdapter possibleAdapterInfo = pckg.getAnnotation(XmlJavaTypeAdapter.class);
      if ((possibleAdapterInfo != null) && (returnType.equals(possibleAdapterInfo.type()))) {
        adapterInfo = possibleAdapterInfo;
      }
      else if (pckg.isAnnotationPresent(XmlJavaTypeAdapters.class)) {
        XmlJavaTypeAdapters adapters = pckg.getAnnotation(XmlJavaTypeAdapters.class);
        for (XmlJavaTypeAdapter possibility : adapters.value()) {
          if (returnType.equals(possibility.type())) {
            adapterInfo = possibility;
          }
        }
      }
View Full Code Here

      XmlJavaTypeAdapter possibleAdapterInfo = pckg.getAnnotation(XmlJavaTypeAdapter.class);
      if ((possibleAdapterInfo != null) && (propertyType.equals(possibleAdapterInfo.type()))) {
        adapterInfo = possibleAdapterInfo;
      }
      else if (pckg.isAnnotationPresent(XmlJavaTypeAdapters.class)) {
        XmlJavaTypeAdapters adapters = pckg.getAnnotation(XmlJavaTypeAdapters.class);
        for (XmlJavaTypeAdapter possibility : adapters.value()) {
          if (propertyType.equals(possibility.type())) {
            adapterInfo = possibility;
          }
        }
      }
View Full Code Here

      XmlJavaTypeAdapter possibleAdapterInfo = pckg.getAnnotation(XmlJavaTypeAdapter.class);
      if ((possibleAdapterInfo != null) && (returnType.equals(possibleAdapterInfo.type()))) {
        adapterInfo = possibleAdapterInfo;
      }
      else if (pckg.isAnnotationPresent(XmlJavaTypeAdapters.class)) {
        XmlJavaTypeAdapters adapters = pckg.getAnnotation(XmlJavaTypeAdapters.class);
        for (XmlJavaTypeAdapter possibility : adapters.value()) {
          if (returnType.equals(possibility.type())) {
            adapterInfo = possibility;
          }
        }
      }
View Full Code Here

TOP

Related Classes of javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters

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.