use of javax.xml.bind.annotation.adapters.XmlAdapter in project cxf by apache.
the class Utils method getMethodValue.
@SuppressWarnings({ "rawtypes", "unchecked" })
static Object getMethodValue(Method m, Object target) throws Exception {
XmlJavaTypeAdapter adapterAnnotation = getMethodXJTA(m);
XmlAdapter adapter = getXmlAdapter(adapterAnnotation);
return adapter != null ? adapter.marshal(m.invoke(target)) : m.invoke(target);
}
use of javax.xml.bind.annotation.adapters.XmlAdapter in project cxf by apache.
the class Utils method setFieldValue.
@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);
}
use of javax.xml.bind.annotation.adapters.XmlAdapter in project cxf by apache.
the class Utils method setMethodValue.
@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);
}
use of javax.xml.bind.annotation.adapters.XmlAdapter in project ddf by codice.
the class TestXmlParserConfigurator method setup.
@Before
public void setup() {
pc = new XmlParserConfigurator();
testHandler = new ValidationEventHandler() {
@Override
public boolean handleEvent(ValidationEvent event) {
return false;
}
};
testAdapter = new XmlAdapter() {
@Override
public Object unmarshal(Object v) throws Exception {
return null;
}
@Override
public Object marshal(Object v) throws Exception {
return null;
}
};
}
use of javax.xml.bind.annotation.adapters.XmlAdapter in project cxf by apache.
the class Utils method getFieldValue.
@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);
}
Aggregations