public String evaluateAsString(JellyContext context) { Object value = evaluateRecurse(context); // sometimes when Jelly is used inside Maven the value // of an expression can actually be an expression. // e.g. ${foo.bar} can lookup "foo.bar" in a Maven context // which could actually be an expression if ( value != null ) { return value.toString(); } return null; }
Expression escape() { return new ExpressionSupport() { public String getExpressionText() { return expressionText; } public Object evaluate(JellyContext context) { Object[] args = evaluateArguments(context); for (int i = 0; i < args.length; i++) { args[i] = escapeArgument(args[i]); } return format(args); } }; }
public Object evaluateRecurse(JellyContext context) { Object value = evaluate(context); if (value instanceof Expression) { Expression expression = (Expression) value; return expression.evaluateRecurse(context); } return value; }
public Object evaluateRecurse(JellyContext context) { Object value = evaluate(context); if (value instanceof Expression) { Expression expression = (Expression) value; return expression.evaluateRecurse(context); } return value; }
public String evaluateAsString(JellyContext context) { Object value = evaluateRecurse(context); // sometimes when Jelly is used inside Maven the value // of an expression can actually be an expression. // e.g. ${foo.bar} can lookup "foo.bar" in a Maven context // which could actually be an expression if ( value != null ) { return value.toString(); } return null; }
public Object evaluateRecurse(JellyContext context) { Object value = evaluate(context); if (value instanceof Expression) { Expression expression = (Expression) value; return expression.evaluateRecurse(context); } return value; }
/** * Creates a new {@link Expression} that performs proper HTML escaping. */ public Expression makeEscapingExpression() { return new ExpressionSupport() { public String getExpressionText() { return expressionText; } public Object evaluate(JellyContext context) { Object[] args = evaluateArguments(context); args = Stapler.htmlSafeArguments(args); return format(args); } }; }
public String evaluateAsString(JellyContext context) { Object value = evaluateRecurse(context); // sometimes when Jelly is used inside Maven the value // of an expression can actually be an expression. // e.g. ${foo.bar} can lookup "foo.bar" in a Maven context // which could actually be an expression if ( value != null ) { return value.toString(); } return null; }
public Object evaluateRecurse(JellyContext context) { Object value = evaluate(context); if (value instanceof Expression) { Expression expression = (Expression) value; return expression.evaluateRecurse(context); } return value; }
public String evaluateAsString(JellyContext context) { Object value = evaluateRecurse(context); // sometimes when Jelly is used inside Maven the value // of an expression can actually be an expression. // e.g. ${foo.bar} can lookup "foo.bar" in a Maven context // which could actually be an expression if ( value != null ) { return value.toString(); } return null; }
public boolean evaluateAsBoolean(JellyContext context) { Object value = evaluateRecurse(context); if ( value instanceof Boolean ) { Boolean b = (Boolean) value; return b.booleanValue(); } else if ( value instanceof String ) { // return Boolean.getBoolean( (String) value ); String str = (String) value; return ( str.equalsIgnoreCase( "on" ) || str.equalsIgnoreCase( "yes" ) || str.equals( "1" ) || str.equalsIgnoreCase( "true" ) ); } return false; }
public boolean evaluateAsBoolean(JellyContext context) { Object value = evaluateRecurse(context); if ( value instanceof Boolean ) { Boolean b = (Boolean) value; return b.booleanValue(); } else if ( value instanceof String ) { // return Boolean.getBoolean( (String) value ); String str = (String) value; return ( str.equalsIgnoreCase( "on" ) || str.equalsIgnoreCase( "yes" ) || str.equals( "1" ) || str.equalsIgnoreCase( "true" ) ); } return false; }
public boolean evaluateAsBoolean(JellyContext context) { Object value = evaluateRecurse(context); if ( value instanceof Boolean ) { Boolean b = (Boolean) value; return b.booleanValue(); } else if ( value instanceof String ) { // return Boolean.getBoolean( (String) value ); String str = (String) value; return ( str.equalsIgnoreCase( "on" ) || str.equalsIgnoreCase( "yes" ) || str.equals( "1" ) || str.equalsIgnoreCase( "true" ) ); } return false; }
public boolean evaluateAsBoolean(JellyContext context) { Object value = evaluateRecurse(context); if ( value instanceof Boolean ) { Boolean b = (Boolean) value; return b.booleanValue(); } else if ( value instanceof String ) { // return Boolean.getBoolean( (String) value ); String str = (String) value; return ( str.equalsIgnoreCase( "on" ) || str.equalsIgnoreCase( "yes" ) || str.equals( "1" ) || str.equalsIgnoreCase( "true" ) ); } return false; }
public Iterator evaluateAsIterator(JellyContext context) { Object value = evaluateRecurse(context); if ( value == null ) { return EMPTY_ITERATOR; } else if ( value instanceof Iterator ) { return (Iterator) value; } else if ( value instanceof List ) { List list = (List) value; return list.iterator(); } else if ( value instanceof Map ) { Map map = (Map) value; return map.entrySet().iterator(); } else if ( value.getClass().isArray() ) { return new ArrayIterator( value ); } else if ( value instanceof Enumeration ) { return new EnumerationIterator((Enumeration ) value); } else if ( value instanceof Collection ) { Collection collection = (Collection) value; return collection.iterator(); } else if ( value instanceof String ) { String[] array = StringUtils.split((String) value, "," ); array = StringUtils.stripAll( array ); return new ArrayIterator( array ); } else { // XXX: should we return single iterator? return new SingletonIterator( value ); } } }
public Iterator evaluateAsIterator(JellyContext context) { Object value = evaluateRecurse(context); if ( value == null ) { return EMPTY_ITERATOR;
public Iterator evaluateAsIterator(JellyContext context) { Object value = evaluateRecurse(context); if ( value == null ) { return EMPTY_ITERATOR;
public Iterator evaluateAsIterator(JellyContext context) { Object value = evaluateRecurse(context); if ( value == null ) { return EMPTY_ITERATOR;