|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.enhydra.zeus.util.Verifier
Verifier is a Zeus utility class that checks whether
identifiers violate naming rules as defined by the Java language
specification. Verifier applies conversions to such names
(i.e. names that clash with Java reserved words, or names that use
illegal characters). It's assumed that the names being checked are valid
XML names, which limits the amount of checking to be done.
| Field Summary | |
static java.lang.String |
DEFAULT_MAPPING
The default alternative representation for illegal characters. |
static java.lang.String |
XML_PREFIX
Prefix to append to names that clash with Java reserved words. |
| Method Summary | |
static java.lang.String |
getCharMapping(java.lang.Character key)
Returns the value that the given key is mapped to. |
static void |
setCharMapping(java.lang.Character key,
java.lang.String value)
Maps the given key to the given value. |
static java.lang.String |
verify(java.lang.String name)
Verifies whether the given name is a valid Java identifier. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final java.lang.String XML_PREFIX
public static final java.lang.String DEFAULT_MAPPING
| Method Detail |
public static java.lang.String getCharMapping(java.lang.Character key)
Returns the value that the given key is mapped to. This value will
replace any occurence of the key when
is called.
verify(String)
key - the key mapped to the value to return.String - the value the given key is mapped to.
public static void setCharMapping(java.lang.Character key,
java.lang.String value)
Maps the given key to the given value. This value will replace any
occurence of the key when is
called.
verify(String)
key - the key to map the given value to.value - the value to map the given key to.public static java.lang.String verify(java.lang.String name)
Verifies whether the given name is a valid Java identifier. If it is, the name is returned unchanged, else it is returned in a converted form that is a valid Java identifier.
name - the name to check.String - the converted name if it is not a valid Java
identifier, else the same name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||