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
Fields Modifier and Type Field Description protected Set<String>
_namespaces
-
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 Constructor Description DefaultTypeLoader(IModule module)
-
Method Summary
-
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
-
-
-
-
Constructor Detail
-
DefaultTypeLoader
public DefaultTypeLoader(IModule module)
-
-
Method Detail
-
instance
public static DefaultTypeLoader instance(IModule module)
-
instance
public static DefaultTypeLoader instance()
-
getType
public IType getType(String fullyQualifiedName)
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
-
getJavaClassInfo
public IJavaClassInfo getJavaClassInfo(String fullyQualifiedName)
- Specified by:
getJavaClassInfo
in interfaceIDefaultTypeLoader
-
getJavaClassInfoForClassDirectly
public IJavaClassInfo getJavaClassInfoForClassDirectly(Class clazz, IModule module)
- Specified by:
getJavaClassInfoForClassDirectly
in interfaceIDefaultTypeLoader
-
getJavaClassInfo
public IJavaClassInfo getJavaClassInfo(Class aClass, IModule gosuModule)
-
getJavaClassInfo
public IJavaClassInfo getJavaClassInfo(AsmClass aClass, IModule gosuModule)
-
resolveJavaClassInfo
public IJavaClassInfo resolveJavaClassInfo(String fqn)
-
getSourceFileHandle
public ISourceFileHandle getSourceFileHandle(String qualifiedName)
- Specified by:
getSourceFileHandle
in interfaceIDefaultTypeLoader
-
getIntrinsicTypeFromObject
public IType getIntrinsicTypeFromObject(Object object)
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
public Set<String> computeTypeNames()
- Specified by:
computeTypeNames
in interfaceITypeLoader
-
getResource
public URL getResource(String name)
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
public void refreshedTypesImpl(RefreshRequest request)
- Overrides:
refreshedTypesImpl
in classTypeLoaderBase
-
isCaseSensitive
public boolean isCaseSensitive()
- Specified by:
isCaseSensitive
in interfaceITypeLoader
- Overrides:
isCaseSensitive
in classTypeLoaderBase
-
getHandledPrefixes
public List<String> 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
public Class loadClass(String className)
- Specified by:
loadClass
in interfaceIDefaultTypeLoader
-
classFileExists
public boolean classFileExists(String className)
-
getGosuClassLoader
public IGosuClassLoader getGosuClassLoader()
- Specified by:
getGosuClassLoader
in interfaceIDefaultTypeLoader
-
getExtensions
public Set<String> getExtensions()
- Specified by:
getExtensions
in classSimpleTypeLoader
-
hasNamespace
public boolean hasNamespace(String namespace)
- Specified by:
hasNamespace
in interfaceITypeLoader
-
getAllNamespaces
public Set<String> 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
public void refreshedNamespace(String namespace, IDirectory dir, RefreshKind kind)
- Specified by:
refreshedNamespace
in interfaceITypeLoader
-
getTypeNames
public Set<TypeName> getTypeNames(String namespace)
- Specified by:
getTypeNames
in interfaceITypeLoader
- Overrides:
getTypeNames
in classTypeLoaderBase
-
getInterface
public <T> T getInterface(Class<T> apiInterface)
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.
-
-