Enum CSSEncoder.Mode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CSSEncoder.Mode>
    Enclosing class:
    CSSEncoder

    static enum CSSEncoder.Mode
    extends java.lang.Enum<CSSEncoder.Mode>
    Encoding mode of operation--specified the set of characters that required encoding.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      STRING
      String contexts.
      URL
      URL context.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long _highMask
      High bit-mask of unescaped characters.
      private long _lowMask
      Low bit-mask of unescaped characters.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Mode​(ASCIIBits bits)
      Creates a mode with the specified low and high bit-masks.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) long highMask()
      Accessor for _highMask.
      (package private) long lowMask()
      Accessor for _lowMask.
      static CSSEncoder.Mode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CSSEncoder.Mode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • STRING

        public static final CSSEncoder.Mode STRING
        String contexts. Characters between quotes.
           Not allowed: \n \r \f \\ " '  (everything else is allowed)
           Allows: "\\{nl}" (escaped newline)
         
      • URL

        public static final CSSEncoder.Mode URL
        URL context. Characters inside a "url(...)".
           Allowed: [!#$%&*-\[\]-~]|{nonascii}|{escape}
           Escapes: \\[0-9a-f]{1,6}(\s?)
                    \\[^\n\r\f0-9a-f]
         
    • Field Detail

      • _lowMask

        private final long _lowMask
        Low bit-mask of unescaped characters. (Characters 0 to 63)
      • _highMask

        private final long _highMask
        High bit-mask of unescaped characters. (Characters 64 to 127)
    • Constructor Detail

      • Mode

        private Mode​(ASCIIBits bits)
        Creates a mode with the specified low and high bit-masks.
        Parameters:
        bits - the bit-masks of valid characters.
    • Method Detail

      • values

        public static CSSEncoder.Mode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CSSEncoder.Mode c : CSSEncoder.Mode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CSSEncoder.Mode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • lowMask

        long lowMask()
        Accessor for _lowMask.
        Returns:
        _lowMask.
      • highMask

        long highMask()
        Accessor for _highMask.
        Returns:
        _highMask.