org.apache.commons.jelly.expression.Expression.getExpressionText()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.apache.commons.jelly.expression.Expression.getExpressionText()方法的一些代码示例,展示了Expression.getExpressionText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Expression.getExpressionText()方法的具体详情如下:
包路径:org.apache.commons.jelly.expression.Expression
类名称:Expression
方法名:getExpressionText

Expression.getExpressionText介绍

暂无

代码示例

代码示例来源:origin: org.hudsonci.stapler/commons-jelly

public String getExpressionText() {
  return base.getExpressionText();
}

代码示例来源:origin: org.jvnet.hudson/commons-jelly

public String getExpressionText() {
  return base.getExpressionText();
}

代码示例来源:origin: org.jenkins-ci/commons-jelly

public String getExpressionText() {
  return base.getExpressionText();
}

代码示例来源:origin: org.hudsonci.stapler/commons-jelly

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();
}

代码示例来源:origin: commons-jelly/commons-jelly

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();
}

代码示例来源:origin: org.jvnet.hudson/commons-jelly

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();
}

代码示例来源:origin: org.jenkins-ci/commons-jelly

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();
}

代码示例来源:origin: commons-jelly/commons-jelly

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);
}

代码示例来源:origin: commons-jelly/commons-jelly

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);
  }
}

代码示例来源:origin: stapler/stapler

@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);
    }
  }
};

代码示例来源:origin: commons-jelly/commons-jelly

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);
    }
  }
}

相关文章