Class SafeStylesHostedModeUtils


  • public class SafeStylesHostedModeUtils
    extends java.lang.Object
    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 Detail

      • FORCE_CHECK_VALID_STYLES

        public static final java.lang.String FORCE_CHECK_VALID_STYLES
        Name of system property that if set, enables checks in server-side code (even if assertions are disabled).
        See Also:
        Constant Field Values
    • Constructor Detail

      • SafeStylesHostedModeUtils

        public SafeStylesHostedModeUtils()
    • Method Detail

      • isValidStyleName

        public static java.lang.String isValidStyleName​(java.lang.String name)
        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:
        CSS 2.1 identifiers
      • isValidStyleValue

        public static java.lang.String isValidStyleValue​(java.lang.String value)
        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:
        CSS 2.1 declarations and properties
      • maybeCheckValidStyleName

        public static void maybeCheckValidStyleName​(java.lang.String name)
        Checks if the provided string is a valid style property name.
        Parameters:
        name - the style name
        See Also:
        CSS 2.1 identifiers
      • maybeCheckValidStyleValue

        public static void maybeCheckValidStyleValue​(java.lang.String value)
        Checks if the provided string is a valid style property value.
        Parameters:
        value - the style value
        See Also:
        CSS 2.1 declarations and properties