Package gw.internal.gosu.parser
Class DefaultTypeLoader
java.lang.Object
gw.config.BaseService
gw.lang.reflect.TypeLoaderBase
gw.lang.reflect.SimpleTypeLoader
gw.internal.gosu.parser.DefaultTypeLoader
- All Implemented Interfaces:
IService
,IDefaultTypeLoader
,IExtendedTypeLoader
,ITypeLoader
,IPluginHost
public class DefaultTypeLoader
extends SimpleTypeLoader
implements IExtendedTypeLoader, IDefaultTypeLoader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClassCache
private Map<String,
IJavaClassInfo> private IGosuClassLoader
Fields inherited from class gw.lang.reflect.TypeLoaderBase
_module, _typeNames
Fields inherited from interface gw.lang.reflect.IDefaultTypeLoader
DOT_JAVA_EXTENSION, EXTENSIONS, EXTENSIONS_ARRAY, JAVA_EXTENSION
Fields inherited from interface gw.lang.reflect.ITypeLoader
NO_TYPES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
classFileExists
(String className) void
(package private) void
Don't call this method unless you really know what you're doing.private IJavaClassInfo
getByClass
(String className, IModule lookupModule, IModule actualModule) getInnerType
(String fqn) <T> T
getInterface
(Class<T> apiInterface) Provides an implementation of a specified interface.getIntrinsicTypeFromObject
(Object object) Returns the intrinsic type for the given Object.getJavaClassInfo
(AsmClass aClass, IModule gosuModule) getJavaClassInfo
(Class aClass, IModule gosuModule) getJavaClassInfo
(String fullyQualifiedName) getJavaClassInfoForClassDirectly
(Class clazz, IModule module) getResource
(String name) Finds the resource with the given name.getSourceFileHandle
(String qualifiedName) Gets a type based on a fully-qualified name.getTypeNames
(String namespace) boolean
boolean
hasNamespace
(String namespace) private boolean
static DefaultTypeLoader
instance()
static DefaultTypeLoader
boolean
loadAsmClass
(String className) void
void
refreshedNamespace
(String namespace, IDirectory dir, RefreshKind kind) void
refreshedTypesImpl
(RefreshRequest request) Methods inherited from class gw.lang.reflect.SimpleTypeLoader
getNamespaceForDirectory, getTypesForFile, handlesDirectory, handlesFile, refreshedFile
Methods inherited from class gw.lang.reflect.TypeLoaderBase
clearTypeNames, deleteIndexFile, getAllTypeNames, getModule, getTypeNames, loadTypeNames, refreshed, refreshedTypes, saveTypeNames, shouldCacheTypeNames, showTypeNamesInIDE, shutdown, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface gw.lang.reflect.IDefaultTypeLoader
getSouceFileHandle
Methods inherited from interface gw.lang.reflect.ITypeLoader
getAllTypeNames, getModule, getNamespaceForDirectory, getTypesForFile, handlesDirectory, handlesFile, refreshed, refreshedFile, refreshedTypes, showTypeNamesInIDE, shutdown
-
Field Details
-
_classCache
-
_gosuClassLoader
-
_classInfoCache
-
_namespaces
-
-
Constructor Details
-
DefaultTypeLoader
-
-
Method Details
-
instance
-
instance
-
getType
Description copied from interface:ITypeLoader
Gets a type based on a fully-qualified name. This could either be the name of an entity, like "entity.User", the name of a typekey, like "typekey.SystemPermission", or a class name, like "java.lang.String". Names can have [] appended to them to create arrays, and multi-dimensional arrays are supported.ClassNotFoundException
if none of its composite typeloaders can load the type.- Specified by:
getType
in interfaceITypeLoader
- Parameters:
fullyQualifiedName
- the fully qualified name of the type- Returns:
- the corresponding IType or null
-
getInnerType
-
getJavaClassInfo
- Specified by:
getJavaClassInfo
in interfaceIDefaultTypeLoader
-
getJavaClassInfoForClassDirectly
- Specified by:
getJavaClassInfoForClassDirectly
in interfaceIDefaultTypeLoader
-
getJavaClassInfo
-
getJavaClassInfo
-
resolveJavaClassInfo
-
getSourceFileHandle
- Specified by:
getSourceFileHandle
in interfaceIDefaultTypeLoader
-
getByClass
-
getIntrinsicTypeFromObject
Description copied from interface:IExtendedTypeLoader
Returns the intrinsic type for the given Object.- Specified by:
getIntrinsicTypeFromObject
in interfaceIExtendedTypeLoader
- Parameters:
object
- the object to get an IType for- Returns:
- the IType for the object
-
computeTypeNames
- Specified by:
computeTypeNames
in interfaceITypeLoader
-
getResource
Description copied from interface:ITypeLoader
Finds the resource with the given name. A resource is some data that can be accessed by class code in a way that may be independent of the location of the code. The exact location of the resource is dependent upon the loader implementationThe name of a resource is a '/'-separated path name that identifies the resource.
- Specified by:
getResource
in interfaceITypeLoader
- Overrides:
getResource
in classTypeLoaderBase
- Parameters:
name
- The resource name- Returns:
- A URL object for reading the resource, or null if the resource could not be found or the invoker doesn't have adequate privileges to get the resource.
-
refreshedTypesImpl
- Overrides:
refreshedTypesImpl
in classTypeLoaderBase
-
isCaseSensitive
public boolean isCaseSensitive()- Specified by:
isCaseSensitive
in interfaceITypeLoader
- Overrides:
isCaseSensitive
in classTypeLoaderBase
-
getHandledPrefixes
- Specified by:
getHandledPrefixes
in interfaceITypeLoader
-
handlesNonPrefixLoads
public boolean handlesNonPrefixLoads()- Specified by:
handlesNonPrefixLoads
in interfaceITypeLoader
-
refreshedImpl
public void refreshedImpl()- Overrides:
refreshedImpl
in classTypeLoaderBase
-
clearMisses
public void clearMisses() -
loadClass
- Specified by:
loadClass
in interfaceIDefaultTypeLoader
-
loadAsmClass
-
classFileExists
-
getGosuClassLoader
- Specified by:
getGosuClassLoader
in interfaceIDefaultTypeLoader
-
dumpGosuClassLoader
void dumpGosuClassLoader() -
haveWeRecreatedTheModuleLoader
private boolean haveWeRecreatedTheModuleLoader() -
getExtensions
- Specified by:
getExtensions
in classSimpleTypeLoader
-
hasNamespace
- Specified by:
hasNamespace
in interfaceITypeLoader
-
getAllNamespaces
Description copied from interface:ITypeLoader
Don't call this method unless you really know what you're doing.- Specified by:
getAllNamespaces
in interfaceITypeLoader
- Returns:
- the set of package (aka namespace) names in which this loader's types reside.
-
refreshedNamespace
- Specified by:
refreshedNamespace
in interfaceITypeLoader
-
getTypeNames
- Specified by:
getTypeNames
in interfaceITypeLoader
- Overrides:
getTypeNames
in classTypeLoaderBase
-
getInterface
Description copied from interface:IPluginHost
Provides an implementation of a specified interface.- Specified by:
getInterface
in interfaceIPluginHost
- Returns:
- The implementation of the interface or null if unsupported.
-