Package gw.internal.gosu.properties
Class PropertiesTypeLoader
- java.lang.Object
-
- gw.config.BaseService
-
- gw.lang.reflect.TypeLoaderBase
-
- gw.internal.gosu.properties.PropertiesTypeLoader
-
- All Implemented Interfaces:
IService
,ITypeLoader
,IPluginHost
public class PropertiesTypeLoader extends TypeLoaderBase
-
-
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.ITypeLoader
NO_TYPES
-
-
Constructor Summary
Constructors Constructor Description PropertiesTypeLoader(IModule module)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
computeTypeNames()
Set<String>
getAllNamespaces()
Don't call this method unless you really know what you're doing.List<String>
getHandledPrefixes()
<T> T
getInterface(Class<T> apiInterface)
Provides an implementation of a specified interface.IType
getType(String fullyQualifiedName)
Gets a type based on a fully-qualified name.String[]
getTypesForFile(IFile file)
Returns ALL type names associated with the given file whether or not the types have been loaded yet.boolean
handlesFile(IFile file)
boolean
handlesNonPrefixLoads()
boolean
hasNamespace(String namespace)
static boolean
isDisplayPropertiesFile(String fileName)
RefreshKind
refreshedFile(IFile file, String[] types, RefreshKind kind)
Notifies the type loader that a file has been refreshed.void
refreshedImpl()
void
refreshedNamespace(String namespace, IDirectory dir, RefreshKind kind)
-
Methods inherited from class gw.lang.reflect.TypeLoaderBase
clearTypeNames, deleteIndexFile, getAllTypeNames, getModule, getNamespaceForDirectory, getResource, getTypeNames, getTypeNames, handlesDirectory, isCaseSensitive, loadTypeNames, refreshed, refreshedTypes, refreshedTypesImpl, saveTypeNames, shouldCacheTypeNames, showTypeNamesInIDE, shutdown, toString
-
-
-
-
Constructor Detail
-
PropertiesTypeLoader
public PropertiesTypeLoader(IModule module)
-
-
Method Detail
-
handlesNonPrefixLoads
public boolean handlesNonPrefixLoads()
-
handlesFile
public boolean handlesFile(IFile file)
- Specified by:
handlesFile
in interfaceITypeLoader
- Overrides:
handlesFile
in classTypeLoaderBase
-
isDisplayPropertiesFile
public static boolean isDisplayPropertiesFile(String fileName)
-
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.- Parameters:
fullyQualifiedName
- the fully qualified name of the type- Returns:
- the corresponding IType or null
-
refreshedImpl
public void refreshedImpl()
- Overrides:
refreshedImpl
in classTypeLoaderBase
-
getTypesForFile
public String[] getTypesForFile(IFile file)
Description copied from interface:ITypeLoader
Returns ALL type names associated with the given file whether or not the types have been loaded yet. Type loading should NOT be used in the implementation of this method.- Specified by:
getTypesForFile
in interfaceITypeLoader
- Overrides:
getTypesForFile
in classTypeLoaderBase
- Parameters:
file
- The file in question- Returns:
- All known types derived from that file
-
refreshedFile
public RefreshKind refreshedFile(IFile file, String[] types, RefreshKind kind)
Description copied from interface:ITypeLoader
Notifies the type loader that a file has been refreshed. The type loader should return all types that it knows need to be refreshed based on the given file.- Specified by:
refreshedFile
in interfaceITypeLoader
- Overrides:
refreshedFile
in classTypeLoaderBase
- Parameters:
file
- The file that was refreshed- Returns:
- All known types affected by the file change
-
hasNamespace
public boolean hasNamespace(String namespace)
-
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)
-
getInterface
public <T> T getInterface(Class<T> apiInterface)
Description copied from interface:IPluginHost
Provides an implementation of a specified interface.- Returns:
- The implementation of the interface or null if unsupported.
-
-