本文整理汇总了Java中org.codehaus.groovy.reflection.CachedClass.getMethods方法的典型用法代码示例。如果您正苦于以下问题:Java CachedClass.getMethods方法的具体用法?Java CachedClass.getMethods怎么用?Java CachedClass.getMethods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.groovy.reflection.CachedClass
的用法示例。
在下文中一共展示了CachedClass.getMethods方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyUse
import org.codehaus.groovy.reflection.CachedClass; //导入方法依赖的package包/类
private void applyUse(CachedClass cachedClass) {
CachedMethod[] methods = cachedClass.getMethods();
for (CachedMethod cachedMethod : methods) {
if (cachedMethod.isStatic() && cachedMethod.isPublic()) {
CachedClass[] paramTypes = cachedMethod.getParameterTypes();
if (paramTypes.length > 0) {
CachedClass metaClass = paramTypes[0];
CategoryMethod mmethod = new CategoryMethod(cachedMethod, metaClass.getTheClass());
final String name = cachedMethod.getName();
CategoryMethodList list = get(name);
if (list == null || list.level != level) {
list = new CategoryMethodList(name, level, list);
put(name, list);
}
list.add(mmethod);
Collections.sort(list);
cachePropertyAccessor(mmethod);
}
}
}
}
示例2: createMetaMethods
import org.codehaus.groovy.reflection.CachedClass; //导入方法依赖的package包/类
private static void createMetaMethods(final Class extensionClass, final List<MetaMethod> metaMethods, final boolean isStatic) {
CachedClass cachedClass = ReflectionCache.getCachedClass(extensionClass);
CachedMethod[] methods = cachedClass.getMethods();
for (CachedMethod method : methods) {
if (method.isStatic() && method.isPublic() && method.getParamsCount() > 0) {
// an extension method is found
metaMethods.add(isStatic?new NewStaticMetaMethod(method) : new NewInstanceMetaMethod(method));
}
}
}
示例3: addInterfaceMethods
import org.codehaus.groovy.reflection.CachedClass; //导入方法依赖的package包/类
private void addInterfaceMethods(Set<CachedClass> interfaces) {
MetaMethodIndex.Header header = metaMethodIndex.getHeader(theClass);
for (CachedClass c : interfaces) {
final CachedMethod[] m = c.getMethods();
for (int i = 0; i != m.length; ++i) {
MetaMethod method = m[i];
addMetaMethodToIndex(method, header);
}
}
}