Package com.google.gwt.safecss.shared
Class SafeStylesHostedModeUtils
java.lang.Object
com.google.gwt.safecss.shared.SafeStylesHostedModeUtils
SafeStyles utilities whose implementation differs between Development and
Production Mode.
This class has a super-source peer that provides the Production Mode implementation.
Do not use this class - it is used for implementation only, and its methods may change in the future.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of system property that if set, enables checks in server-side code (even if assertions are disabled). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
isValidStyleName
(String name) Check if the specified style property name is valid.static String
isValidStyleValue
(String value) Check if the specified style property value is valid.static void
Checks if the provided string is a valid style property name.static void
maybeCheckValidStyleValue
(String value) Checks if the provided string is a valid style property value.static void
setForceCheckValidStyle
(boolean check) Sets a global flag that controls whether or notmaybeCheckValidStyleName(String)
andmaybeCheckValidStyleValue(String)
should perform their checks in a server-side environment.(package private) static void
Sets a global flag that controls whether or notmaybeCheckValidStyleName(String)
andmaybeCheckValidStyleValue(String)
should perform their checks in a server-side environment from the value of the "com.google.gwt.safecss.ForceCheckValidStyles" property.
-
Field Details
-
FORCE_CHECK_VALID_STYLES
Name of system property that if set, enables checks in server-side code (even if assertions are disabled).- See Also:
-
-
Constructor Details
-
SafeStylesHostedModeUtils
public SafeStylesHostedModeUtils()
-
-
Method Details
-
isValidStyleName
Check if the specified style property name is valid.NOTE: This method does NOT guarantee the safety of a style name. It looks for common errors, but does not check for every possible error. It is intended to help validate a string that the user has already asserted is safe.
- Parameters:
name
- the name to check- Returns:
- null if valid, an error string if not
- See Also:
-
isValidStyleValue
Check if the specified style property value is valid.NOTE: This method does NOT guarantee the safety of a style value. It looks for common errors, but does not check for every possible error. It is intended to help validate a string that the user has already asserted is safe.
- Parameters:
value
- the value to check- Returns:
- null if valid, an error string if not
- See Also:
-
maybeCheckValidStyleName
Checks if the provided string is a valid style property name.- Parameters:
name
- the style name- See Also:
-
maybeCheckValidStyleValue
Checks if the provided string is a valid style property value.- Parameters:
value
- the style value- See Also:
-
setForceCheckValidStyle
public static void setForceCheckValidStyle(boolean check) Sets a global flag that controls whether or notmaybeCheckValidStyleName(String)
andmaybeCheckValidStyleValue(String)
should perform their checks in a server-side environment.- Parameters:
check
- if true, perform server-side checks.
-
setForceCheckValidStyleFromProperty
static void setForceCheckValidStyleFromProperty()Sets a global flag that controls whether or notmaybeCheckValidStyleName(String)
andmaybeCheckValidStyleValue(String)
should perform their checks in a server-side environment from the value of the "com.google.gwt.safecss.ForceCheckValidStyles" property.
-