Package javax.faces.view.facelets

Examples of javax.faces.view.facelets.TagAttribute


  protected MetaRuleset createSubComponentMetaRuleset(Class aClass) {
    MetaRuleset metaRuleset = super.createMetaRuleset(aClass);
    TagAttribute [] attrs = tag.getAttributes().getAll();
    for (int i = 0; i < attrs.length; i++) {
      TagAttribute attr = attrs[i];
      if (!(attr.getLocalName().equals(Attributes.CONVERTER)
          || attr.getLocalName().equals(Attributes.VALUE))) {
        metaRuleset.ignore(attr.getLocalName());
      }
    }
    return metaRuleset;
  }
View Full Code Here


      metaRuleset.ignore(Attributes.LABEL);
      return metaRuleset;
    } else {
      TagAttribute[] attrs = tag.getAttributes().getAll();
      for (int i = 0; i < attrs.length; i++) {
        TagAttribute attr = attrs[i];
        metaRuleset.ignore(attr.getLocalName());
      }
      return metaRuleset;
    }
  }
View Full Code Here

  protected MetaRuleset createMetaRuleset(Class aClass) {
    MetaRuleset metaRuleset = super.createMetaRuleset(aClass);
    TagAttribute[] attrs = tag.getAttributes().getAll();
    for (int i = 0; i < attrs.length; i++) {
      TagAttribute attr = attrs[i];
      if (!attr.getLocalName().equals("rendered")) {
        metaRuleset.ignore(attr.getLocalName());
      }
    }
    return metaRuleset;
  }
View Full Code Here

   * The tag constructor.
   * @param config The tag config.
   */
  public ImportConstants(TagConfig config) {
    super(config);
    TagAttribute var = getAttribute("var");

    if (var != null) {
      if (var.isLiteral()) {
        this.var = var.getValue();
      }
      else {
        throw new IllegalArgumentException(ERROR_INVALID_VAR);
      }
    }
View Full Code Here

   */
  @Override
  public void setAttributes(FaceletContext context, Object component) {
    super.setAttributes(context, component);
    ValidateMultiple validateMultiple = (ValidateMultiple) component;
    TagAttribute attribute = getRequiredAttribute("validator");

    try { // Yes, this try-catch is ugly, but there's really no clean way to distinguish a VE from a ME.
      ValueExpression valueExpression = attribute.getValueExpression(context, MultiFieldValidator.class);
      MultiFieldValidator validator = (MultiFieldValidator) valueExpression.getValue(context);
      validateMultiple.setValidator(validator);
    }
    catch (Exception e) { // At least, ClassCastException and PropertyNotFoundException are expected.
      MethodExpression validateMethod = attribute.getMethodExpression(context, boolean.class, PARAM_TYPES);
      validateMultiple.setValidateMethod(validateMethod);
    }
  }
View Full Code Here

   * The tag constructor.
   * @param config The tag config.
   */
  public ImportFunctions(TagConfig config) {
    super(config);
    TagAttribute var = getAttribute("var");

    if (var != null) {
      if (var.isLiteral()) {
        this.var = var.getValue();
      }
      else {
        throw new IllegalArgumentException(ERROR_INVALID_VAR);
      }
    }
View Full Code Here

  /**
   * Get the value of the tag attribute associated with the given attribute name as a value expression.
   */
  private ValueExpression getValueExpression(String attributeName, FaceletContext context) {
    TagAttribute attribute = getAttribute(attributeName);

    if (attribute != null) {
      return attribute.getValueExpression(context, Object.class);
    }

    return null;
  }
View Full Code Here

   * @return The given attribute as a {@link ValueExpression}.
   */
  static <T> ValueExpression getValueExpression
    (FaceletContext context, DeferredTagHandler tag, String name, Class<T> type)
  {
    TagAttribute attribute = tag.getTagAttribute(name);
    return (attribute != null) ? attribute.getValueExpression(context, type) : null;
  }
View Full Code Here

  /**
   * Get the value of the tag attribute associated with the given attribute name as a value expression.
   */
  private ValueExpression getValueExpression(FaceletContext context, String attributeName) {
    TagAttribute attribute = getAttribute(attributeName);
    return (attribute != null) ? attribute.getValueExpression(context, Object.class) : null;
  }
View Full Code Here

    if (ILLEGAL_NAMES.contains(name)) {
      throw new IllegalArgumentException(ERROR_ILLEGAL_NAME);
    }

    value = getRequiredAttribute("value");
    TagAttribute target = getAttribute("target");

    if (target != null) {
      String className = target.getValue();
      Class<?> cls = null;

      try {
        cls = Class.forName(className);
      }
View Full Code Here

TOP

Related Classes of javax.faces.view.facelets.TagAttribute

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.