Package gw.internal.gosu.parser
Class TypeRefFactory
java.lang.Object
gw.internal.gosu.parser.TypeRefFactory
- All Implemented Interfaces:
ITypeRefFactory
There is one TypeRefFactory per ModuleTypeLoader.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final WeakFqnCache<AbstractTypeRef>
private static boolean
private static final Map<Class<? extends IType>,
Class<? extends AbstractTypeRef>> private static final int
private static boolean
private static boolean
Fields inherited from interface gw.lang.reflect.ITypeRefFactory
SYSTEM_PROXY_SUFFIX, USER_PROXY_SUFFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addDefaultConstructor
(org.objectweb.asm.ClassVisitor cv) private void
assignType
(Method ifaceMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex) private void
assignType_FromField
(Method ifaceMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex) private void
call_reload
(org.objectweb.asm.MethodVisitor mv) private void
callMethod
(org.objectweb.asm.MethodVisitor mv, Method method) void
private void
compileHeader
(org.objectweb.asm.ClassVisitor cv, String name, List<Class> interfaces) private void
compileInterfaceMembers
(org.objectweb.asm.ClassVisitor cv, Class typeClass) private int
private void
constructRuntimeException
(org.objectweb.asm.MethodVisitor mv, int exceptionIndex) Wraps the actual class with a proxy.private AbstractTypeRef
createTypeRefProxy
(IType type) private void
delegateMethodCall
(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex) private void
genBody_NoRefreshSupport
(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv) private void
genBody_SupportRefresh
(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv) private Class<? extends AbstractTypeRef>
generateProxyClass
(Class<? extends IType> typeClass) private void
genMethod_DevMode
(org.objectweb.asm.ClassVisitor cv, Method ifaceMethod, Method proxyMethod) private String
getDescriptor
(Class<?> returnType) private int
private int
private Method
getInterfaceMethod
(Method method) private String[]
getInterfaceNames
(List<Class> interfaces) private void
getInterfacesFrom
(Class<? extends IType> classOfType, List<Class> interfaces) private Class
getJavaClass
(IType iface) private String
private String
getMethodDescriptor
(String[] paramTypeDescriptors, String returnTypeDescriptor) private String[]
getMethodExceptions
(Method method) private Class<? extends AbstractTypeRef>
getOrCreateTypeProxy
(Class<? extends IType> typeClass) private String[]
getParameterTypeDescriptors
(Method _method) private AbstractTypeRef
getRef
(WeakFqnCache<AbstractTypeRef> map, String key, IType type) private ITypeRef
getRefTheFastWay
(IType type, String strTypeName) private ITypeRef
getRefTheSafeWay
(IType type, String strTypeName) private String
getReturnTypeDescriptor
(Method _method) private String
getSlashName
(Class type) private String
getSlashName
(String typeName) getSubordinateRefs
(String topLevelTypeName) getTypesWithPrefix
(String namespace, String prefix) private void
insertGetNameStart
(org.objectweb.asm.MethodVisitor mv) boolean
private boolean
isTypeGosuClassInstance
(Class<?> declaringClass) private boolean
private boolean
private static void
putRef
(WeakFqnCache<AbstractTypeRef> map, String key, AbstractTypeRef value) private void
setClearing
(boolean bClearing) private static void
verify
(byte[] bytes) private void
visitDebugLineNumber
(int iLine, org.objectweb.asm.MethodVisitor mv)
-
Field Details
-
TRACE
private static boolean TRACE -
VERIFY
private static boolean VERIFY -
ASM_CHECKER
private static boolean ASM_CHECKER -
JAVA_VER
private static final int JAVA_VER- See Also:
-
ITYPE_PROXY_CLASS_BY_ITYPE_CLASS
private static final Map<Class<? extends IType>,Class<? extends AbstractTypeRef>> ITYPE_PROXY_CLASS_BY_ITYPE_CLASS -
_refByName
-
_bClearing
private boolean _bClearing
-
-
Constructor Details
-
TypeRefFactory
public TypeRefFactory()
-
-
Method Details
-
create
Wraps the actual class with a proxy.- Specified by:
create
in interfaceITypeRefFactory
-
getRefTheFastWay
-
getRefTheSafeWay
-
createTypeRefProxy
-
getOrCreateTypeProxy
-
generateProxyClass
-
compileHeader
-
getInterfaceNames
-
addDefaultConstructor
private void addDefaultConstructor(org.objectweb.asm.ClassVisitor cv) -
compileInterfaceMembers
-
genMethod_DevMode
-
genBody_NoRefreshSupport
-
genBody_SupportRefresh
-
visitDebugLineNumber
private void visitDebugLineNumber(int iLine, org.objectweb.asm.MethodVisitor mv) -
insertGetNameStart
private void insertGetNameStart(org.objectweb.asm.MethodVisitor mv) -
call_reload
private void call_reload(org.objectweb.asm.MethodVisitor mv) -
assignType
-
assignType_FromField
private void assignType_FromField(Method ifaceMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex) -
constructRuntimeException
private void constructRuntimeException(org.objectweb.asm.MethodVisitor mv, int exceptionIndex) -
delegateMethodCall
-
isTypeGosuClassInstance
-
getInterfaceMethod
-
get
- Specified by:
get
in interfaceITypeRefFactory
-
get
- Specified by:
get
in interfaceITypeRefFactory
-
clearCaches
public void clearCaches()- Specified by:
clearCaches
in interfaceITypeRefFactory
-
computeSortIndex
-
setClearing
private void setClearing(boolean bClearing) -
isClearing
public boolean isClearing()- Specified by:
isClearing
in interfaceITypeRefFactory
-
getInterfacesFrom
-
getJavaClass
-
putRef
-
getRef
-
getIns
-
getIns
-
isWide
-
isWide
-
getSlashName
-
getSlashName
-
getParameterTypeDescriptors
-
getReturnTypeDescriptor
-
getDescriptor
-
getMethodDescriptor
-
getMethodDescriptor
-
getMethodExceptions
-
callMethod
-
verify
private static void verify(byte[] bytes) -
getSubordinateRefs
- Specified by:
getSubordinateRefs
in interfaceITypeRefFactory
-
getTypesWithPrefix
- Specified by:
getTypesWithPrefix
in interfaceITypeRefFactory
-