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

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


        && isMethodOf(method, ConstantsWithLookup.class)) {
      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


  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    if (!String.class.equals(method.getReturnType())) {
      return "Invalid return type of the method " + method.toString(); //$NON-NLS-1$
    }
    //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

   * @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

   * @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();
    }
    String[][] id = method.getMetaData(LocalizableGenerator.GWT_KEY);
    if (id.length > 0) {
      warnOnMetadata(method);
      if (id[0].length == 0) {
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

   * @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();
    }
    String[][] id = method.getMetaData(LocalizableGenerator.GWT_KEY);
    if (id.length > 0) {
      warnOnMetadata(method);
      if (id[0].length == 0) {
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

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.