View Javadoc

1   /*
2    * Copyright 2004-2009 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springmodules.validation.valang.parser;
18  
19  import java.util.Map;
20  
21  import org.springmodules.validation.util.context.ContextAware;
22  
23  /**
24   * Objects that are based on the {@link ValangParser} should implement this interface.
25   *
26   * @author Uri Boness
27   */
28  public interface ValangBased extends ContextAware {
29  
30      /**
31       * Adds the a new custom function to be used in the valang el.
32       *
33       * @param functionName The name of the function.
34       * @param functionClassName The fully qualified class name of the function.
35       */
36      void addCustomFunction(String functionName, String functionClassName);
37  
38      /**
39       * Sets custom functions that should be registered with the used {@link ValangParser}.
40       *
41       * @param functionByName the custom functions where the key is the function name and the value is the function
42       * class FQN.
43       */
44      void setCustomFunctions(Map functionByName);
45  
46      /**
47       * Sets the date parser that should be registered with the used {@link ValangParser}.
48       *
49       * @param parserByRegexp the date parsers where the key is the regexp associated with the parser and the value
50       * is the parser class FQN.
51       */
52      void setDateParsers(Map parserByRegexp);
53  
54  }