|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.sesat.commons.visitor.AbstractReflectionVisitor
public abstract class AbstractReflectionVisitor
A helper implementation of the Visitor pattern using java's reflection. This results in not having to add overloaded methods for each subclass of clause as this implementation will automatically find those overloaded methods without explicitly having to call them in each Clause class. This saves alot of work when adding new Clause subclasses. The overloaded method name is specified by VISIT_METHOD_IMPL. See http://www.javaworld.com/javaworld/javatips/jw-javatip98.html
Field Summary | |
---|---|
static String |
VISIT_METHOD_IMPL
String specifying name of method used to overload by any class extending this. |
Constructor Summary | |
---|---|
AbstractReflectionVisitor()
Creates a new instance of AbstractReflectionVisitor. |
Method Summary | |
---|---|
void |
visit(Visitable clause)
Method implementing Visitor interface. |
protected void |
visitImpl(Object clause)
Final fallback method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VISIT_METHOD_IMPL
Constructor Detail |
---|
public AbstractReflectionVisitor()
Method Detail |
---|
public void visit(Visitable clause)
visit
in interface Visitor
clause
- the clause we're visiting.protected void visitImpl(Object clause)
clause
- the clause we're visiting (that's not acutally a clause subtype ;)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |