Skip to content

Package: FunctionMapper

FunctionMapper

nameinstructionbranchcomplexitylinemethod
FunctionMapper()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
mapFunction(String, String, Method)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2019 Oracle and/or its affiliates and others.
3: * All rights reserved.
4: * Copyright 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:
19: package jakarta.el;
20:
21: import java.lang.reflect.Method;
22:
23: /**
24: * The interface to a map between Jakarta Expression Language function names and methods.
25: *
26: * <p>
27: * A <code>FunctionMapper</code> maps <code>${prefix:name()}</code> style functions to a static method that can execute
28: * that function.
29: *
30: * @since Jakarta Server Pages 2.1
31: */
32: public abstract class FunctionMapper {
33:
34: /**
35: * Resolves the specified prefix and local name into a <code>java.lang.Method</code>.
36: *
37: * <p>
38: * Returns <code>null</code> if no function could be found that matches the given prefix and local name.
39: * </p>
40: *
41: * @param prefix the prefix of the function, or "" if no prefix. For example, <code>"fn"</code> in
42: * <code>${fn:method()}</code>, or <code>""</code> in <code>${method()}</code>.
43: * @param localName the short name of the function. For example, <code>"method"</code> in <code>${fn:method()}</code>.
44: * @return the static method to invoke, or <code>null</code> if no match was found.
45: */
46: public abstract Method resolveFunction(String prefix, String localName);
47:
48: /**
49: * Adds a static method that can be used as a function.
50: *
51: * @param prefix the prefix of the function, or "" if no prefix. For example, <code>"fn"</code> in
52: * <code>${fn:method()}</code>, or <code>""</code> in <code>${method()}</code>.
53: * @param localName the short name of the function. For example, <code>"method"</code> in <code>${fn:method()}</code>.
54: * @param meth The static method that is to be invoked, when the function is referenced. The null value causes the
55: * function to be removed from the map.
56: *
57: * @since Jakarta Expression Language 3.0
58: */
59: public void mapFunction(String prefix, String localName, Method meth) {
60: }
61: }