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  /**
22   * Objects that are based on the {@link ValangParser} should implement this interface.
23   *
24   * @author Uri Boness
25   */
26  public interface ValangBased {
27  
28      /**
29       * Adds the a new custom function to be used in the valang el.
30       *
31       * @param functionName The name of the function.
32       * @param functionClassName The fully qualified class name of the function.
33       */
34      void addCustomFunction(String functionName, String functionClassName);
35  
36      /**
37       * Sets custom functions that should be registered with the used {@link ValangParser}.
38       *
39       * @param functionByName the custom functions where the key is the function name and the value is the function
40       * class FQN.
41       */
42      void setCustomFunctions(Map<String, Object> functionByName);
43  
44      /**
45       * Sets the date parser that should be registered with the used {@link ValangParser}.
46       *
47       * @param parserByRegexp the date parsers where the key is the regexp associated with the parser and the value
48       * is the parser class FQN.
49       */
50      void setDateParsers(Map parserByRegexp);
51  
52  }