1 package org.simantics.scl.compiler.internal.codegen.types;
3 import org.cojen.classfile.TypeDesc;
4 import org.simantics.scl.compiler.constants.generic.ClassRef;
6 @SuppressWarnings("hiding")
7 public interface JavaReferenceValidator<Class,Method,Field,Constructor> {
10 * Tries to find the given class or returns null if the class
13 Class findClass(TypeDesc name);
15 boolean isInterface(Class clazz);
17 boolean isPublic(Class clazz);
20 * Finds all methods that are compatible with type
21 * <pre>types[0] -> types[1] -> ... -> types[types.length-1]</pre>
23 Method[] findCompatibleMethods(Class clazz, boolean isStatic, String name,
24 TypeDesc[] parameterTypes, TypeDesc returnType);
25 TypeDesc getReturnType(Method method);
26 TypeDesc[] getParameterTypes(Method method);
28 Constructor[] findCompatibleConstructors(Class clazz, TypeDesc[] types);
29 TypeDesc[] getConstructorParameterTypes(Constructor constructor);
31 Field findField(Class clazz, String name);
32 boolean isStaticField(Field field);
33 TypeDesc getFieldType(Field field);
34 boolean isAssignableFrom(TypeDesc to, TypeDesc from);
36 Method[] chooseBest(Method[] methods);
39 * Returns a class ref object to the class or null if the
42 ClassRef getClassRef(String className);