public static class StringSwitcher.Generator extends AbstractClassGenerator
AbstractClassGenerator.Source
Constructor and Description |
---|
Generator() |
Modifier and Type | Method and Description |
---|---|
StringSwitcher |
create()
Generate the
StringSwitcher . |
protected java.lang.Object |
firstInstance(java.lang.Class type) |
void |
generateClass(ClassVisitor v) |
protected java.lang.ClassLoader |
getDefaultClassLoader() |
protected java.lang.Object |
nextInstance(java.lang.Object instance) |
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.
|
create, getAttemptLoad, getClassLoader, getClassName, getCurrent, getNamingPolicy, getStrategy, getUseCache, setAttemptLoad, setClassLoader, setNamePrefix, setNamingPolicy, setStrategy, setUseCache
public 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 fasterprotected java.lang.ClassLoader getDefaultClassLoader()
getDefaultClassLoader
in class AbstractClassGenerator
public StringSwitcher create()
StringSwitcher
.public void generateClass(ClassVisitor v) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object firstInstance(java.lang.Class type)
firstInstance
in class AbstractClassGenerator
protected java.lang.Object nextInstance(java.lang.Object instance)
nextInstance
in class AbstractClassGenerator