beanClass = (WrapperBeanClass) clz;
} else {
throw new RuntimeException("WrapperBeanAnnotator expect JavaClass as input");
}
JAnnotation xmlRootElement = new JAnnotation(XmlRootElement.class);
xmlRootElement.addElement(new JAnnotationElement("name",
beanClass.getElementName().getLocalPart()));
xmlRootElement.addElement(new JAnnotationElement("namespace",
beanClass.getElementName().getNamespaceURI()));
JAnnotation xmlAccessorType = new JAnnotation(XmlAccessorType.class);
xmlAccessorType.addElement(new JAnnotationElement(null, XmlAccessType.FIELD));
JAnnotation xmlType = new JAnnotation(XmlType.class);
xmlType.addElement(new JAnnotationElement("name",
beanClass.getElementName().getLocalPart()));
xmlType.addElement(new JAnnotationElement("namespace",
beanClass.getElementName().getNamespaceURI()));
List<String> props = new ArrayList<String>();
for (JavaField f : beanClass.getFields()) {
props.add(f.getParaName());
}
if (props.size() > 1) {
xmlType.addElement(new JAnnotationElement("propOrder",
props));
}
// Revisit: why annotation is string?
beanClass.addAnnotation(xmlRootElement);