org.apache.struts2.util
类 TextProviderHelper

java.lang.Object
  继承者 org.apache.struts2.util.TextProviderHelper

public class TextProviderHelper
extends Object

Helper methods to access text from TextProviders


构造方法摘要
TextProviderHelper()
           
 
方法摘要
static String getText(String key, String defaultMessage, List<Object> args, com.opensymphony.xwork2.util.ValueStack stack)
          Get a message from the first TextProvider encountered in the stack.
static String getText(String key, String defaultMessage, List<Object> args, com.opensymphony.xwork2.util.ValueStack stack, boolean searchStack)
          Get a message from the first TextProvider encountered in the stack.
static String getText(String key, String defaultMessage, com.opensymphony.xwork2.util.ValueStack stack)
          Get a message from the first TextProvider encountered in the stack.
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

TextProviderHelper

public TextProviderHelper()
方法详细信息

getText

public static String getText(String key,
                             String defaultMessage,
                             List<Object> args,
                             com.opensymphony.xwork2.util.ValueStack stack)

Get a message from the first TextProvider encountered in the stack. If the first TextProvider doesn't provide the message the default message is returned.

The stack is searched if if no TextProvider is found, or the message is not found.

参数:
key - the message key in the resource bundle
defaultMessage - the message to return if not found (evaluated for OGNL)
args - an array args to be used in a MessageFormat message
stack - the value stack to use for finding the text
返回:
the message if found, otherwise the defaultMessage

getText

public static String getText(String key,
                             String defaultMessage,
                             List<Object> args,
                             com.opensymphony.xwork2.util.ValueStack stack,
                             boolean searchStack)

Get a message from the first TextProvider encountered in the stack. If the first TextProvider doesn't provide the message the default message is returned.

The search for a TextProvider is iterative from the root of the stack.

This method was refactored from Text to use a consistent implementation across UIBean components.

参数:
key - the message key in the resource bundle
defaultMessage - the message to return if not found (evaluated for OGNL)
args - an array args to be used in a MessageFormat message
stack - the value stack to use for finding the text
searchStack - search stack for the key
返回:
the message if found, otherwise the defaultMessage

getText

public static String getText(String key,
                             String defaultMessage,
                             com.opensymphony.xwork2.util.ValueStack stack)

Get a message from the first TextProvider encountered in the stack. If the first TextProvider doesn't provide the message the default message is returned.

The search for a TextProvider is iterative from the root of the stack.

This method was refactored from Text to use a consistent implementation across UIBean components.

参数:
key - the message key in the resource bundle
defaultMessage - the message to return if not found
stack - the value stack to use for finding the text
返回:
the message if found, otherwise the defaultMessage