X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Finternal%2Fcodegen%2Ftypes%2FJavaReferenceValidator.java;h=189dcb2eb385a9d88029a9b9dddaad916d055b0f;hp=21f775e53e66be29c7563f03ca8a1dcdda4080a9;hb=c26409b1caf2f1e560d37c5befd11b442399c3fe;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/types/JavaReferenceValidator.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/types/JavaReferenceValidator.java index 21f775e53..189dcb2eb 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/types/JavaReferenceValidator.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/types/JavaReferenceValidator.java @@ -1,43 +1,45 @@ -package org.simantics.scl.compiler.internal.codegen.types; - -import org.cojen.classfile.TypeDesc; -import org.simantics.scl.compiler.constants.generic.ClassRef; - -@SuppressWarnings("hiding") -public interface JavaReferenceValidator { - - /** - * Tries to find the given class or returns null if the class - * does not exist. - */ - Class findClass(TypeDesc name); - - boolean isInterface(Class clazz); - - boolean isPublic(Class clazz); - - /** - * Finds all methods that are compatible with type - *
types[0] -> types[1] -> ... -> types[types.length-1]
- */ - Method[] findCompatibleMethods(Class clazz, boolean isStatic, String name, - TypeDesc[] parameterTypes, TypeDesc returnType); - TypeDesc getReturnType(Method method); - TypeDesc[] getParameterTypes(Method method); - - Constructor[] findCompatibleConstructors(Class clazz, TypeDesc[] types); - TypeDesc[] getConstructorParameterTypes(Constructor constructor); - - Field findField(Class clazz, String name); - boolean isStaticField(Field field); - TypeDesc getFieldType(Field field); - boolean isAssignableFrom(TypeDesc to, TypeDesc from); - - Method[] chooseBest(Method[] methods); - - /** - * Returns a class ref object to the class or null if the - * class is not found. - */ - ClassRef getClassRef(String className); -} +package org.simantics.scl.compiler.internal.codegen.types; + +import org.cojen.classfile.TypeDesc; +import org.simantics.scl.compiler.constants.generic.ClassRef; + +@SuppressWarnings("hiding") +public interface JavaReferenceValidator { + + /** + * Tries to find the given class or returns null if the class + * does not exist. + */ + Class findClass(TypeDesc name); + + boolean isInterface(Class clazz); + + boolean isPublic(Class clazz); + + /** + * Finds all methods that are compatible with type + *
types[0] -> types[1] -> ... -> types[types.length-1]
+ */ + Method[] findCompatibleMethods(Class clazz, boolean isStatic, String name, + TypeDesc[] parameterTypes, TypeDesc returnType); + TypeDesc getReturnType(Method method); + TypeDesc[] getParameterTypes(Method method); + + Constructor[] findCompatibleConstructors(Class clazz, TypeDesc[] types); + TypeDesc[] getConstructorParameterTypes(Constructor constructor); + + Field findField(Class clazz, String name); + boolean isStaticField(Field field); + TypeDesc getFieldType(Field field); + boolean isAssignableFrom(TypeDesc to, TypeDesc from); + + Method[] chooseBest(Method[] methods); + + /** + * Returns a class ref object to the class or null if the + * class is not found. + */ + ClassRef getClassRef(String className); + + ClassLoader getClassLoader(); +}