Package org.apache.myfaces.tobago.apt.generate

Examples of org.apache.myfaces.tobago.apt.generate.TagInfo


  private void createTag(ClassDeclaration declaration) {
    List<PropertyInfo> properties = new ArrayList<PropertyInfo>();
    addPropertiesForTagOnly(declaration, properties);
    TagGeneration tagGeneration = declaration.getAnnotation(TagGeneration.class);

    TagInfo tagInfo = new TagInfo(declaration.getQualifiedName(), tagGeneration.className());
    tagInfo.setSuperClass(declaration.getQualifiedName());
    StringTemplate stringTemplate = tagAbstractStringTemplateGroup.getInstanceOf("tag");
    stringTemplate.setAttribute("tagInfo", tagInfo);
    tagInfo.getProperties().addAll(properties);
    tagInfo.addImport("org.slf4j.Logger");
    tagInfo.addImport("org.slf4j.LoggerFactory");
    writeFile(tagInfo, stringTemplate);
  }
View Full Code Here


    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);
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.apt.generate.TagInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.