MCPcopy Create free account
hub / github.com/BaseXdb/basex / method

Method method

basex-core/src/main/java/org/basex/util/Reflect.java:141–156  ·  view source on GitHub ↗

Finds a public, protected or private method by name and parameter types. @param clazz class to search for the method @param name method name @param types method parameters @return method, or null if the method is not found

(final Class<?> clazz, final String name, final Class<?>... types)

Source from the content-addressed store, hash-verified

139 * @return method, or {@code null} if the method is not found
140 */
141 public static Method method(final Class<?> clazz, final String name, final Class<?>... types) {
142 if(clazz == null) return null;
143 Method m = null;
144 try {
145 try {
146 m = clazz.getMethod(name, types);
147 } catch(final Throwable ex) {
148 Util.debug(ex);
149 m = clazz.getDeclaredMethod(name, types);
150 m.setAccessible(true);
151 }
152 } catch(final Throwable ex) {
153 Util.debug(ex);
154 }
155 return m;
156 }
157
158 /**
159 * Returns a class instance.

Callers 12

FunctionsClass · 0.95
XsltReportClass · 0.95
XsltFnClass · 0.95
ModuleLoaderClass · 0.95
addMethod · 0.95
SnowballStemmerClass · 0.95
JapaneseTokenizerClass · 0.95
WordnetStemmerClass · 0.95
newDictMethod · 0.95
LogTargetEnum · 0.95
sendMethod · 0.45
callMethod · 0.45

Calls 1

debugMethod · 0.95

Tested by 1

callMethod · 0.36