/**
* Special for processing an @XmlElementRef verbs field (rest-dsl)
*/
private void processVerbs(RoundEnvironment roundEnv, TypeElement originalClassType, XmlElementRef elementRef,
VariableElement fieldElement, String fieldName, Set<EipOption> eipOptions, String prefix) {
Elements elementUtils = processingEnv.getElementUtils();
if ("verbs".equals(fieldName) && supportOutputs(originalClassType)) {
String kind = "element";
String name = elementRef.name();
if (isNullOrEmpty(name) || "##default".equals(name)) {
name = fieldName;
}
name = prefix + name;
TypeMirror fieldType = fieldElement.asType();
String fieldTypeName = fieldType.toString();
String docComment = findJavaDoc(elementUtils, fieldElement, fieldName, name, originalClassType, true);
// gather oneOf which extends any of the output base classes
Set<String> oneOfTypes = new TreeSet<String>();
// find all classes that has that superClassName
Set<TypeElement> children = new LinkedHashSet<TypeElement>();
for (String superclass : ONE_OF_VERBS) {
findTypeElementChildren(roundEnv, children, superclass);
}
for (TypeElement child : children) {
XmlRootElement rootElement = child.getAnnotation(XmlRootElement.class);
if (rootElement != null) {
String childName = rootElement.name();
if (childName != null) {
oneOfTypes.add(childName);
}
}
}
EipOption ep = new EipOption(name, kind, fieldTypeName, true, "", docComment, false, false, null, true, oneOfTypes);
eipOptions.add(ep);
}
}
EipAnnotationProcessor.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:Camel
作者:
评论列表
文章目录