org.kohsuke.stapler.jelly
Class InternationalizedStringExpression

java.lang.Object
  extended by org.apache.commons.jelly.expression.ExpressionSupport
      extended by org.kohsuke.stapler.jelly.InternationalizedStringExpression
All Implemented Interfaces:
org.apache.commons.jelly.expression.Expression

public class InternationalizedStringExpression
extends org.apache.commons.jelly.expression.ExpressionSupport

Expression of the form "%messageName(arg1,arg2,...)" that represents internationalized text.

The "(arg1,...)" portion is optional and can be ommitted. Each argument is assumed to be a parenthesis-balanced expression and passed to JellyClassLoaderTearOff.EXPRESSION_FACTORY to be parsed.

The message resource is loaded from files like "xyz.properties" and "xyz_ja.properties" when the expression is placed in "xyz.jelly".

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class InternationalizedStringExpression.RawHtmlArgument
          Argument to InternationalizedStringExpression that indicates this value is raw HTML and therefore should not be further escaped.
 
Field Summary
 java.lang.String expressionText
           
 java.lang.String key
           
 ResourceBundle resourceBundle
           
 
Fields inherited from class org.apache.commons.jelly.expression.ExpressionSupport
EMPTY_ITERATOR
 
Fields inherited from interface org.apache.commons.jelly.expression.Expression
NULL
 
Constructor Summary
InternationalizedStringExpression(ResourceBundle resourceBundle, java.lang.String text)
           
 
Method Summary
 java.lang.Object evaluate(org.apache.commons.jelly.JellyContext context)
           
 java.util.List<org.apache.commons.jelly.expression.Expression> getArguments()
           
 java.lang.String getExpressionText()
           
 org.apache.commons.jelly.expression.Expression makeEscapingExpression()
          Creates a new Expression that performs proper HTML escaping.
 
Methods inherited from class org.apache.commons.jelly.expression.ExpressionSupport
evaluateAsBoolean, evaluateAsIterator, evaluateAsString, evaluateRecurse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceBundle

public final ResourceBundle resourceBundle

key

public final java.lang.String key

expressionText

public final java.lang.String expressionText
Constructor Detail

InternationalizedStringExpression

public InternationalizedStringExpression(ResourceBundle resourceBundle,
                                         java.lang.String text)
                                  throws org.apache.commons.jelly.JellyException
Throws:
org.apache.commons.jelly.JellyException
Method Detail

getArguments

public java.util.List<org.apache.commons.jelly.expression.Expression> getArguments()

getExpressionText

public java.lang.String getExpressionText()

evaluate

public java.lang.Object evaluate(org.apache.commons.jelly.JellyContext context)

makeEscapingExpression

public org.apache.commons.jelly.expression.Expression makeEscapingExpression()
Creates a new Expression that performs proper HTML escaping.



Copyright © 2011. All Rights Reserved.