org.terrier.utility
Enum StringTools.ESCAPE

java.lang.Object
  extended by java.lang.Enum<StringTools.ESCAPE>
      extended by org.terrier.utility.StringTools.ESCAPE
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<StringTools.ESCAPE>
Enclosing class:
StringTools

public static enum StringTools.ESCAPE
extends java.lang.Enum<StringTools.ESCAPE>

Defines escape encodings that are supported. Most are implemented using org.apache.commons.lang.StringEscapeUtils. See methods escape() and unescape() in StringTools.

Since:
3.0
Author:
Craig Macdonald

Enum Constant Summary
HTML
          Escape any characters unsuitable for HTML in the String
JAVA
          Escape any characters unsuitable for Java source code in the String
JAVASCRIPT
          Escape any characters unsuitable for Javascript source code in the String
NONE
          Perform no escaping on the String
URL
          Escape any characters unsuitable for a URL within the String
XML
          Escape any characters unsuitable for XML in the String
 
Method Summary
static StringTools.ESCAPE parse(java.lang.String s)
          Parse a string into an ESCAPE value.
static StringTools.ESCAPE valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static StringTools.ESCAPE[] 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

NONE

public static final StringTools.ESCAPE NONE
Perform no escaping on the String


HTML

public static final StringTools.ESCAPE HTML
Escape any characters unsuitable for HTML in the String


XML

public static final StringTools.ESCAPE XML
Escape any characters unsuitable for XML in the String


JAVA

public static final StringTools.ESCAPE JAVA
Escape any characters unsuitable for Java source code in the String


JAVASCRIPT

public static final StringTools.ESCAPE JAVASCRIPT
Escape any characters unsuitable for Javascript source code in the String


URL

public static final StringTools.ESCAPE URL
Escape any characters unsuitable for a URL within the String

Method Detail

values

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

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

valueOf

public static StringTools.ESCAPE 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

parse

public static StringTools.ESCAPE parse(java.lang.String s)
Parse a string into an ESCAPE value. Allowed values are html, xml, java, javascript, url



Terrier 3.5. Copyright © 2004-2011 University of Glasgow