use of com.sun.xml.txw2.annotation.XmlValue in project jaxb-ri by eclipse-ee4j.
the class ContainerElement method invoke.
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (method.getDeclaringClass() == TypedXmlWriter.class || method.getDeclaringClass() == Object.class) {
// forward to myself
try {
return method.invoke(this, args);
} catch (InvocationTargetException e) {
throw e.getTargetException();
}
}
XmlAttribute xa = method.getAnnotation(XmlAttribute.class);
XmlValue xv = method.getAnnotation(XmlValue.class);
XmlElement xe = method.getAnnotation(XmlElement.class);
if (xa != null) {
if (xv != null || xe != null)
throw new IllegalAnnotationException(method.toString());
addAttribute(xa, method, args);
// allow method chaining
return proxy;
}
if (xv != null) {
if (xe != null)
throw new IllegalAnnotationException(method.toString());
_pcdata(args);
// allow method chaining
return proxy;
}
return addElement(xe, method, args);
}
Aggregations