Examples of TagAttribute


Examples of javax.faces.view.facelets.TagAttribute

        super(config);
        this.locale = this.getAttribute("locale");
        this.renderKitId = this.getAttribute("renderKitId");
        this.contentType = this.getAttribute("contentType");
        this.encoding = this.getAttribute("encoding");
        TagAttribute testForNull = this.getAttribute("beforePhase");
        this.beforePhase = (null == testForNull) ?
                         this.getAttribute("beforePhaseListener") : testForNull;
        testForNull = this.getAttribute("afterPhase");
        this.afterPhase = (null == testForNull) ?
                         this.getAttribute("afterPhaseListener") : testForNull;
View Full Code Here

Examples of javax.faces.view.facelets.TagAttribute

    /**
     * @param config
     */
    public IncludeHandler(TagConfig config) {
        super(config);
        TagAttribute attr = null;
        attr = this.getAttribute("src");
        if (null == attr) {
            attr = this.getAttribute("file");
        }
        if (null == attr) {
View Full Code Here

Examples of javax.faces.view.facelets.TagAttribute

    /**
     * @param config
     */
    public InsertHandler(TagConfig config) {
        super(config);
        TagAttribute attr = this.getAttribute("name");
        if (attr != null) {
            if (!attr.isLiteral()) {
                throw new TagAttributeException(this.tag, attr, "Must be Literal");
            }
            this.name = attr.getValue();
        } else {
            this.name = null;
        }
    }
View Full Code Here

Examples of javax.faces.view.facelets.TagAttribute

    /**
     * @param config
     */
    public DefineHandler(TagConfig config) {
        super(config);
        TagAttribute attr = this.getRequiredAttribute("name");
        if (!attr.isLiteral()) {
            throw new TagAttributeException(this.tag, attr, "Must be Literal");
        }
        this.name = attr.getValue();
    }
View Full Code Here

Examples of javax.faces.view.facelets.TagAttribute

      * @see com.sun.faces.facelets.tag.composite.AttachedObjectTargetHandler#newAttachedObjectTargetImpl()
      */
    @Override
    AttachedObjectTargetImpl newAttachedObjectTargetImpl() {
        BehaviorHolderAttachedObjectTargetImpl target = new BehaviorHolderAttachedObjectTargetImpl();
        TagAttribute event = this.getAttribute("event");
        if (null != event) {
            target.setEvent(event.getValue());
        }
        TagAttribute defaultAttr = this.getAttribute("default");
        if (null != defaultAttr) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            FaceletContext ctx = (FaceletContext) facesContext.getAttributes()
                  .get(FaceletContext.FACELET_CONTEXT_KEY);
            target.setDefaultEvent(defaultAttr.getBoolean(ctx));
        }
        return target;
    }
View Full Code Here

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

    hidden.setText(Boolean.toString(uiComponentTagAttribute.isHidden()));
    extensionElement.addContent(hidden);
    Element readOnly = new Element(READONLY, namespace);
    readOnly.setText(Boolean.toString(uiComponentTagAttribute.isReadOnly()));
    extensionElement.addContent(readOnly);
    TagAttribute tagAttribute = methodDeclaration.getAnnotation(TagAttribute.class);
    if (tagAttribute != null) {
      Element required = new Element(REQUIRED, namespace);
      required.setText(Boolean.toString(tagAttribute.required()));
      extensionElement.addContent(required);
    }

    return extensionElement;
  }
View Full Code Here

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

    attributeSet = new HashSet<String>();
  }

  protected void addAttribute(MethodDeclaration d, Element tagElement,
      Document document) {
    TagAttribute tagAttribute = d.getAnnotation(TagAttribute.class);
    if (tagAttribute != null) {
      String simpleName = d.getSimpleName();
      if (simpleName.startsWith("set") || simpleName.startsWith("get")) {
        Element attribute = document.createElement("attribute");
        String attributeStr = simpleName.substring(3, 4).toLowerCase(Locale.ENGLISH) + simpleName.substring(4);
        if (tagAttribute.name().length() > 0) {
          attributeStr = tagAttribute.name();
        }
        checkAttributeDuplicates(attributeStr);
        addDescription(d, attribute, document, false);
        addLeafTextElement(attributeStr, "name", attribute, document);

        addLeafTextElement(Boolean.toString(tagAttribute.required()), "required", attribute, document);
        UIComponentTagAttribute componentTagAttribute = d.getAnnotation(UIComponentTagAttribute.class);
        if (isMinium12() && !tagAttribute.rtexprvalue()) {
          if (componentTagAttribute != null) {
            if (componentTagAttribute.expression().isMethodExpression()) {
              Element deferredMethod = document.createElement("deferred-method");
              StringBuilder signature = new StringBuilder();
              signature.append(componentTagAttribute.methodReturnType());
              signature.append(" ");
              signature.append(attributeStr);
              signature.append("(");
              signature.append(StringUtils.join(componentTagAttribute.methodSignature(), ", "));
              signature.append(")");
              addLeafTextElement(signature.toString(), "method-signature", deferredMethod, document);
              attribute.appendChild(deferredMethod);
            } else if (componentTagAttribute != null && componentTagAttribute.expression().isValueExpression()) {
              Element deferredValue = document.createElement("deferred-value");
              String type = "java.lang.Object";
              if (componentTagAttribute.expression().isValueExpression()) {
                if (componentTagAttribute.type().length == 1
                    // XXX fix me hack
                    && !"org.apache.myfaces.tobago.layout.Measure".equals(componentTagAttribute.type()[0])) {
                  type = componentTagAttribute.type()[0];
                }
              } else {
                type = componentTagAttribute.type()[0];
              }
              addLeafTextElement(type, "type", deferredValue, document);
              attribute.appendChild(deferredValue);
            }
          } else {
            Element deferredValue = document.createElement("deferred-value");
            addLeafTextElement(tagAttribute.type(), "type", deferredValue, document);
            attribute.appendChild(deferredValue);
          }
        }
        if (tagAttribute.rtexprvalue()) {
          addLeafTextElement(Boolean.toString(tagAttribute.rtexprvalue()), "rtexprvalue", attribute, document);
        }
        tagElement.appendChild(attribute);
      } else {
        throw new IllegalArgumentException("Only setter allowed found: " + simpleName);
      }
View Full Code Here

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

    attributeSet = new HashSet<String>();
  }

  protected void addAttribute(ExecutableElement element, Element tagElement, Document document, Type type)
      throws ClassNotFoundException {
    TagAttribute tagAttribute = element.getAnnotation(TagAttribute.class);
    if (tagAttribute != null) {
      String simpleName = element.getSimpleName().toString();
      if (simpleName.startsWith("set") || simpleName.startsWith("get")) {
        Element attribute = document.createElement("attribute");
        String attributeName = simpleName.substring(3, 4).toLowerCase(Locale.ENGLISH) + simpleName.substring(4);
        if (tagAttribute.name().length() > 0) {
          attributeName = tagAttribute.name();
        }
        checkAttributeDuplicates(attributeName);
        addDescription(element, attribute, document, false);
        addLeafTextElement(attributeName, "name", attribute, document);

        addLeafTextElement(Boolean.toString(tagAttribute.required()), "required", attribute, document);
        UIComponentTagAttribute componentTagAttribute = element.getAnnotation(UIComponentTagAttribute.class);
        type.addAttributeType(attribute, tagAttribute, componentTagAttribute, document, attributeName);
        tagElement.appendChild(attribute);
      } else {
        throw new IllegalArgumentException("Only setter allowed found: " + simpleName);
View Full Code Here

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

    }
  }

  protected void addAttribute(
      ExecutableElement declaration, String taglib, Element parent, String tagName, Document document) {
    TagAttribute tagAttribute = declaration.getAnnotation(TagAttribute.class);
    Deprecated deprecatedAnnotation = declaration.getAnnotation(Deprecated.class);
    if (tagAttribute != null && deprecatedAnnotation != null) {
      String simpleName = declaration.getSimpleName().toString();
      if (simpleName.startsWith("set") || simpleName.startsWith("get")) {

        String attributeStr = simpleName.substring(3, 4).toLowerCase(Locale.ENGLISH) + simpleName.substring(4);
        if (tagAttribute.name().length() > 0) {
          attributeStr = tagAttribute.name();
        }

        final String format = "<" + taglib + ":" + tagName + "\\b[^<]*\\b" + attributeStr + "=";
        final String message = "The attribute '" + attributeStr + "' is deprecated for tag '" + tagName + "'";

View Full Code Here

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

      addProperties((TypeElement) (processingEnv.getTypeUtils().asElement(typeMirror)), properties);
    }
  }

  protected void addProperty(ExecutableElement declaration, Map<String, PropertyInfo> properties) {
    TagAttribute tagAttribute = declaration.getAnnotation(TagAttribute.class);
    UIComponentTagAttribute uiComponentTagAttribute = declaration.getAnnotation(UIComponentTagAttribute.class);
    if (uiComponentTagAttribute != null) {
      String simpleName = declaration.getSimpleName().toString();
      if (simpleName.startsWith("set") || simpleName.startsWith("get")) {
        String name = simpleName.substring(3, 4).toLowerCase(Locale.ENGLISH) + simpleName.substring(4);
        if (ignoredProperties.contains(name)) {
          return;
        }
        PropertyInfo propertyInfo = new PropertyInfo(name);
        propertyInfo.setAllowedValues(uiComponentTagAttribute.allowedValues());
        if (tagAttribute != null) {
          propertyInfo.setBodyContent(tagAttribute.bodyContent());
          propertyInfo.setTagAttribute(true);
        }
        final String type;
        if (uiComponentTagAttribute.expression().isMethodExpression()) {
          propertyInfo.setMethodExpressionRequired(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.