public static class StringSwitcher.Generator extends AbstractClassGenerator
| Constructor and Description |
|---|
StringSwitcher.Generator() |
| Modifier and Type | Method and Description |
|---|---|
StringSwitcher |
create()
Generate the
StringSwitcher. |
void |
generateClass(ClassVisitor v) |
void |
setFixedInput(boolean fixedInput)
Configure how unknown String keys will be handled.
|
void |
setInts(int[] ints)
Set the array of integer results.
|
void |
setStrings(java.lang.String[] strings)
Set the array of recognized Strings.
|
getAttemptLoad, getClassLoader, getCurrent, getNamingPolicy, getStrategy, getUseCache, setAttemptLoad, setClassLoader, setNamingPolicy, setStrategy, setUseCachepublic void setStrings(java.lang.String[] strings)
strings - the array of String keys; must be the same length as the value arraysetInts(int[])public void setInts(int[] ints)
ints - the array of integer results; must be the same length as the key arraysetStrings(java.lang.String[])public void setFixedInput(boolean fixedInput)
fixedInput - if false, an unknown key will be returned from StringSwitcher.intValue(java.lang.String) as -1; if true,
the result will be undefined, and the resulting code will be fasterpublic StringSwitcher create()
StringSwitcher.public void generateClass(ClassVisitor v)
throws java.lang.Exception
java.lang.ExceptionCopyright (c) 2001 - Apache Software Foundation