|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jwalk.gen.InterfaceGenerator
public class InterfaceGenerator
InterfaceGenerator is a custom generator of values for interface types.
There is no general solution in Java to providing value synthesis for all
interface types. This InterfaceGenerator is a partial work-around that
synthesises values of suitable concrete object-types to satisfy a number
of commonly-used interfaces. If the user needs to generate values for
other interface-types, or more generally, for any abstract type, then
a suitable custom generator must be provided to recognise these types
and create instances of matching concrete types.
InterfaceGenerator synthesises values of the abstract collection types:
CharSequence, Collection, List, Set and Map.
Constructor Summary | |
---|---|
InterfaceGenerator()
|
Method Summary | |
---|---|
boolean |
canCreate(java.lang.Class<?> type)
Reports whether this InterfaceGenerator can create a given type. |
java.lang.Object |
nextValue(java.lang.Class<?> type)
Creates the next value in sequence for the requested interface. |
void |
setOwner(MasterGenerator generator)
Sets the owner of this InterfaceGenerator to a MasterGenerator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InterfaceGenerator()
Method Detail |
---|
public boolean canCreate(java.lang.Class<?> type)
canCreate
in interface Generator
type
- the requested type.
public java.lang.Object nextValue(java.lang.Class<?> type) throws GeneratorException
nextValue
in interface Generator
type
- the requested type.
GeneratorException,
- if no value of this type could be
synthesised.
GeneratorException
- if no value of this type could be
synthesised.public void setOwner(MasterGenerator generator)
setOwner
in interface CustomGenerator
generator
- the MasterGenerator of this CustomGenerator.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |