Package javax.xml.bind.annotation.adapters

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


    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    static void setFieldValue(Field f, Object target, Object value) throws Exception {
        XmlJavaTypeAdapter xjta = getFieldXJTA(f);
        XmlAdapter adapter = getXmlAdapter(xjta);
        f.set(target, adapter != null ? adapter.unmarshal(value) : value);
    }
View Full Code Here


    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    static void setMethodValue(Method getter, Method setter, Object target, Object value) throws Exception {
        XmlJavaTypeAdapter xjta = getMethodXJTA(getter);
        XmlAdapter adapter = getXmlAdapter(xjta);
        setter.invoke(target, adapter != null ? adapter.unmarshal(value) : value);
    }
View Full Code Here

                XmlJavaTypeAdapters adapters = pkg.getAnnotation(XmlJavaTypeAdapters.class);
                if (adapters != null) {
                    CustomSerializerFactory serializerFactory = new CustomSerializerFactory();
                    CustomDeserializerFactory deserializerFactory = new CustomDeserializerFactory();
                    for (XmlJavaTypeAdapter a : adapters.value()) {
                        XmlAdapter xmlAdapter = null;
                        try {
                            xmlAdapter = a.value().newInstance();
                        } catch (Throwable e) {
                            // Ignore
                        }
View Full Code Here

                XmlJavaTypeAdapters adapters = pkg.getAnnotation(XmlJavaTypeAdapters.class);
                if (adapters != null) {
                    CustomSerializerFactory serializerFactory = new CustomSerializerFactory();
                    CustomDeserializerFactory deserializerFactory = new CustomDeserializerFactory();
                    for (XmlJavaTypeAdapter a : adapters.value()) {
                        XmlAdapter xmlAdapter = null;
                        try {
                            xmlAdapter = a.value().newInstance();
                        } catch (Throwable e) {
                            // Ignore
                        }
View Full Code Here

        if (typeAdapter != null) {
            if (InjectionUtils.isSupportedCollectionOrArray(typeAdapter.value().getClass())) {
                return obj;
            }
            try {
                @SuppressWarnings("rawtypes")
                XmlAdapter xmlAdapter = typeAdapter.value().newInstance();
                if (marshal) {
                    return xmlAdapter.marshal(obj);
                } else {
                    return xmlAdapter.unmarshal(obj);
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
View Full Code Here

    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    private static Object getFieldValue(Field f, Object target) throws Exception {
        XmlJavaTypeAdapter adapterAnnotation = JAXBContextInitializer.getFieldXJTA(f);
        XmlAdapter adapter = JAXBContextInitializer.getXmlAdapter(adapterAnnotation);
        return adapter != null ? adapter.marshal(f.get(target)) : f.get(target);
    }
View Full Code Here

    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    private static Object getMethodValue(Method m, Object target) throws Exception {
        XmlJavaTypeAdapter adapterAnnotation = JAXBContextInitializer.getMethodXJTA(m);
        XmlAdapter adapter = JAXBContextInitializer.getXmlAdapter(adapterAnnotation);
        return adapter != null ? adapter.marshal(m.invoke(target)) : m.invoke(target);
    }
View Full Code Here

    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    private static void setFieldValue(Field f, Object target, Object value) throws Exception {
        XmlJavaTypeAdapter xjta = JAXBContextInitializer.getFieldXJTA(f);
        XmlAdapter adapter = JAXBContextInitializer.getXmlAdapter(xjta);
        f.set(target, adapter != null ? adapter.unmarshal(value) : value);
    }
View Full Code Here

    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    private static void setMethodValue(Method getter, Method setter, Object target, Object value) throws Exception {
        XmlJavaTypeAdapter xjta = JAXBContextInitializer.getMethodXJTA(getter);
        XmlAdapter adapter = JAXBContextInitializer.getXmlAdapter(xjta);
        setter.invoke(target, adapter != null ? adapter.unmarshal(value) : value);
    }
View Full Code Here

    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    static Object getFieldValue(Field f, Object target) throws Exception {
        XmlJavaTypeAdapter adapterAnnotation = getFieldXJTA(f);
        XmlAdapter adapter = getXmlAdapter(adapterAnnotation);
        return adapter != null ? adapter.marshal(f.get(target)) : f.get(target);
    }
View Full Code Here

TOP

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

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.