public String getExpressionText() { return base.getExpressionText(); }
public String getExpressionText() { return base.getExpressionText(); }
public String getExpressionText() { return base.getExpressionText(); }
public String getExpressionText() { StringBuffer buffer = new StringBuffer(); for (Iterator iter = expressions.iterator(); iter.hasNext(); ) { Expression expression = (Expression) iter.next(); buffer.append( expression.getExpressionText() ); } return buffer.toString(); }
public String getExpressionText() { StringBuffer buffer = new StringBuffer(); for (Iterator iter = expressions.iterator(); iter.hasNext(); ) { Expression expression = (Expression) iter.next(); buffer.append( expression.getExpressionText() ); } return buffer.toString(); }
public String getExpressionText() { StringBuffer buffer = new StringBuffer(); for (Iterator iter = expressions.iterator(); iter.hasNext(); ) { Expression expression = (Expression) iter.next(); buffer.append( expression.getExpressionText() ); } return buffer.toString(); }
public String getExpressionText() { StringBuffer buffer = new StringBuffer(); for (Iterator iter = expressions.iterator(); iter.hasNext(); ) { Expression expression = (Expression) iter.next(); buffer.append( expression.getExpressionText() ); } return buffer.toString(); }
public void doTag(XMLOutput output) throws JellyTagException { String message = getBodyText(); Object expectedValue = expected.evaluate(context); Object actualValue = actual.evaluate(context); if (expectedValue == null && actualValue == null) { return; } if (actualValue != null && expectedValue.equals(actualValue)) { return; } String expressions = "\nExpected expression: " + expected.getExpressionText() + "\nActual expression: " + actual.getExpressionText(); failNotEquals(message, expectedValue, actualValue, expressions); }
protected void assertExpression(String expressionText, Object expectedValue) throws Exception { Expression expression = CompositeExpression.parse(expressionText, factory); assertTrue( "Created a valid expression for: " + expressionText, expression != null ); Object value = expression.evaluate(context); assertEquals( "Wrong result for expression: " + expressionText, expectedValue, value ); String text = expression.getExpressionText(); assertEquals( "Wrong textual representation for expression text: ", expressionText, text); } }
@Override protected Script resolveDefinition(JellyContext context) throws JellyTagException { Object it = expr.evaluate(context); if (it==null) throw new JellyTagException("'"+ expr.getExpressionText() +"' evaluated to null"); try { WebApp webApp = WebApp.getCurrent(); MetaClass c = webApp.getMetaClass(it instanceof Class ? Klass.java((Class)it): webApp.getKlass(it)); // prefer 'foo.jellytag' to avoid tags from showing up as views, // but for backward compatibility, support the plain .jelly extension as well. Script tag = c.loadTearOff(JellyClassTearOff.class).findScript(tagName+".jellytag"); if (tag==null) tag = c.loadTearOff(JellyClassTearOff.class).findScript(tagName+".jelly"); if (tag ==null) throw new JellyTagException("No such tag file "+tagName+".jellytag in "+c); return tag; } catch (JellyException e) { throw new JellyTagException("Failed to load "+tagName+".jellytag from "+it,e); } } };
public void doTag(XMLOutput output) throws JellyTagException { if (test == null && xpath == null) { throw new MissingAttributeException( "test" ); } if (test != null) { if (! test.evaluateAsBoolean(context)) { fail( getBodyText(), "evaluating test: "+ test.getExpressionText() ); } } else { try { Object xpathContext = getXPathContext(); if (! xpath.booleanValueOf(xpathContext)) { fail( getBodyText(), "evaluating xpath: "+ xpath ); } } catch (JaxenException anException) { throw new JellyTagException("Error evaluating xpath", anException); } } }