|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.test.Creator
public class Creator
A utility class that is used to instantiate abstract Tapestry pages and components. It creates,
at runtime, a subclass where all abstract properties are filled in (each property complete with
an instance variable, an accessor method and a mutator method). This isn't quite the same as how
the class is enhanced at runtime (though it does use a subset of the same
code
), but is sufficient to unit test the
class, especially listener methods.
One part of the enhancement is that the
specification
and
messages
properties of the page or
component class are converted into read/write properties that can be set via reflection
(including newInstance(Class, Map)
.
Constructor Summary | |
---|---|
Creator()
|
Method Summary | |
---|---|
Object |
newInstance(Class abstractClass)
Given a particular abstract class; will create an instance of that class. |
Object |
newInstance(Class abstractClass,
Map properties)
Creates a new instance of a given class, and then initializes properties of the instance. |
Object |
newInstance(Class abstractClass,
Object[] properties)
A convienience (useful in test code) for invoking newInstance(Class, Map) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Creator()
Method Detail |
---|
public Object newInstance(Class abstractClass)
public Object newInstance(Class abstractClass, Map properties)
public Object newInstance(Class abstractClass, Object[] properties)
newInstance(Class, Map)
. The Map
is constructed from the properties array, which consists of alternating keys and values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |