com.google.gwt.i18n.rebind
Class AnnotationsResource
java.lang.Object
com.google.gwt.i18n.rebind.AbstractResource
com.google.gwt.i18n.rebind.AnnotationsResource
public class AnnotationsResource
- extends AbstractResource
AbstractResource implementation which looks up text annotations on classes.
|
Constructor Summary |
AnnotationsResource(TreeLogger logger,
JClassType clazz,
GwtLocale locale,
boolean isConstants)
Create a resource that supplies data from i18n-related annotations. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AnnotationsResource
public AnnotationsResource(TreeLogger logger,
JClassType clazz,
GwtLocale locale,
boolean isConstants)
throws AnnotationsResource.AnnotationsError
- Create a resource that supplies data from i18n-related annotations.
- Parameters:
logger - clazz - locale - isConstants -
- Throws:
AnnotationsResource.AnnotationsError - if there is a fatal error while processing
annotations
getKey
public static java.lang.String getKey(TreeLogger logger,
KeyGenerator keyGenerator,
JMethod method,
boolean isConstants)
- Returns the key for a given method.
If null is returned, an error message has already been logged.
- Parameters:
logger - keyGenerator - method - isConstants -
- Returns:
- null if unable to get or compute the key for this method, otherwise
the key is returned
getKeyGenerator
public static KeyGenerator getKeyGenerator(JClassType targetClass)
throws AnnotationsResource.AnnotationsError
- Returns a suitable key generator for the specified class.
- Parameters:
targetClass -
- Returns:
- KeyGenerator instance, guaranteed to not be null
- Throws:
AnnotationsResource.AnnotationsError - if a specified KeyGenerator cannot be created
addToKeySet
public void addToKeySet(java.util.Set<java.lang.String> s)
argumentsIterator
public java.lang.Iterable<AnnotationsResource.ArgumentInfo> argumentsIterator(java.lang.String key)
getDescription
public java.lang.String getDescription(java.lang.String key)
getExtensions
public java.util.Collection<java.lang.String> getExtensions(java.lang.String key)
- Overrides:
getExtensions in class AbstractResource
getMeaning
public java.lang.String getMeaning(java.lang.String key)
getStringExt
public java.lang.String getStringExt(java.lang.String key,
java.lang.String extension)
- Description copied from class:
AbstractResource
- Get a key with an extension. Identical to getString() if extension is null.
- Specified by:
getStringExt in class AbstractResource
- Parameters:
key - to lookupextension - extension of the key, nullable
- Returns:
- string or null
notEmpty
public boolean notEmpty()
- Overrides:
notEmpty in class AbstractResource
- Returns:
- true if this resource has any keys
toString
public java.lang.String toString()
- Overrides:
toString in class AbstractResource