Package org.springframework.cglib.util

# Class StringSwitcher.Generator

java.lang.Object
org.springframework.cglib.core.AbstractClassGenerator
org.springframework.cglib.util.StringSwitcher.Generator

All Implemented Interfaces:
  `ClassGenerator`

Enclosing class:
  StringSwitcher

public static class StringSwitcher.Generator extends AbstractClassGenerator

## Nested Class Summary

## Nested classes/interfaces inherited from class org.springframework.cglib.core.AbstractClassGenerator

`AbstractClassGenerator.ClassLoaderData, AbstractClassGenerator.Source`

## Constructor Summary

Constructors
Constructor
Description
`Generator()`

## Method Summary

Modifier and Type
Method
Description
`StringSwitcher`
`create()`
Generate the `StringSwitcher`.
`protected Object`
`firstInstance(Class type)`
`void`
`generateClass(ClassVisitor v)`
`protected ClassLoader`
`getDefaultClassLoader()`
`protected Object`
`nextInstance(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(String[] strings)`
Set the array of recognized Strings.

### Methods inherited from class org.springframework.cglib.core.AbstractClassGenerator

`create, generate, getAttemptLoad, getClassLoader, getClassName, getCurrent, getNamingPolicy, getProtectionDomain, getStrategy, getUseCache, setAttemptLoad, setClassLoader, setContextClass, setNamePrefix, setNamingPolicy, setStrategy, setUseCache, unwrapCachedValue, wrapCachedClass`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Generator

public Generator()

## Method Details

### setStrings

public void setStrings(String[] strings)
Set the array of recognized Strings.

Parameters:
  `strings` - the array of String keys; must be the same length as the value array
See Also:
  - `setInts(int[])`

### setInts

public void setInts(int[] ints)
Set the array of integer results.

Parameters:
  `ints` - the array of integer results; must be the same length as the key array
See Also:
  - `setStrings(java.lang.String[])`

### setFixedInput

public void setFixedInput(boolean fixedInput)
Configure how unknown String keys will be handled.

Parameters:
  `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 faster

### getDefaultClassLoader

protected ClassLoader getDefaultClassLoader()

Specified by:
  `getDefaultClassLoader` in class `AbstractClassGenerator`

### create

public StringSwitcher create()
Generate the `StringSwitcher`.

### generateClass

public void generateClass(ClassVisitor v) throws Exception

Throws:
  `Exception`

### firstInstance

protected Object firstInstance(Class type)

Specified by:
  `firstInstance` in class `AbstractClassGenerator`

### nextInstance

protected Object nextInstance(Object instance)

Specified by:
  `nextInstance` in class `AbstractClassGenerator`