Package editor
Class PackageTypeLoader
- java.lang.Object
-
- gw.config.BaseService
-
- gw.lang.reflect.TypeLoaderBase
-
- editor.PackageTypeLoader
-
- All Implemented Interfaces:
IService,ITypeLoader,IPluginHost
public class PackageTypeLoader extends TypeLoaderBase
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.CharSequence,PackageType>_mapTypeByNameprivate static java.util.Map<IModule,PackageTypeLoader>INSTANCE_BY_MODULE-
Fields inherited from class gw.lang.reflect.TypeLoaderBase
_module, _typeNames
-
Fields inherited from interface gw.lang.reflect.ITypeLoader
NO_TYPES
-
-
Constructor Summary
Constructors Modifier Constructor Description privatePackageTypeLoader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclearCaches()java.util.Set<java.lang.String>computeTypeNames()private PackageTypedefine(java.lang.String strPackage, boolean bSkipVerify)private PackageTypeget(java.lang.String strPackage)private PackageTypeget(java.lang.String strPackage, boolean bSkipVerify)java.util.Set<? extends java.lang.CharSequence>getAllNamespaces()Don't call this method unless you really know what you're doing.java.util.List<java.lang.String>getHandledPrefixes()ITypegetIntrinsicTypeByFullName(java.lang.String fullyQualifiedName, boolean bSkipVerify)PackageTypegetType(java.lang.String fullyQualifiedName)Gets a type based on a fully-qualified name.booleanhandlesNonPrefixLoads()booleanhasNamespace(java.lang.String s)static PackageTypeLoaderinstance()private booleanpackageExists(java.lang.String strName)voidrefreshedNamespace(java.lang.String s, IDirectory iDirectory, RefreshKind refreshKind)-
Methods inherited from class gw.lang.reflect.TypeLoaderBase
clearTypeNames, deleteIndexFile, getAllTypeNames, getModule, getNamespaceForDirectory, getResource, getTypeNames, getTypeNames, getTypesForFile, handlesDirectory, handlesFile, isCaseSensitive, loadTypeNames, refreshed, refreshedFile, refreshedImpl, refreshedTypes, refreshedTypesImpl, 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
-
INSTANCE_BY_MODULE
private static final java.util.Map<IModule,PackageTypeLoader> INSTANCE_BY_MODULE
-
_mapTypeByName
private final java.util.Map<java.lang.CharSequence,PackageType> _mapTypeByName
-
-
Method Detail
-
instance
public static PackageTypeLoader instance()
-
getType
public PackageType getType(java.lang.String fullyQualifiedName)
Description copied from interface:ITypeLoaderGets 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.
If the type can be successfully resolved by the typeloader, it will be returned, otherwise it will return null. The sole exception to this rule is the top-level TypeLoaderAccess, which will throw aClassNotFoundExceptionif none of its composite typeloaders can load the type.
There is a global lock in TypeLoaderAccess that is acquired when this method is called. Basically one type at a time can be loaded from the system. This method is free to release that lock during this call. This is needed to deal with reentrant type loaders. It is the responsibility of this method to make sure the lock is reacquired before this method returns. Type loader access will guarentee that no duplicate types are put into the type loader.- Parameters:
fullyQualifiedName- the fully qualified name of the type- Returns:
- the corresponding IType or null
-
hasNamespace
public boolean hasNamespace(java.lang.String s)
-
computeTypeNames
public java.util.Set<java.lang.String> computeTypeNames()
-
getIntrinsicTypeByFullName
public IType getIntrinsicTypeByFullName(java.lang.String fullyQualifiedName, boolean bSkipVerify) throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
-
getAllNamespaces
public java.util.Set<? extends java.lang.CharSequence> getAllNamespaces()
Description copied from interface:ITypeLoaderDon'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.
-
clearCaches
private void clearCaches()
-
getHandledPrefixes
public java.util.List<java.lang.String> getHandledPrefixes()
-
handlesNonPrefixLoads
public boolean handlesNonPrefixLoads()
-
refreshedNamespace
public void refreshedNamespace(java.lang.String s, IDirectory iDirectory, RefreshKind refreshKind)
-
get
private PackageType get(java.lang.String strPackage)
-
get
private PackageType get(java.lang.String strPackage, boolean bSkipVerify)
-
define
private PackageType define(java.lang.String strPackage, boolean bSkipVerify)
-
packageExists
private boolean packageExists(java.lang.String strName)
-
-