}
}
protected void appendTag(TypeElement typeElement, Element parent, Document document, Type type)
throws ClassNotFoundException {
Tag annotationTag = typeElement.getAnnotation(Tag.class);
if (annotationTag != null) {
checkDuplicates(annotationTag.name());
resetAttributeDuplicateList();
// TODO configure replacement
final String className;
if (typeElement.getAnnotation(SimpleTag.class) != null || typeElement.getAnnotation(ValidatorTag.class) != null) {
className = AnnotationUtils.generatedTagName(typeElement);
} else if (typeElement.getAnnotation(ExtensionTag.class) != null) {
className = typeElement.getQualifiedName().toString();
} else if (typeElement.getAnnotation(UIComponentTag.class) != null) {
className = "org.apache.myfaces.tobago.internal.taglib." + StringUtils.capitalize(annotationTag.name())
+ "Tag";
} else {
throw new RuntimeException("Not supported: " + typeElement.getQualifiedName());
}
info("Replacing: " + typeElement.getQualifiedName() + " -> " + className);
Element tag = createTag(typeElement, annotationTag, className, document, false, type);
addAttributes(typeElement, tag, document, type);
parent.appendChild(tag);
if (annotationTag.deprecatedName() != null && annotationTag.deprecatedName().length() > 0) {
Element deprecatedTag = createTag(typeElement, annotationTag, className, document, true, type);
addAttributes(typeElement, deprecatedTag, document, type);
parent.appendChild(deprecatedTag);
}
}