public class

AnnotationsResource

extends AbstractResource
java.lang.Object
   ↳ com.google.gwt.i18n.rebind.AbstractResource
     ↳ com.google.gwt.i18n.rebind.AnnotationsResource

Class Overview

AbstractResource implementation which looks up text annotations on classes.

Summary

Nested Classes
class AnnotationsResource.AnnotationsError An exception indicating there was some problem with an annotation. 
class AnnotationsResource.ArgumentInfo Class for argument information, used for export. 
[Expand]
Inherited Constants
From class com.google.gwt.i18n.rebind.AbstractResource
[Expand]
Inherited Fields
From class com.google.gwt.i18n.rebind.AbstractResource
Public Constructors
AnnotationsResource(TreeLogger logger, JClassType clazz, GwtLocale locale, boolean isConstants)
Create a resource that supplies data from i18n-related annotations.
Public Methods
void addToKeySet(Set<String> s)
Iterable<AnnotationsResource.ArgumentInfo> argumentsIterator(String key)
String getDescription(String key)
AbstractResource.ResourceEntry getEntry(String key)
Returns an entry in this resource.
Collection<String> getExtensions(String key)
static String getKey(TreeLogger logger, KeyGenerator keyGenerator, JMethod method, boolean isConstants)
Returns the key for a given method.
static KeyGenerator getKeyGenerator(JClassType targetClass)
Returns a suitable key generator for the specified class.
String getMeaning(String key)
String getStringExt(String key, String extension)
Get a key with an extension.
boolean notEmpty()
Returns true if this resource has any keys.
String toString()
[Expand]
Inherited Methods
From class com.google.gwt.i18n.rebind.AbstractResource
From class java.lang.Object

Public Constructors

public AnnotationsResource (TreeLogger logger, JClassType clazz, GwtLocale locale, boolean isConstants)

Create a resource that supplies data from i18n-related annotations.

Throws
AnnotationsResource.AnnotationsError if there is a fatal error while processing annotations

Public Methods

public void addToKeySet (Set<String> s)

public Iterable<AnnotationsResource.ArgumentInfo> argumentsIterator (String key)

public String getDescription (String key)

public AbstractResource.ResourceEntry getEntry (String key)

Returns an entry in this resource.

Returns
  • ResourceEntry instance

public Collection<String> getExtensions (String key)

public static 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.

Returns
  • null if unable to get or compute the key for this method, otherwise the key is returned

public static KeyGenerator getKeyGenerator (JClassType targetClass)

Returns a suitable key generator for the specified class.

Returns
  • KeyGenerator instance, guaranteed to not be null
Throws
AnnotationsResource.AnnotationsError if a specified KeyGenerator cannot be created

public String getMeaning (String key)

public String getStringExt (String key, String extension)

Get a key with an extension. Identical to getString() if extension is null.

Parameters
key to lookup
extension extension of the key, nullable
Returns
  • string or null

public boolean notEmpty ()

Returns true if this resource has any keys.

public String toString ()