站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

ReflectiveVisitorHelper (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.core
Class ReflectiveVisitorHelper

java.lang.Object
  extended by org.springframework.core.ReflectiveVisitorHelper

public final class ReflectiveVisitorHelper
extends Object

Helper implementation for a reflective visitor. Mainly for internal use within the framework.

To use, call invokeVisit, passing a Visitor object and the data argument to accept (double-dispatch). For example:

   public String styleValue(Object value) {
     reflectiveVistorSupport.invokeVisit(this, value)
   }
  
   // visit call back will be invoked via reflection
   String visit(<valueType> arg) {
     // process argument of type <valueType>
   }
 
See the DefaultValueStyler class for a concrete usage.

Since:
1.2.2
Author:
Keith Donald
See Also:
DefaultValueStyler

Constructor Summary
ReflectiveVisitorHelper()
           
 
Method Summary
 Object invokeVisit(Object visitor, Object argument)
          Use reflection to call the appropriate visit method on the provided visitor, passing in the specified argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectiveVisitorHelper

public ReflectiveVisitorHelper()
Method Detail

invokeVisit

public Object invokeVisit(Object visitor,
                          Object argument)
Use reflection to call the appropriate visit method on the provided visitor, passing in the specified argument.

Parameters:
visitor - the visitor encapsulating the logic to process the argument
argument - the argument to dispatch
Throws:
IllegalArgumentException - if the visitor parameter is null

The Spring Framework

Copyright © 2002-2007 The Spring Framework.