public void applyMetadata(FaceletContext ctx, Object instance) { try { this.method.invoke(instance, new Object[] { this.attribute .getObject(ctx, this.type) }); } catch (InvocationTargetException e) { throw new TagAttributeException(this.attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(this.attribute, e); } } }
/** * */ public TagAttributeException(Tag tag, TagAttribute attr) { super(print(tag, attr)); }
public void applyMetadata(FaceletContext ctx, Object instance) { MethodExpression expr = _attribute.getMethodExpression(ctx, _returnType, _paramList); try { _method.invoke(instance, new Object[] { expr }); } catch (InvocationTargetException e) { throw new TagAttributeException(_attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(_attribute, e); } } }
/** * @param message */ public TagAttributeException(Tag tag, TagAttribute attr, String message) { super(print(tag, attr) + " " + message); }
public void applyMetadata(FaceletContext ctx, Object instance) { MethodExpression expr = _attribute.getMethodExpression(ctx, _returnType, _paramList); try { _method.invoke(instance, new Object[] { new LegacyMethodBinding(expr) }); } catch (InvocationTargetException e) { throw new TagAttributeException(_attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(_attribute, e); } } }
/** * @param message * @param cause */ public TagAttributeException(Tag tag, TagAttribute attr, String message, Throwable cause) { super(print(tag, attr) + " " + message, cause); }
public TagAttribute(Location location, String ns, String localName, String qName, String value) { this.location = location; this.namespace = ns; this.localName = localName; this.qName = qName; this.value = value; try { this.literal = ELText.isLiteral(this.value); } catch (ELException e) { throw new TagAttributeException(this, e); } }
/** * @param cause */ public TagAttributeException(Tag tag, TagAttribute attr, Throwable cause) { super(print(tag, attr) + " " + cause.getMessage(), cause); }
public void applyMetadata(FaceletContext ctx, Object instance) { if (value == null) { String str = this.attribute.getValue(); value = new Object[] { java.util.TimeZone.getTimeZone( str ) }; } try { method.invoke(instance, this.value); } catch (InvocationTargetException e) { throw new TagAttributeException(this.attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(this.attribute, e); } }
private final Iterator toIterator(Object src) { if (src == null) { return null; } else if (src instanceof Collection) { return ((Collection) src).iterator(); } else if (src instanceof Map) { return ((Map) src).entrySet().iterator(); } else if (src.getClass().isArray()) { return new ArrayIterator(src); } else { throw new TagAttributeException(this.tag, this.items, "Must evaluate to a Collection, Map, Array, or null."); } }
public void applyMetadata(FaceletContext ctx, Object instance) { if (value == null) { String str = this.attribute.getValue(); value = new Object[] { java.util.TimeZone.getTimeZone( str ) }; } try { method.invoke(instance, this.value); } catch (InvocationTargetException e) { throw new TagAttributeException(this.attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(this.attribute, e); } }
public void applyMetadata(FaceletContext ctx, Object instance) { if (value == null) { String str = this.attribute.getValue(); value = new Object[] { ctx.getExpressionFactory().coerceToType(str, method.getParameterTypes()[0]) }; } try { method.invoke(instance, this.value); } catch (InvocationTargetException e) { throw new TagAttributeException(this.attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(this.attribute, e); } }
public void applyMetadata(FaceletContext ctx, Object instance) { if (value == null) { String str = this.attribute.getValue(); value = new Object[] { org.apache.myfaces.commons.util.TagUtils.getLocale( str ) }; } try { method.invoke(instance, this.value); } catch (InvocationTargetException e) { throw new TagAttributeException(this.attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(this.attribute, e); } }
public void applyMetadata(FaceletContext ctx, Object instance) { if (value == null) { String str = this.attribute.getValue(); value = new Object[] { org.apache.myfaces.commons.util.TagUtils.getLocale( str ) }; } try { method.invoke(instance, this.value); } catch (InvocationTargetException e) { throw new TagAttributeException(this.attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(this.attribute, e); } }
.toUpperCase(), s.substring(6, s.length())); throw new TagAttributeException(attr, "Invalid Locale Specified: " + s); } else { throw new TagAttributeException(attr, "Attribute did not evaluate to a String or Locale: " + obj);
public TabChangeListenerHandler(TagConfig config) { super(config); binding = getAttribute("binding"); type = getAttribute("type"); if (type != null) { if (!type.isLiteral()) { throw new TagAttributeException(tag, type, "Must be literal"); } try { this.listenerType = Class.forName(type.getValue()); } catch (Exception e) { throw new TagAttributeException(tag, type, e); } } }
/** * Create a ValueExpression, using this attribute's literal value and the * passed expected type. * * @see ExpressionFactory#createValueExpression(javax.el.ELContext, * java.lang.String, java.lang.Class) * @see ValueExpression * @param ctx * FaceletContext to use * @param type * expected return type * @return ValueExpression instance */ public ValueExpression getValueExpression(FaceletContext ctx, Class type) { try { ExpressionFactory f = ctx.getExpressionFactory(); return new TagValueExpression(this, f.createValueExpression(ctx, this.value, type)); } catch (Exception e) { throw new TagAttributeException(this, e); } }
type); } catch (Exception e) { throw new TagAttributeException(this, e); return ve.getValue(ctx); } catch (Exception e) { throw new TagAttributeException(this, e);
/** * @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(); }
/** * @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; } }