View Javadoc

1   /*
2    * $Id: BSFManagerFilter.java 421159 2006-07-12 06:14:52Z wsmoak $
3    *
4    * Copyright 2000-2004 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.struts.scripting;
19  
20  // util imports:
21  import java.util.Properties;
22  
23  // misc imports:
24  import org.apache.bsf.BSFManager;
25  
26  
27  /***
28   *  Defines a class that wants to manipulate the contents of the scripting
29   *  context before the script is executed. An example would be a class that puts
30   *  business facade classes in the context.
31   */
32  public interface BSFManagerFilter {
33  
34      /***
35       *  Initializes the filter. Properties can be retrieved as: <code>
36       *  struts-scripting.filters.FILTER_NAME.PROPERTY_NAME=PROPERTY_VALUE
37       *  </code> where FILTER_NAME is the "name" parameter.
38       *
39       *@param  name   The name of the filter
40       *@param  props  The properties
41       */
42      void init(String name, Properties props);
43  
44  
45      /***
46       *  Applies the filter.
47       *
48       *@param  mgr  The scripting manager
49       *@return      The scripting manager
50       */
51      BSFManager apply(BSFManager mgr);
52  }