Package com.google.gwt.i18n.client.LocalizableResource

Examples of com.google.gwt.i18n.client.LocalizableResource.Key


            return invokeGenericMethod(proxy, (String) args[0],
                    method.getReturnType());
        } else if (method.getParameterTypes().length != 0) {
            return null;
        }
        Key k = method.getAnnotation(Key.class);
        Object result = null;
        if (k != null) {
            result = buildConstant(k.value(), method);
        }
        if (result == null) {
            result = buildConstant(method.getName(), method);
        }
        return result;
View Full Code Here


            throws Throwable {
        if (!String.class.equals(method.getReturnType())) {
            return "Invalid return type of the method " + method.toString();
        }
        // first, try to use the annotation if there is one.
        Key k = method.getAnnotation(Key.class);
        String result = null;
        if (k != null) {
            result = buildMessage(k.value(), method, args);
        }
        if (result == null) {
            result = buildMessage(method.getName(), method, args);
        }
        return result;
View Full Code Here

   protected abstract Object extractFromProperties(Properties localizedProperties, Method method,
            Object[] args, Locale locale) throws Throwable;

   protected String getKey(Method method) {
      Key key = method.getAnnotation(Key.class);
      return key != null ? key.value() : method.getName();
   }
View Full Code Here

   * @return null if unable to get or compute the key for this method, otherwise
   *         the key is returned
   */
  public static String getKey(TreeLogger logger, KeyGenerator keyGenerator,
      JMethod method, boolean isConstants) {
    Key key = method.getAnnotation(Key.class);
    if (key != null) {
      return key.value();
    }
    String text;
    try {
      text = getTextString(method, null, isConstants);
    } catch (AnnotationsError e) {
View Full Code Here

      if (textString == null) {
        // ignore ones without some value annotation
        continue;
      }
      String key = null;
      Key keyAnnot = method.getAnnotation(Key.class);
      if (keyAnnot != null) {
        key = keyAnnot.value();
      } else {
        Message msg = new KeyGenMessage(method);
        key = keyGenerator.generateKey(msg);
        if (key == null) {
          throw new AnnotationsError("Could not compute key for "
View Full Code Here

   * @param method method to get key for
   * @return the key to use for resource lookups or null if unable to get or
   *         compute the key
   */
  protected String getKey(TreeLogger logger, JMethod method) {
    Key key = method.getAnnotation(Key.class);
    if (key != null) {
      return key.value();
    }
    return AnnotationsResource.getKey(logger, keyGenerator, method, isConstants);
  }
View Full Code Here

  }

  public String getKey() {
    KeyGeneratorException keyGenException = null;
    if (key == null) {
      Key keyAnnot = getAnnotation(Key.class);
      if (keyAnnot != null) {
        key = keyAnnot.value();
      } else {
        GenerateKeys keyGenAnnot = getAnnotation(GenerateKeys.class);
        try {
          KeyGenerator keyGen = MessageUtils.getKeyGenerator(keyGenAnnot);
          key = keyGen.generateKey(this);
View Full Code Here

   * @param method method to get key for
   * @return the key to use for resource lookups or null if unable to get or
   *         compute the key
   */
  protected String getKey(TreeLogger logger, JMethod method) {
    Key key = method.getAnnotation(Key.class);
    if (key != null) {
      return key.value();
    }
    return AnnotationsResource.getKey(logger, keyGenerator, method, isConstants);
  }
View Full Code Here

   * @return null if unable to get or compute the key for this method, otherwise
   *         the key is returned
   */
  public static String getKey(TreeLogger logger, KeyGenerator keyGenerator,
      JMethod method, boolean isConstants) {
    Key key = method.getAnnotation(Key.class);
    if (key != null) {
      return key.value();
    }
    String text;
    try {
      text = getTextString(method, null, isConstants);
    } catch (AnnotationsError e) {
View Full Code Here

      if (textString == null) {
        // ignore ones without some value annotation
        continue;
      }
      String key = null;
      Key keyAnnot = method.getAnnotation(Key.class);
      if (keyAnnot != null) {
        key = keyAnnot.value();
      } else {
        key = keyGenerator.generateKey(
            method.getEnclosingType().getQualifiedSourceName(),
            method.getName(), textString, meaningString);
      }
View Full Code Here

TOP

Related Classes of com.google.gwt.i18n.client.LocalizableResource.Key

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.