|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.i18n.linker.LocalePropertyProviderGenerator
public class LocalePropertyProviderGenerator
Generates a property provider implementation for the "locale" property.
Field Summary | |
---|---|
protected static java.util.regex.Pattern |
COOKIE_PATTERN
|
static java.lang.String |
LOCALE_COOKIE
|
static java.lang.String |
LOCALE_QUERYPARAM
|
static java.lang.String |
LOCALE_SEARCHORDER
|
static java.lang.String |
LOCALE_USEMETA
|
static java.lang.String |
LOCALE_USERAGENT
|
protected static java.util.regex.Pattern |
QUERYPARAM_PATTERN
|
Constructor Summary | |
---|---|
LocalePropertyProviderGenerator()
|
Method Summary | |
---|---|
java.lang.String |
generate(TreeLogger logger,
java.util.SortedSet<java.lang.String> possibleValues,
java.lang.String fallback,
java.util.SortedSet<ConfigurationProperty> configProperties)
Generate a property provider. |
protected void |
generateCookieLookup(TreeLogger logger,
com.google.gwt.user.rebind.SourceWriter body,
java.lang.String cookieName)
Generate JS code that looks up the locale value from a cookie. |
protected void |
generateInheritanceLookup(TreeLogger logger,
com.google.gwt.user.rebind.SourceWriter body)
Generate JS code that takes the value of the "locale" variable and finds parent locales until the value is a supported locale or the default locale. |
protected void |
generateMetaLookup(TreeLogger logger,
com.google.gwt.user.rebind.SourceWriter body)
Generate JS code to fetch the locale from a meta property. |
protected void |
generateQueryParamLookup(TreeLogger logger,
com.google.gwt.user.rebind.SourceWriter body,
java.lang.String queryParam)
Generate JS code to get the locale from a query parameter. |
protected void |
generateUserAgentLookup(TreeLogger logger,
com.google.gwt.user.rebind.SourceWriter body)
Generate JS code to fetch the locale from the user agent's compile-time locale. |
protected static boolean |
isTrue(java.lang.String value)
Return true when the supplied value represents a true/yes/on value. |
protected boolean |
validateCookieName(java.lang.String cookieName)
Validate that a name is a valid cookie name. |
protected boolean |
validateQueryParam(java.lang.String queryParam)
Validate that a value is a valid query parameter name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LOCALE_QUERYPARAM
public static final java.lang.String LOCALE_COOKIE
public static final java.lang.String LOCALE_SEARCHORDER
public static final java.lang.String LOCALE_USEMETA
public static final java.lang.String LOCALE_USERAGENT
protected static final java.util.regex.Pattern COOKIE_PATTERN
protected static final java.util.regex.Pattern QUERYPARAM_PATTERN
Constructor Detail |
---|
public LocalePropertyProviderGenerator()
Method Detail |
---|
protected static boolean isTrue(java.lang.String value)
value
-
public java.lang.String generate(TreeLogger logger, java.util.SortedSet<java.lang.String> possibleValues, java.lang.String fallback, java.util.SortedSet<ConfigurationProperty> configProperties) throws UnableToCompleteException
PropertyProviderGenerator
generate
in interface PropertyProviderGenerator
logger
- TreeLoggerpossibleValues
- the possible values of this propertyfallback
- the fallback value for this property, or nullconfigProperties
- the configuration properties for this module
UnableToCompleteException
- after logging the message if processing
is unable to continueprotected void generateCookieLookup(TreeLogger logger, com.google.gwt.user.rebind.SourceWriter body, java.lang.String cookieName) throws UnableToCompleteException
logger
- logger to usebody
- cookieName
-
UnableToCompleteException
protected void generateInheritanceLookup(TreeLogger logger, com.google.gwt.user.rebind.SourceWriter body) throws UnableToCompleteException
logger
- logger to usebody
-
UnableToCompleteException
protected void generateMetaLookup(TreeLogger logger, com.google.gwt.user.rebind.SourceWriter body) throws UnableToCompleteException
logger
- logger to usebody
-
UnableToCompleteException
protected void generateQueryParamLookup(TreeLogger logger, com.google.gwt.user.rebind.SourceWriter body, java.lang.String queryParam) throws UnableToCompleteException
logger
- logger to usebody
- where to append JS outputqueryParam
- the query parameter to use
UnableToCompleteException
protected void generateUserAgentLookup(TreeLogger logger, com.google.gwt.user.rebind.SourceWriter body) throws UnableToCompleteException
logger
- logger to usebody
-
UnableToCompleteException
protected boolean validateCookieName(java.lang.String cookieName)
cookieName
-
protected boolean validateQueryParam(java.lang.String queryParam)
queryParam
-
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |