public static ExpressionPart getExpressionPartForMethod(SuggestionCompletionEngine sce, String factName, String methodName) { MethodInfo mi = sce.getMethodinfo(factName, methodName); if (SuggestionCompletionEngine.TYPE_COLLECTION.equals(mi.getGenericType())) { return new ExpressionCollection(methodName, mi.getReturnClassType(), mi.getGenericType(), mi.getParametricReturnType()); } return new ExpressionMethod(mi.getName(), mi.getReturnClassType(), mi.getGenericType()); }
public List<String> getMethodParams(String factName, String methodNameWithParams) { if ( methodInfos.get( factName ) != null ) { List<MethodInfo> infos = methodInfos.get( factName ); for ( MethodInfo info : infos ) { if ( info.getNameWithParameters().startsWith( methodNameWithParams ) ) { return info.getParams(); } } } return null; }
public String getMethodClassType(String factName, String methodFullName) { List<MethodInfo> infos = methodInfos.get( factName ); if ( infos != null ) { for ( MethodInfo info : infos ) { if ( info.getNameWithParameters().equals( methodFullName ) ) { return info.getReturnClassType(); } } } return null; }
String genericType = mi.getParametricReturnType(); if ( genericType != null ) { this.builder.putParametricFieldType( shortTypeName + "." + mi.getNameWithParameters(), genericType );
public List<String> getMethodNames() { List<String> methodList = new ArrayList<String>(); for ( MethodInfo info : methods ) { methodList.add( info.getName() ); } return methodList; }
@Override public String toString() { return getNameWithParameters(); } }
public ClassMethodInspector(final Class< ? > clazz, ClassToGenericClassConverter converter) throws IOException { Method[] methods = clazz.getDeclaredMethods(); for ( int i = 0; i < methods.length; i++ ) { Method aMethod = methods[i]; int modifiers = methods[i].getModifiers(); String methodName = aMethod.getName(); if ( isNotGetterOrSetter(aMethod) && isReasonableMethod( clazz, methodName ) && Modifier.isPublic( modifiers ) ) { Class<?>[] listParam = aMethod.getParameterTypes(); MethodInfo info = new MethodInfo(methodName, solveParams(listParam), aMethod.getReturnType(), SuggestionCompletionEngineBuilder .obtainGenericType(aMethod.getGenericReturnType()), converter.translateClassToGenericType(clazz)); this.methods.add(info); } } }
public String getMethodClassType(String factName, String methodFullName) { List<MethodInfo> infos = methodInfos.get( factName ); if ( infos != null ) { for ( MethodInfo info : infos ) { if ( info.getNameWithParameters().equals( methodFullName ) ) { return info.getReturnClassType(); } } } return null; }
String genericType = mi.getParametricReturnType(); if ( genericType != null ) { this.builder.putParametricFieldType( shortTypeName + "." + mi.getNameWithParameters(), genericType );
public List<String> getMethodNames() { List<String> methodList = new ArrayList<String>(); for ( MethodInfo info : methods ) { methodList.add( info.getName() ); } return methodList; }
@Override public String toString() { return getNameWithParameters(); } }
public ClassMethodInspector(final Class< ? > clazz, ClassToGenericClassConverter converter) throws IOException { Method[] methods = clazz.getDeclaredMethods(); for ( int i = 0; i < methods.length; i++ ) { Method aMethod = methods[i]; int modifiers = methods[i].getModifiers(); String methodName = aMethod.getName(); if ( isNotGetterOrSetter(aMethod) && isReasonableMethod( clazz, methodName ) && Modifier.isPublic( modifiers ) ) { Class<?>[] listParam = aMethod.getParameterTypes(); MethodInfo info = new MethodInfo(methodName, solveParams(listParam), aMethod.getReturnType(), SuggestionCompletionEngineBuilder .obtainGenericType(aMethod.getGenericReturnType()), converter.translateClassToGenericType(clazz)); this.methods.add(info); } } }
public static ExpressionPart getExpressionPartForMethod(SuggestionCompletionEngine sce, String factName, String methodName) { MethodInfo mi = sce.getMethodinfo(factName, methodName); if (SuggestionCompletionEngine.TYPE_COLLECTION.equals(mi.getGenericType())) { return new ExpressionCollection(methodName, mi.getReturnClassType(), mi.getGenericType(), mi.getParametricReturnType()); } return new ExpressionMethod(mi.getName(), mi.getReturnClassType(), mi.getGenericType()); }
public List<String> getMethodParams(String factName, String methodNameWithParams) { if ( methodInfos.get( factName ) != null ) { List<MethodInfo> infos = methodInfos.get( factName ); for ( MethodInfo info : infos ) { if ( info.getNameWithParameters().startsWith( methodNameWithParams ) ) { return info.getParams(); } } } return null; }
public List<String> getMethodNames(String factName) { List<MethodInfo> infos = methodInfos.get( factName ); List<String> methodList = new ArrayList<String>(); if ( infos != null ) { for ( MethodInfo info : infos ) { methodList.add( info.getName() ); } } return methodList; }
public MethodInfo getMethodinfo(String factName, String methodFullName) { List<MethodInfo> infos = methodInfos.get( factName ); if ( infos != null ) { for ( MethodInfo info : infos ) { if ( info.getNameWithParameters().equals( methodFullName ) ) { return info; } } } return null; }
public List<String> getMethodFullNames(String factName, int paramCount) { List<MethodInfo> infos = methodInfos.get( factName ); List<String> methodList = new ArrayList<String>(); if ( infos != null ) { for ( MethodInfo info : infos ) { if ( paramCount == -1 || info.getParams().size() <= paramCount ) { methodList.add( info.getNameWithParameters() ); } } } return methodList; }
public List<String> getMethodNames(String factName) { List<MethodInfo> infos = methodInfos.get( factName ); List<String> methodList = new ArrayList<String>(); if ( infos != null ) { for ( MethodInfo info : infos ) { methodList.add( info.getName() ); } } return methodList; }
public MethodInfo getMethodinfo(String factName, String methodFullName) { List<MethodInfo> infos = methodInfos.get( factName ); if ( infos != null ) { for ( MethodInfo info : infos ) { if ( info.getNameWithParameters().equals( methodFullName ) ) { return info; } } } return null; }
public List<String> getMethodFullNames(String factName, int paramCount) { List<MethodInfo> infos = methodInfos.get( factName ); List<String> methodList = new ArrayList<String>(); if ( infos != null ) { for ( MethodInfo info : infos ) { if ( paramCount == -1 || info.getParams().size() <= paramCount ) { methodList.add( info.getNameWithParameters() ); } } } return methodList; }