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

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


   *
   * @throws AnnotationsError
   */
  public static KeyGenerator getKeyGenerator(JClassType targetClass)
      throws AnnotationsError {
    GenerateKeys generator = getClassAnnotation(targetClass, GenerateKeys.class);
    if (generator != null) {
      String className = generator.value();
      try {
        Class<? extends KeyGenerator> keyGeneratorClass = Class.forName(
            className, false, KeyGenerator.class.getClassLoader()).asSubclass(
            KeyGenerator.class);
        return keyGeneratorClass.newInstance();
View Full Code Here


  public void testGetAnnotation() {
    DefaultLocale defLocale = msgIntf.getAnnotation(DefaultLocale.class);
    assertNotNull(defLocale);
    assertEquals("en-US", defLocale.value());
    GenerateKeys generate = msgIntf.getAnnotation(GenerateKeys.class);
    assertNotNull(generate);
    assertEquals(MD5KeyGenerator.class.getName(), generate.value());
    assertNull(msgIntf.getAnnotation(Documented.class));
  }
View Full Code Here

   *
   * @throws AnnotationsError
   */
  public static KeyGenerator getKeyGenerator(JClassType targetClass)
      throws AnnotationsError {
    GenerateKeys generator = targetClass.getAnnotation(GenerateKeys.class);
    if (generator != null) {
      String className = generator.value();
      try {
        Class<? extends KeyGenerator> keyGeneratorClass = Class.forName(
            className, false, KeyGenerator.class.getClassLoader()).asSubclass(
            KeyGenerator.class);
        return keyGeneratorClass.newInstance();
View Full Code Here

   * @return KeyGenerator instance, guaranteed to not be null
   * @throws AnnotationsError if a specified KeyGenerator cannot be created
   */
  public static KeyGenerator getKeyGenerator(JClassType targetClass)
      throws AnnotationsError {
    GenerateKeys generator = getClassAnnotation(targetClass, GenerateKeys.class);
    try {
      return MessageUtils.getKeyGenerator(generator);
    } catch (KeyGeneratorException e) {
      throw new AnnotationsError(e.getMessage());
    }
View Full Code Here

    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);
        } catch (KeyGeneratorException e) {
          keyGenException  = e;
        }
      }
    }
    if (key == null) {
      GenerateKeys keyGenAnnot = getAnnotation(GenerateKeys.class);
      // If we were unable to get a key, things will fail later.  Instead, fail
      // here where the backtrace has useful information about the cause.
      throw new RuntimeException("null key on "
          + getMessageInterface().getQualifiedName() + "." + getMethodName()
          + ", @GenerateKeys=" + keyGenAnnot + ", defmsg=" + defaultMessage
View Full Code Here

   * @return KeyGenerator instance, guaranteed to not be null
   * @throws AnnotationsError if a specified KeyGenerator cannot be created
   */
  public static KeyGenerator getKeyGenerator(JClassType targetClass)
      throws AnnotationsError {
    GenerateKeys generator = getClassAnnotation(targetClass, GenerateKeys.class);
    if (generator != null) {
      String className = generator.value();
      try {
        Class<? extends KeyGenerator> keyGeneratorClass = Class.forName(
            className, false, KeyGenerator.class.getClassLoader()).asSubclass(
            KeyGenerator.class);
        return keyGeneratorClass.newInstance();
View Full Code Here

   * @return KeyGenerator instance, guaranteed to not be null
   * @throws AnnotationsError if a specified KeyGenerator cannot be created
   */
  public static KeyGenerator getKeyGenerator(JClassType targetClass)
      throws AnnotationsError {
    GenerateKeys generator = getClassAnnotation(targetClass, GenerateKeys.class);
    try {
      return MessageUtils.getKeyGenerator(generator);
    } catch (KeyGeneratorException e) {
      throw new AnnotationsError(e.getMessage());
    }
View Full Code Here

TOP

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

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.