Tag tag = declaration.getAnnotation(Tag.class);
Map<String, PropertyInfo> properties = new HashMap<String, PropertyInfo>();
addProperties(declaration, properties);
if (tag != null) {
String className = "org.apache.myfaces.tobago.internal.taglib." + StringUtils.capitalize(tag.name()) + "Tag";
TagInfo tagInfo = new TagInfo(declaration.getQualifiedName(), className, componentTag.rendererType());
for (PropertyInfo property : properties.values()) {
if (property.isTagAttribute()) {
tagInfo.getProperties().add(property);
}
}
if (isUnifiedEL()) {
tagInfo.setSuperClass("org.apache.myfaces.tobago.internal.taglib.TobagoELTag");
} else {
if (tagInfo.getBodyContent() != null) {
tagInfo.setSuperClass("org.apache.myfaces.tobago.internal.taglib.TobagoBodyTag");
} else {
tagInfo.setSuperClass("org.apache.myfaces.tobago.internal.taglib.TobagoTag");
}
}
tagInfo.setComponentClassName(componentTag.uiComponent());
tagInfo.addImport("org.apache.commons.lang.StringUtils");
tagInfo.addImport("org.slf4j.Logger");
tagInfo.addImport("org.slf4j.LoggerFactory");
tagInfo.addImport("javax.faces.application.Application");
tagInfo.addImport("javax.faces.component.UIComponent");
tagInfo.addImport("javax.faces.context.FacesContext");
StringTemplate stringTemplate = tagStringTemplateGroup.getInstanceOf("tag");
stringTemplate.setAttribute("tagInfo", tagInfo);
writeFile(tagInfo, stringTemplate);
}