info.magnolia.i18nsystem
Class NullKeyGenerator

java.lang.Object
  extended by info.magnolia.i18nsystem.NullKeyGenerator
All Implemented Interfaces:
I18nKeyGenerator

public class NullKeyGenerator
extends Object
implements I18nKeyGenerator

A basic implementation of I18nKeyGenerator which essentially just returns the undecorated value, and warns that no I18nKeyGenerator was set for the given object.


Constructor Summary
NullKeyGenerator()
           
 
Method Summary
 String[] keysFor(String undecoratedResult, Object object, AnnotatedElement el)
          Generates the possible keys for the given object's annotated element.
 String messageBundleNameFor(Object object)
          If has a property that can be used to determine the bundle name (i18nBasename), return that.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullKeyGenerator

public NullKeyGenerator()
Method Detail

keysFor

public String[] keysFor(String undecoratedResult,
                        Object object,
                        AnnotatedElement el)
Description copied from interface: I18nKeyGenerator
Generates the possible keys for the given object's annotated element.

Specified by:
keysFor in interface I18nKeyGenerator
Parameters:
undecoratedResult - the value returned by the undecorated underlying method call. It is generally expected that this value will be part of the returned keys, such that an object with an explicitly configured key or label will be translated using that value rather than derived keys.
el - the element being translated - typically a Method instance.

messageBundleNameFor

public String messageBundleNameFor(Object object)
Description copied from interface: I18nKeyGenerator
If has a property that can be used to determine the bundle name (i18nBasename), return that. The keys will be tried with and without it.

Specified by:
messageBundleNameFor in interface I18nKeyGenerator


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.