Package javax.xml.bind.annotation.adapters

Examples of javax.xml.bind.annotation.adapters.XmlAdapter.unmarshal()


    @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);
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    static void setMethodValue(Method getter, Method setter, Object target, Object value) throws Exception {
        XmlJavaTypeAdapter xjta = getMethodXJTA(getter);
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);
    }

    @SuppressWarnings("rawtypes")
    static XmlAdapter getXmlAdapter(XmlJavaTypeAdapter adapterAnnotation)
        throws InstantiationException, IllegalAccessException {
View Full Code Here

    @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);
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    static void setMethodValue(Method getter, Method setter, Object target, Object value) throws Exception {
        XmlJavaTypeAdapter xjta = getMethodXJTA(getter);
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);
    }

    @SuppressWarnings("rawtypes")
    static XmlAdapter getXmlAdapter(XmlJavaTypeAdapter adapterAnnotation)
        throws InstantiationException, IllegalAccessException {
View Full Code Here

        // try to run the adapter now rather than later.
        if(cons instanceof JStringLiteral && atype!=null) {
            JStringLiteral scons = (JStringLiteral) cons;
            XmlAdapter a = ClassFactory.create(atype);
            try {
                Object value = a.unmarshal(scons.str);
                if(value instanceof String) {
                    return JExpr.lit((String)value);
                }
            } catch (Exception e) {
                // assume that we can't eagerly bind this
View Full Code Here

            try {
                XmlAdapter xmlAdapter = typeAdapter.value().newInstance();
                if (marshal) {
                    return xmlAdapter.marshal(obj);
                } else {
                    return xmlAdapter.unmarshal(obj);
                }
            } catch (Exception ex) {
                LOG.warning("Problem using the XmlJavaTypeAdapter");
                ex.printStackTrace();
            }
View Full Code Here

            try {
                XmlAdapter xmlAdapter = typeAdapter.value().newInstance();
                if (marshal) {
                    return xmlAdapter.marshal(obj);
                } else {
                    return xmlAdapter.unmarshal(obj);
                }
            } catch (Exception ex) {
                LOG.warning("Problem using the XmlJavaTypeAdapter");
                ex.printStackTrace();
            }
View Full Code Here

/*     */
/*     */   public void set(BeanT bean, OnWireValueT o) throws AccessorException
/*     */   {
/*  79 */     XmlAdapter a = getAdapter();
/*     */     try {
/*  81 */       this.core.set(bean, a.unmarshal(o));
/*     */     } catch (Exception e) {
/*  83 */       throw new AccessorException(e);
/*     */     }
/*     */   }
/*     */
View Full Code Here

/*     */   private InMemory adaptU(Unmarshaller _u, OnWire v) throws JAXBException { UnmarshallerImpl u = (UnmarshallerImpl)_u;
/* 145 */     XmlAdapter a = u.coordinator.getAdapter(this.adapter);
/* 146 */     u.coordinator.setThreadAffinity();
/* 147 */     u.coordinator.pushCoordinator();
/*     */     try {
/* 149 */       Object localObject1 = a.unmarshal(v);
/*     */       return localObject1;
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 151 */       throw new UnmarshalException(e);
View Full Code Here

        // try to run the adapter now rather than later.
        if(cons instanceof JStringLiteral && atype!=null) {
            JStringLiteral scons = (JStringLiteral) cons;
            XmlAdapter a = ClassFactory.create(atype);
            try {
                Object value = a.unmarshal(scons.str);
                if(value instanceof String) {
                    return JExpr.lit((String)value);
                }
            } catch (Exception e) {
                // assume that we can't eagerly bind this
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.