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.tapestry5.internal.services
Class TranslatorSourceImpl

    java.lang.Object
      org.apache.tapestry5.internal.services.TranslatorSourceImpl

All Implemented Interfaces:
  InvalidationListener, TranslatorSource

    public class TranslatorSourceImpl

extends java.lang.Object
implements TranslatorSource, InvalidationListener

Constructor Summary
`TranslatorSourceImpl(java.util.Map<java.lang.Class,Translator> configuration)`
`TranslatorSourceImpl(java.util.Map<java.lang.Class,Translator> configuration, java.util.Map<java.lang.String,Translator> alternates)`

Method Summary
`Translator` | `findByType(java.lang.Class valueType)` Finds a `Translator` that is appropriate to the given type, which is usually obtained via `Binding.getBindingType()`.
`Translator` | `get(java.lang.String name)` Returns the translator with the given name (either a standard translator, or an alternate).
`Translator` | `getByType(java.lang.Class valueType)` Finds a `Translator` that is appropriate to the given type, which is usually obtained via `Binding.getBindingType()`.
`void` | `objectWasInvalidated()` Invoked to indicate that some object is invalid.

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

Constructor Detail

### TranslatorSourceImpl

    public TranslatorSourceImpl(java.util.Map<java.lang.Class,Translator> configuration)

### TranslatorSourceImpl

    public TranslatorSourceImpl(java.util.Map<java.lang.Class,Translator> configuration,
                                java.util.Map<java.lang.String,Translator> alternates)

Method Detail

### get

    public Translator get(java.lang.String name)

  Description copied from interface: `TranslatorSource`
  Returns the translator with the given name (either a standard translator, or an alternate).

  Specified by:
    `get` in interface `TranslatorSource`
  Parameters:
    `name` - name of translator (as configured, but case is ignored)
  Returns:
    the shared translator instance

### getByType

    public Translator getByType(java.lang.Class valueType)

  Description copied from interface: `TranslatorSource`
  Finds a `Translator` that is appropriate to the given type, which is usually obtained via `Binding.getBindingType()`. Performs an inheritance-based search for the best match, among the standard translators (not alternates).

  Specified by:
    `getByType` in interface `TranslatorSource`
  Parameters:
    `valueType` - the type of value for which a default translator is needed
  Returns:
    the matching translator

### findByType

    public Translator findByType(java.lang.Class valueType)

  Description copied from interface: `TranslatorSource`
  Finds a `Translator` that is appropriate to the given type, which is usually obtained via `Binding.getBindingType()`. Performs an inheritance-based search for the best match, among the standard translator (not alternates).

  Specified by:
    `findByType` in interface `TranslatorSource`
  Parameters:
    `valueType` - the type of value for which a default translator is needed
  Returns:
    the matching translator, or null if no match can be found

### objectWasInvalidated

    public void objectWasInvalidated()

  Description copied from interface: `InvalidationListener`
  Invoked to indicate that some object is invalid. The receiver should clear its cache.

  Specified by:
    `objectWasInvalidated` in interface `InvalidationListener`

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 © 2003-2012 The Apache Software Foundation.