Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.util
Class TextProviderHelper

    java.lang.Object
      org.apache.struts2.util.TextProviderHelper

    public class TextProviderHelper

extends java.lang.Object

Helper methods to access text from TextProviders

Constructor Summary
`TextProviderHelper()`

Method Summary
`static java.lang.String` | `getText(java.lang.String key, java.lang.String defaultMessage, java.util.List<java.lang.Object> args, ValueStack stack)` Get a message from the first TextProvider encountered in the stack.
`static java.lang.String` | `getText(java.lang.String key, java.lang.String defaultMessage, java.util.List<java.lang.Object> args, ValueStack stack, boolean searchStack)` Get a message from the first TextProvider encountered in the stack.
`static java.lang.String` | `getText(java.lang.String key, java.lang.String defaultMessage, ValueStack stack)` Get a message from the first TextProvider encountered in the stack.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TextProviderHelper

    public TextProviderHelper()

Method Detail

### getText

    public static java.lang.String getText(java.lang.String key,
                                           java.lang.String defaultMessage,
                                           java.util.List<java.lang.Object> args,
                                           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.

  Parameters:
    `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
  Returns:
    the message if found, otherwise the defaultMessage

### getText

    public static java.lang.String getText(java.lang.String key,
                                           java.lang.String defaultMessage,
                                           java.util.List<java.lang.Object> args,
                                           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.

  Parameters:
    `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
  Returns:
    the message if found, otherwise the defaultMessage

### getText

    public static java.lang.String getText(java.lang.String key,
                                           java.lang.String defaultMessage,
                                           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.

  Parameters:
    `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
  Returns:
    the message if found, otherwise the defaultMessage

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.