JMethod[] methods = c.getMethods(); if (methods != null) { for (JMethod m : methods) {
JMethod[] methods = c.getMethods(); if (methods != null) { for (JMethod m : methods) {
createTypeInvokables(c, varName, "Method", c.getMethods()); if (c.isPublic() && !c.isAbstract() && (c.getEnclosingType() == null || c.isStatic())) { createTypeInvokables(c, varName, "Constructor", c.getConstructors());
createTypeInvokables(c, varName, "Method", c.getMethods()); if (c.isPublic() && !c.isAbstract() && (c.getEnclosingType() == null || c.isStatic())) { createTypeInvokables(c, varName, "Constructor", c.getConstructors());
@Override public Iterable<Message> getMessages() throws MessageProcessingException { JMethod[] methods = type.getMethods(); List<Message> messages = new ArrayList<Message>(); for (JMethod method : methods) { messages.add(new TypeOracleMessage(oracle, factory, this, method, resources)); } Collections.sort(messages); return Collections.unmodifiableList(messages); }
public static JMethod methodByName(JClassType type, String methodName) { for (JMethod method : type.getMethods()) { if (method.getName().equals(methodName)) { return method; } } return null; }
@Override public Iterable<Message> getMessages() throws MessageProcessingException { JMethod[] methods = type.getMethods(); List<Message> messages = new ArrayList<Message>(); for (JMethod method : methods) { messages.add(new TypeOracleMessage(oracle, factory, this, method, resources)); } Collections.sort(messages); return Collections.unmodifiableList(messages); }
private static Collection<JMethod> watchMethods(JClassType type) { Collection<JMethod> methods = new ArrayList<JMethod>(); for (JMethod method : type.getMethods()) { if (method.getAnnotation(NgWatch.class) == null) { continue; } methods.add(method); } return methods; }
/** * Checks whether or not a method with the following name exists without * taking care of the method signature * @param methodName * @return */ public boolean containsMethod(String methodName){ for(JMethod m : type.getMethods()){ if (m.getName().equals(methodName)){ return true; } } return false; }
private void extractAllMethods(final JClassType uiModel, final JPrimitiveType voidType) { for (final JClassType type : uiModel.getFlattenedSupertypeHierarchy()) { for (final JMethod method : type.getMethods()) { if (isGetterMethod(method, voidType)) { final String name = toSimpleName(method); if (!methods.containsKey(name)) { methods.put(name, method); } } } } }
public static Collection<JMethod> publicMethods(JClassType type) { Collection<JMethod> methods = new ArrayList<JMethod>(); for (JMethod method : type.getMethods()) { if (method.isPublic() && !method.isAbstract() && !method.isStatic()) { methods.add(method); } } return methods; }
private List<JMethod> getUiHandlers(JClassType ownerClass) { List<JMethod> uiHandlerMethods = new ArrayList<JMethod>(); JMethod[] methods = ownerClass.getMethods(); for (JMethod method : methods) { if(method.isAnnotationPresent(GxtUiHandler.class)) { uiHandlerMethods.add(method); } } JClassType superclass = ownerClass.getSuperclass(); if (superclass != null) { uiHandlerMethods.addAll(getUiHandlers(superclass)); } return uiHandlerMethods; } }
protected Map<String, JType> fetchColumnConfigProperties( JClassType columnConfigType) { Map<String, JType> columnConfigSetterTypes = new HashMap<String, JType>(); JMethod[] columnConfigTypeMethods = columnConfigType.getMethods(); for (JMethod jMethod : columnConfigTypeMethods) { if (jMethod.getName().startsWith("set") && jMethod.getParameters().length == 1) { columnConfigSetterTypes.put(jMethod.getName(), jMethod.getParameters()[0].getType()); } } return columnConfigSetterTypes; }
@Override public MetaMethod[] getDeclaredMethods() { final JClassType type = getEnclosedMetaObject().isClassOrInterface(); if (type == null) { return null; } return fromMethodArray(oracle, type.getMethods()); }
@Override public MetaMethod[] getDeclaredMethods() { final JClassType type = getEnclosedMetaObject().isClassOrInterface(); if (type == null) { return null; } return fromMethodArray(oracle, type.getMethods()); }
private static Iterable<JMethod> getTestMethods(JClassType requestedClass) { Map<String, JMethod> methodMap = new HashMap<String, JMethod>(); for (JClassType cls = requestedClass; cls != null; cls = cls.getSuperclass()) { for (JMethod declMethod : cls.getMethods()) { if (isJUnitTestMethod(declMethod)) { putIfAbsent(methodMap, declMethod); } } } return methodMap.values(); }
private static JClassType findImplementingTypeForMethod(JClassType type, JMethod method) { JType[] methodParamTypes = method.getErasedParameterTypes(); while (type != null) { for (JMethod candidate : type.getMethods()) { if (hasMatchingErasedSignature(method, methodParamTypes, candidate)) { return type; } } type = type.getSuperclass(); } return null; }
private static JClassType findImplementingTypeForMethod(JClassType type, JMethod method) { JType[] methodParamTypes = method.getErasedParameterTypes(); while (type != null) { for (JMethod candidate : type.getMethods()) { if (hasMatchingErasedSignature(method, methodParamTypes, candidate)) { return type; } } type = type.getSuperclass(); } return null; }
private static Iterable<JMethod> getTestMethods(JClassType requestedClass) { Map<String, JMethod> methodMap = new HashMap<String, JMethod>(); for (JClassType cls = requestedClass; cls != null; cls = cls.getSuperclass()) { for (JMethod declMethod : cls.getMethods()) { if (isJUnitTestMethod(declMethod)) { putIfAbsent(methodMap, declMethod); } } } return methodMap.values(); }
protected void addSetters(JClassType cls, List<JMethod> methods) { if (cls.getSuperclass() != null) { addSetters(cls.getSuperclass(), methods); } for (JMethod m : cls.getMethods()) { if (m.isPublic() || m.isProtected()) { String name = m.getName(); if (name.matches("set.*") && m.getParameters().length == 1) { methods.add(m); } } } }