Package com.google.gwt.i18n.rebind.util

Examples of com.google.gwt.i18n.rebind.util.AbstractResource


    // Make sure that the type being rebound is in fact an interface.
    if (targetClass.isInterface() == null) {
      throw error(logger, name + " must be an interface");
    }

    AbstractResource resource;
    try {
      resource = ResourceFactory.getBundle(targetClass, locale);
    } catch (MissingResourceException e) {
      throw error(
          logger,
          "Localization failed; there must be at least one properties file accessible through the classpath in package '"
              + packageName
              + "' whose base name is '"
              + ResourceFactory.getResourceName(targetClass) + "'");
    } catch (IllegalArgumentException e) {
      // A bad key can generate an illegal argument exception.
      throw error(logger, e.getMessage());
    }

    // generated implementations for interface X will be named X_, X_en,
    // X_en_CA, etc.
    String realLocale = "_";
    if (resource.getLocale() != null) {
      realLocale += resource.getLocale();
    }
    // Use _ rather than "." in class name, cannot use $
    String resourceName = targetClass.getName().replace('.', '_');
    String className = resourceName + realLocale;
    PrintWriter pw = context.tryCreate(logger, packageName, className);
View Full Code Here

TOP

Related Classes of com.google.gwt.i18n.rebind.util.AbstractResource

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.