Package gw.lang.reflect.gs
Class GosuClassTypeLoader
- java.lang.Object
-
- gw.config.BaseService
-
- gw.lang.reflect.TypeLoaderBase
-
- gw.lang.reflect.SimpleTypeLoader
-
- gw.lang.reflect.gs.GosuClassTypeLoader
-
- All Implemented Interfaces:
IService
,ITypeLoader
,IPluginHost
public class GosuClassTypeLoader extends SimpleTypeLoader
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>
_namespaces
static String[]
ALL_EXTS
static Set<String>
ALL_EXTS_SET
static String
BLOCK_POSTFIX
static String
BLOCK_PREFIX
static Set<String>
EXTENSIONS
static String
GOSU_CLASS_FILE_EXT
static String
GOSU_ENHANCEMENT_FILE_EXT
static String
GOSU_PROGRAM_FILE_EXT
static String
GOSU_RULE_EXT
static String
GOSU_RULE_SET_EXT
static String
GOSU_TEMPLATE_FILE_EXT
static String
INNER_BLOCK_PREFIX
-
Fields inherited from class gw.lang.reflect.TypeLoaderBase
_module, _typeNames
-
Fields inherited from interface gw.lang.reflect.ITypeLoader
NO_TYPES
-
-
Constructor Summary
Constructors Constructor Description GosuClassTypeLoader(IGosuClassRepository repository)
GosuClassTypeLoader(IModule module, IGosuClassRepository repository)
-
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.plugin.IPluginHost
getInterface
-
-
-
-
Field Detail
-
GOSU_CLASS_FILE_EXT
public static final String GOSU_CLASS_FILE_EXT
- See Also:
- Constant Field Values
-
GOSU_ENHANCEMENT_FILE_EXT
public static final String GOSU_ENHANCEMENT_FILE_EXT
- See Also:
- Constant Field Values
-
GOSU_PROGRAM_FILE_EXT
public static final String GOSU_PROGRAM_FILE_EXT
- See Also:
- Constant Field Values
-
GOSU_TEMPLATE_FILE_EXT
public static final String GOSU_TEMPLATE_FILE_EXT
- See Also:
- Constant Field Values
-
GOSU_RULE_EXT
public static final String GOSU_RULE_EXT
- See Also:
- Constant Field Values
-
GOSU_RULE_SET_EXT
public static final String GOSU_RULE_SET_EXT
- See Also:
- Constant Field Values
-
ALL_EXTS
public static final String[] ALL_EXTS
-
BLOCK_PREFIX
public static final String BLOCK_PREFIX
- See Also:
- Constant Field Values
-
INNER_BLOCK_PREFIX
public static final String INNER_BLOCK_PREFIX
- See Also:
- Constant Field Values
-
BLOCK_POSTFIX
public static final String BLOCK_POSTFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GosuClassTypeLoader
public GosuClassTypeLoader(IGosuClassRepository repository)
-
GosuClassTypeLoader
public GosuClassTypeLoader(IModule module, IGosuClassRepository repository)
-
-
Method Detail
-
getDefaultClassLoader
public static GosuClassTypeLoader getDefaultClassLoader()
-
getDefaultClassLoader
public static GosuClassTypeLoader getDefaultClassLoader(IModule module)
-
getRepository
public IGosuClassRepository getRepository()
-
getEnhancementIndex
public IEnhancementIndex getEnhancementIndex()
-
isCaseSensitive
public boolean isCaseSensitive()
- Specified by:
isCaseSensitive
in interfaceITypeLoader
- Overrides:
isCaseSensitive
in classTypeLoaderBase
-
getType
public ICompilableType getType(String strFullyQualifiedName)
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.- Parameters:
strFullyQualifiedName
- the fully qualified name of the type- Returns:
- the corresponding IType or null
-
getAllNamespaces
public Set<String> getAllNamespaces()
Description copied from interface:ITypeLoader
Don't call this method unless you really know what you're doing.- 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)
-
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.
-
refreshedImpl
public void refreshedImpl()
- Overrides:
refreshedImpl
in classTypeLoaderBase
-
handlesNonPrefixLoads
public boolean handlesNonPrefixLoads()
-
makeNewClass
public IGosuClass makeNewClass(ISourceFileHandle sourceFile)
-
makeNewClass
public IGosuClass makeNewClass(ISourceFileHandle sourceFile, ISymbolTable programSymTable)
-
isValidSourceFileHandle
protected boolean isValidSourceFileHandle(ISourceFileHandle sourceFile)
-
getAllExtensions
protected String[] getAllExtensions()
-
getTypeUsesMap
protected ITypeUsesMap getTypeUsesMap()
-
refreshedTypesImpl
public void refreshedTypesImpl(RefreshRequest request)
- Overrides:
refreshedTypesImpl
in classTypeLoaderBase
-
shouldKeepDebugInfo
public boolean shouldKeepDebugInfo(IGosuClass gsClass)
-
getExtensions
public Set<String> getExtensions()
- Specified by:
getExtensions
in classSimpleTypeLoader
-
getTypeNames
public Set<TypeName> getTypeNames(String namespace)
- Specified by:
getTypeNames
in interfaceITypeLoader
- Overrides:
getTypeNames
in classTypeLoaderBase
-
hasNamespace
public boolean hasNamespace(String namespace)
-
-