示例#1
0
    public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {

      if (meta.isTargetInstanceOf(UIComponent.class)) {
        Class type = meta.getPropertyType(name);
        if (type == null) {
          type = Object.class;
        }

        if (!attribute.isLiteral()) {
          return new CompositeExpressionMetadata(name, type, attribute);
        } else {
          return new LiteralAttributeMetadata(name, type, attribute);
        }
      }
      return null;
    }
示例#2
0
 @Override
 public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
   if (meta.isTargetInstanceOf(AbstractDataScroller.class)) {
     if ("scrollListener".equals(name)) {
       return new ScrollListenerMapper(attribute);
     }
   }
   return null;
 }
示例#3
0
    @Override
    public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
      if (meta.isTargetInstanceOf(ItemChangeSource.class)) {
        if ("itemChangeListener".equals(name)) {
          return new ItemChangeExpressionMetadata(attribute);
        }
      }

      return null;
    }
示例#4
0
  public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
    if (meta.isTargetInstanceOf(UIComponent.class)) {

      // if component and dynamic, then must set expression
      if (!attribute.isLiteral()) {
        Class type = meta.getPropertyType(name);
        if (type == null) {
          type = Object.class;
        }
        return new ValueExpressionMetadata(name, type, attribute);
      } else if (meta.getWriteMethod(name) == null) {

        // this was an attribute literal, but not property
        warnAttr(attribute, meta.getTargetClass(), name);

        return new LiteralAttributeMetadata(name, attribute.getValue());
      }
    }
    return null;
  }
    @Override
    public Metadata applyRule(
        final String name, final TagAttribute attribute, final MetadataTarget meta) {
      if (meta.isTargetInstanceOf(RemoteCommandParameter.class)) {
        if (RemoteCommandParameter.PropertyKeys.applyTo.toString().equals(name)) {
          return new ApplyToValueExpressionMetadata(attribute);
        }
      }

      return null;
    }
示例#6
0
  public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
    if (meta.isTargetInstanceOf(ValueHolder.class)) {

      if ("converter".equals(name)) {
        if (attribute.isLiteral()) {
          return new LiteralConverterMetadata(attribute.getValue());
        } else {
          return new DynamicConverterMetadata2(attribute);
        }
      }

      if ("value".equals(name)) {
        // if (attribute.isLiteral()) {
        //    return new LiteralValueMetadata(attribute.getValue());
        // } else {
        return new DynamicValueExpressionMetadata(attribute);
        // }
      }
    }
    return null;
  }