}
protected void appendTag(
final TypeElement typeElement, final Element parent, final Document document, final Type type)
throws ClassNotFoundException {
final 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);
final 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) {
final Element deprecatedTag = createTag(typeElement, annotationTag, className, document, true, type);
addAttributes(typeElement, deprecatedTag, document, type);
parent.appendChild(deprecatedTag);
}
}