Package org.apache.myfaces.tobago.apt.annotation

Examples of org.apache.myfaces.tobago.apt.annotation.Tag


      parent.appendChild(deprecatedTag);
    }
  }

  protected void appendTag(InterfaceDeclaration decl, Element parent, Document document) {
    Tag annotationTag = decl.getAnnotation(Tag.class);
    if (annotationTag != null) {
      checkDuplicates(annotationTag.name());
      resetAttributeDuplicateList();
      // TODO configure replacement

      String className =
          decl.getQualifiedName().substring(0, decl.getQualifiedName().length() - "Declaration".length());
      if (decl.getAnnotation(UIComponentTag.class) != null) {
        className = "org.apache.myfaces.tobago.internal.taglib." + StringUtils.capitalize(annotationTag.name()) + "Tag";
      }
      //decl.getQualifiedName().replaceAll("Declaration", "");
      String msg = "Replacing: " + decl.getQualifiedName() + " -> " + className;
      getEnv().getMessager().printNotice(msg);
      Element tag = createTag(decl, annotationTag, className, document, false);
      addAttributes(decl, tag, document);
      parent.appendChild(tag);
      if (annotationTag.deprecatedName() != null&&annotationTag.deprecatedName().length() > 0) {
        Element deprecatedTag = createTag(decl, annotationTag, className, document, true);
        addAttributes(decl, deprecatedTag, document);
        parent.appendChild(deprecatedTag);
      }
    }
View Full Code Here


    if (deprecatedAnnotation != null || deprecationComment != null) {
      description.append("<p>**** @deprecated. Will be removed in a future version **** </p>");
    }
    if (deprecated) {
      Tag annotationTag = decl.getAnnotation(Tag.class);
      description.append("<p>**** @deprecated. Will be removed in a future version. Use ");
      description.append(annotationTag.name());
      description.append(" instead. **** </p>");
    }
    if (deprecationComment != null) {
      description.append("<p>" + deprecationComment + "</p>");
    }
View Full Code Here

    writeFile(tagInfo, stringTemplate);
  }

  private void createTagOrComponent(InterfaceDeclaration declaration) {
    UIComponentTag componentTag = declaration.getAnnotation(UIComponentTag.class);
    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);
        }
View Full Code Here

      IOUtils.closeQuietly(writer);
    }
  }

  protected void appendTag(ClassDeclaration declaration, String taglib, Element parent, Document document) {
    Tag annotationTag = declaration.getAnnotation(Tag.class);
    checkDuplicates(annotationTag.name());
    if (declaration.getAnnotation(Deprecated.class) != null) {
      addTag(taglib, parent, annotationTag.name(), document);
    }
    addAttributes(declaration, taglib, parent, annotationTag.name(), document);
    if (StringUtils.isNotEmpty(annotationTag.deprecatedName())) {
      addTag(taglib, parent, annotationTag.deprecatedName(), document);
      addAttributes(declaration, taglib, parent, annotationTag.deprecatedName(), document);
    }
  }
View Full Code Here

      addAttributes(declaration, taglib, parent, annotationTag.deprecatedName(), document);
    }
  }

  protected void appendTag(InterfaceDeclaration declaration, String taglib, Element parent, Document document) {
    Tag annotationTag = declaration.getAnnotation(Tag.class);
    if (annotationTag != null) {
      checkDuplicates(annotationTag.name());
      // TODO configure replacement

      String className =
          declaration.getQualifiedName().substring(0, declaration.getQualifiedName().length() - "Declaration".length());
      if (declaration.getAnnotation(UIComponentTag.class) != null) {
        className = "org.apache.myfaces.tobago.internal.taglib." + StringUtils.capitalize(annotationTag.name()) + "Tag";
      }
      String msg = "Replacing: " + declaration.getQualifiedName() + " -> " + className;
      getEnv().getMessager().printNotice(msg);
      if (declaration.getAnnotation(Deprecated.class) != null) {
        addTag(taglib, parent, annotationTag.name(), document);
      }
      addAttributes(declaration, taglib, parent, annotationTag.name(), document);
      if (StringUtils.isNotEmpty(annotationTag.deprecatedName())) {
        addTag(taglib, parent, annotationTag.deprecatedName(), document);
        addAttributes(declaration, taglib, parent, annotationTag.name(), document);
      }
    }
  }
View Full Code Here

      IOUtils.closeQuietly(writer);
    }
  }

  protected void appendTag(ClassDeclaration declaration, String taglib, Element parent, Document document) {
    Tag annotationTag = declaration.getAnnotation(Tag.class);
    checkDuplicates(annotationTag.name());
    if (declaration.getAnnotation(Deprecated.class) != null) {
      addTag(taglib, parent, annotationTag.name(), document);
    }
    addAttributes(declaration, taglib, parent, annotationTag.name(), document);
    if (StringUtils.isNotEmpty(annotationTag.deprecatedName())) {
      addTag(taglib, parent, annotationTag.deprecatedName(), document);
      addAttributes(declaration, taglib, parent, annotationTag.deprecatedName(), document);
    }
  }
View Full Code Here

      addAttributes(declaration, taglib, parent, annotationTag.deprecatedName(), document);
    }
  }

  protected void appendTag(InterfaceDeclaration declaration, String taglib, Element parent, Document document) {
    Tag annotationTag = declaration.getAnnotation(Tag.class);
    if (annotationTag != null) {
      checkDuplicates(annotationTag.name());
      // TODO configure replacement

      String className =
          declaration.getQualifiedName().substring(0, declaration.getQualifiedName().length() - "Declaration".length());
      if (declaration.getAnnotation(UIComponentTag.class) != null) {
        className = "org.apache.myfaces.tobago.internal.taglib." + StringUtils.capitalize(annotationTag.name()) + "Tag";
      }
      String msg = "Replacing: " + declaration.getQualifiedName() + " -> " + className;
      getEnv().getMessager().printNotice(msg);
      if (declaration.getAnnotation(Deprecated.class) != null) {
        addTag(taglib, parent, annotationTag.name(), document);
      }
      addAttributes(declaration, taglib, parent, annotationTag.name(), document);
      if (StringUtils.isNotEmpty(annotationTag.deprecatedName())) {
        addTag(taglib, parent, annotationTag.deprecatedName(), document);
        addAttributes(declaration, taglib, parent, annotationTag.name(), document);
      }
    }
  }
View Full Code Here

    writeFile(tagInfo, stringTemplate);
  }

  private void createTagOrComponent(InterfaceDeclaration declaration) {
    UIComponentTag componentTag = declaration.getAnnotation(UIComponentTag.class);
    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);
        }
View Full Code Here

      IOUtils.closeQuietly(writer);
    }
  }

  protected void appendTag(ClassDeclaration decl, Element parent, Document document) {
    Tag annotationTag = decl.getAnnotation(Tag.class);
    checkDuplicates(annotationTag.name());
    resetAttributeDuplicateList();
    String className = decl.getQualifiedName();
    TagGeneration tagGeneration = decl.getAnnotation(TagGeneration.class);
    if (tagGeneration != null) {
      className = tagGeneration.className();
    }
    Element tag = createTag(decl, annotationTag, className, document, false);
    addAttributes(decl, tag, document);
    parent.appendChild(tag);
    if (annotationTag.deprecatedName() != null&&annotationTag.deprecatedName().length() > 0) {
      Element deprecatedTag = createTag(decl, annotationTag, className, document, true);
      addAttributes(decl, deprecatedTag, document);
      parent.appendChild(deprecatedTag);
    }
  }
View Full Code Here

      parent.appendChild(deprecatedTag);
    }
  }

  protected void appendTag(InterfaceDeclaration decl, Element parent, Document document) {
    Tag annotationTag = decl.getAnnotation(Tag.class);
    if (annotationTag != null) {
      checkDuplicates(annotationTag.name());
      resetAttributeDuplicateList();
      // TODO configure replacement

      String className =
          decl.getQualifiedName().substring(0, decl.getQualifiedName().length() - "Declaration".length());
      if (decl.getAnnotation(UIComponentTag.class) != null) {
        className = "org.apache.myfaces.tobago.internal.taglib." + StringUtils.capitalize(annotationTag.name()) + "Tag";
      }
      //decl.getQualifiedName().replaceAll("Declaration", "");
      String msg = "Replacing: " + decl.getQualifiedName() + " -> " + className;
      getEnv().getMessager().printNotice(msg);
      Element tag = createTag(decl, annotationTag, className, document, false);
      addAttributes(decl, tag, document);
      parent.appendChild(tag);
      if (annotationTag.deprecatedName() != null&&annotationTag.deprecatedName().length() > 0) {
        Element deprecatedTag = createTag(decl, annotationTag, className, document, true);
        addAttributes(decl, deprecatedTag, document);
        parent.appendChild(deprecatedTag);
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.apt.annotation.Tag

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.