org.unbescape.css
Enum CssStringEscapeLevel

Object
  extended by Enum<CssStringEscapeLevel>
      extended by org.unbescape.css.CssStringEscapeLevel
All Implemented Interfaces:
Serializable, Comparable<CssStringEscapeLevel>

public enum CssStringEscapeLevel
extends Enum<CssStringEscapeLevel>

Levels defined for escape/unescape operations of CSS strings:

For further information, see the Glossary and the References sections at the documentation for the CssEscape class.

Since:
1.0
Author:
Daniel Fernández

Enum Constant Summary
LEVEL_1_BASIC_ESCAPE_SET
          Level 1 escape: escape only the basic escape set: Backslash Escape plus non-displayable control chars.
LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET
          Level 2 escape: escape the basic escape set plus all non-ASCII characters (result will always be ASCII).
LEVEL_3_ALL_NON_ALPHANUMERIC
          Level 3 escape: escape all non-alphanumeric characteres (escape all but those in the A-Z, a-z and 0-9 ranges).
LEVEL_4_ALL_CHARACTERS
          Level 4 escape: escape all characters, including alphanumeric.
 
Method Summary
static CssStringEscapeLevel forLevel(int level)
           Utility method for obtaining an enum value from its corresponding int level value.
 int getEscapeLevel()
          Return the int escape level.
static CssStringEscapeLevel valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CssStringEscapeLevel[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

LEVEL_1_BASIC_ESCAPE_SET

public static final CssStringEscapeLevel LEVEL_1_BASIC_ESCAPE_SET
Level 1 escape: escape only the basic escape set: Backslash Escape plus non-displayable control chars.


LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET

public static final CssStringEscapeLevel LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET
Level 2 escape: escape the basic escape set plus all non-ASCII characters (result will always be ASCII).


LEVEL_3_ALL_NON_ALPHANUMERIC

public static final CssStringEscapeLevel LEVEL_3_ALL_NON_ALPHANUMERIC
Level 3 escape: escape all non-alphanumeric characteres (escape all but those in the A-Z, a-z and 0-9 ranges).


LEVEL_4_ALL_CHARACTERS

public static final CssStringEscapeLevel LEVEL_4_ALL_CHARACTERS
Level 4 escape: escape all characters, including alphanumeric.

Method Detail

values

public static CssStringEscapeLevel[] 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 (CssStringEscapeLevel c : CssStringEscapeLevel.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CssStringEscapeLevel valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

forLevel

public static CssStringEscapeLevel forLevel(int level)

Utility method for obtaining an enum value from its corresponding int level value.

Parameters:
level - the level
Returns:
the escape level enum constant, or IllegalArgumentException if level does not exist.

getEscapeLevel

public int getEscapeLevel()
Return the int escape level.

Returns:
the escape level.


Copyright © 2014 The UNBESCAPE team. All rights reserved.