|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springmodules.validation.valang.parser.DefaultVisitor
public class DefaultVisitor
Allows registration of custom functions. Custom functions can overwrite default functions.
Default functions are:
Constructor Summary | |
---|---|
DefaultVisitor()
Constructor |
Method Summary | |
---|---|
DefaultDateParser |
getDateParser()
Gets date parser. |
Function |
getFunction(String name,
Function[] arguments,
int line,
int column)
Get a function based on the function name and arguments. |
Function |
getFunction(String className,
String propertyName)
Get bytecode generation function. |
org.apache.commons.collections.Predicate |
getPredicate(Function leftFunction,
Operator operator,
Function rightFunction,
int line,
int column)
Gets predicate. |
ValangVisitor |
getVisitor()
Gets visitor. |
void |
setApplicationContext(ApplicationContext applicationContext)
Implementation of ApplicationContextAware . |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
Implementation of ApplicationEventPublisherAware . |
void |
setBeanFactory(BeanFactory beanFactory)
Implementation of BeanFactoryAware . |
void |
setMessageSource(MessageSource messageSource)
Implementation of MessageSourceAware . |
void |
setResourceLoader(ResourceLoader resourceLoader)
Implementation of ResourceLoaderAware . |
void |
setVisitor(ValangVisitor visitor)
Register a custom visitor to look up custom functions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultVisitor()
Method Detail |
---|
public Function getFunction(String name, Function[] arguments, int line, int column)
getFunction
in interface ValangVisitor
public Function getFunction(String className, String propertyName)
className
- Name of the Class
to generated
a Function
to retrieve a property.propertyName
- The name of the property to retrieve a value from in the function.
For example, expects 'message' and will call getMessage()
.
Function
based on the class and property name.public ValangVisitor getVisitor()
public void setVisitor(ValangVisitor visitor)
Register a custom visitor to look up custom functions. Lookup of functions will first be delegated to this visitor. If no function has been returned (null) lookup will be handled by DefaultVisitor.
visitor
- The custom visitor.public org.apache.commons.collections.Predicate getPredicate(Function leftFunction, Operator operator, Function rightFunction, int line, int column)
leftFunction
- Left comparison Function
.operator
- Operation
for comparison.rightFunction
- Right comparison Function
.line
- Line number of parsed expression.column
- Column number of parsed expression.
public DefaultDateParser getDateParser()
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
BeanFactoryAware
.
setBeanFactory
in interface BeanFactoryAware
BeansException
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
ApplicationContextAware
.
setApplicationContext
in interface ApplicationContextAware
BeansException
public void setResourceLoader(ResourceLoader resourceLoader)
ResourceLoaderAware
.
setResourceLoader
in interface ResourceLoaderAware
public void setMessageSource(MessageSource messageSource)
MessageSourceAware
.
setMessageSource
in interface MessageSourceAware
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
ApplicationEventPublisherAware
.
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |