com.google.caja.render
Enum TokenClassification
java.lang.Object
java.lang.Enum<TokenClassification>
com.google.caja.render.TokenClassification
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<TokenClassification>
enum TokenClassification
- extends java.lang.Enum<TokenClassification>
Quickly classifies JS and CSS tokens so they can be rendered to an output
stream.
- Author:
- mikesamuel@gmail.com
Method Summary |
(package private) static TokenClassification |
classify(java.lang.CharSequence text)
|
(package private) static boolean |
isComment(java.lang.String s)
|
(package private) static boolean |
isLineComment(java.lang.String s)
|
(package private) static boolean |
isNumber(java.lang.String s)
|
static TokenClassification |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static TokenClassification[] |
values()
Returns an array containing the constants of this enum type, in
the order they're declared. |
Methods inherited from class java.lang.Enum |
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
LINEBREAK
public static final TokenClassification LINEBREAK
SPACE
public static final TokenClassification SPACE
STRING
public static final TokenClassification STRING
REGEX
public static final TokenClassification REGEX
COMMENT
public static final TokenClassification COMMENT
PUNCTUATION
public static final TokenClassification PUNCTUATION
OTHER
public static final TokenClassification OTHER
values
public static final TokenClassification[] values()
- Returns an array containing the constants of this enum type, in
the order they're declared. This method may be used to iterate
over the constants as follows:
for(TokenClassification c : TokenClassification.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they're declared
valueOf
public static TokenClassification 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
classify
static TokenClassification classify(java.lang.CharSequence text)
isNumber
static boolean isNumber(java.lang.String s)
isComment
static boolean isComment(java.lang.String s)
isLineComment
static boolean isLineComment(java.lang.String s)
Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0