net.sf.cglib.util

Class StringSwitcher.Generator

Enclosing Class:
StringSwitcher
Implemented Interfaces:
ClassGenerator

public static class StringSwitcher.Generator
extends AbstractClassGenerator

Constructor Summary

Generator()

Method Summary

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(String[] strings)
Set the array of recognized Strings.

Methods inherited from class net.sf.cglib.core.AbstractClassGenerator

getAttemptLoad, getClassLoader, getCurrent, getNamingPolicy, getStrategy, getUseCache, setAttemptLoad, setClassLoader, setNamingPolicy, setStrategy, setUseCache

Constructor Details

Generator

public Generator()

Method Details

create

public StringSwitcher create()
Generate the StringSwitcher.

generateClass

public void generateClass(ClassVisitor v)
            throws Exception
Specified by:
generateClass in interface ClassGenerator

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.Generator as -1; if true, the result will be undefined, and the resulting code will be faster

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

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

Copyright (c) 2001 - Apache Software Foundation