use of org.apache.cxf.common.jaxb.JAXBContextProxy in project tomee by apache.
the class JAXBDataBinding method checkForJAXBAnnotations.
private void checkForJAXBAnnotations(MessagePartInfo mpi, SchemaCollection schemaCollection, String ns) {
Annotation[] anns = (Annotation[]) mpi.getProperty("parameter.annotations");
JAXBContextProxy ctx = JAXBUtils.createJAXBContextProxy(context, schemaCollection, ns);
XmlJavaTypeAdapter jta = JAXBSchemaInitializer.findFromTypeAdapter(ctx, mpi.getTypeClass(), anns);
if (jta != null) {
JAXBBeanInfo jtaBeanInfo = JAXBSchemaInitializer.findFromTypeAdapter(ctx, jta.value());
JAXBBeanInfo beanInfo = JAXBSchemaInitializer.getBeanInfo(ctx, mpi.getTypeClass());
if (jtaBeanInfo != beanInfo) {
mpi.setProperty("parameter.annotations", anns);
mpi.setProperty("honor.jaxb.annotations", Boolean.TRUE);
}
}
}
use of org.apache.cxf.common.jaxb.JAXBContextProxy in project cxf by apache.
the class JAXBDataBinding method checkForJAXBAnnotations.
private void checkForJAXBAnnotations(MessagePartInfo mpi, SchemaCollection schemaCollection, String ns) {
Annotation[] anns = (Annotation[]) mpi.getProperty("parameter.annotations");
JAXBContextProxy ctx = JAXBUtils.createJAXBContextProxy(context, schemaCollection, ns);
XmlJavaTypeAdapter jta = JAXBSchemaInitializer.findFromTypeAdapter(ctx, mpi.getTypeClass(), anns);
if (jta != null) {
JAXBBeanInfo jtaBeanInfo = JAXBSchemaInitializer.findFromTypeAdapter(ctx, jta.value());
JAXBBeanInfo beanInfo = JAXBSchemaInitializer.getBeanInfo(ctx, mpi.getTypeClass());
if (jtaBeanInfo != beanInfo) {
mpi.setProperty("parameter.annotations", anns);
mpi.setProperty("honor.jaxb.annotations", Boolean.TRUE);
}
}
}
Aggregations