Package gw.lang.parser
Interface ITypeUsesMap
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
TypeUsesMap
public interface ITypeUsesMap extends java.io.Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddToDefaultTypeUses(java.lang.String strQualifiedType)Add the specified type to the set of default types.voidaddToFeatureLiterals(IFeatureInfo fi)voidaddToFeatureSpaces(java.lang.String strType)voidaddToSpecialTypeUses(java.lang.String strType)voidaddToTypeUses(IUsesStatement usesStmt)Adds a type to the current set of types.voidaddToTypeUses(java.lang.String strType)Adds a type to the current set of types.voidclearNonDefaultTypeUses()Clears all types not in the default set of types;booleancontainsType(java.lang.String qualifiedName)ITypeUsesMapcopy()Returns a shallow copy of this map.ITypeUsesMapcopyLocalScope()Copies the type uses map but alias the global map from this.java.util.Set<IFeatureInfo>getFeatureLiterals()java.util.Set<java.lang.String>getFeatureSpaces()java.util.Set<java.lang.String>getNamespaces()Returns the set of strings representing the namespaces that are currently used by this parser.java.util.Set<java.lang.String>getTypeUses()Returns the set of strings representing the types that are currently used by this parser.java.util.Set<IUsesStatement>getUsesStatements()Return the set of uses-statements that participate in this map.booleanisSupportRelativePackageResolution()ITypeUsesMaplock()Locks this ITypeUsesMap so that it cannot be mutated in the futureINamespaceTyperesolveRelativeNamespaceInAllNamespaces(java.lang.String strRelativeName)ITyperesolveType(java.lang.String strRelativeName)Resolve the type of a relative name via the type uses.voidsetSupportRelativePackageResolution(boolean bSupportRelativePackageResolution)
-
-
-
Method Detail
-
getTypeUses
java.util.Set<java.lang.String> getTypeUses()
Returns the set of strings representing the types that are currently used by this parser. The set of types includes both those declared in #uses statements and those set via setDefaultTypeUses.
-
getNamespaces
java.util.Set<java.lang.String> getNamespaces()
Returns the set of strings representing the namespaces that are currently used by this parser.
-
getFeatureSpaces
java.util.Set<java.lang.String> getFeatureSpaces()
-
getFeatureLiterals
java.util.Set<IFeatureInfo> getFeatureLiterals()
-
addToTypeUses
void addToTypeUses(java.lang.String strType)
Adds a type to the current set of types. Can be a complete type or a wildcard namespace e.g., java.util.HashMap and java.util.* are both legal.
-
addToFeatureSpaces
void addToFeatureSpaces(java.lang.String strType)
-
addToFeatureLiterals
void addToFeatureLiterals(IFeatureInfo fi)
-
addToTypeUses
void addToTypeUses(IUsesStatement usesStmt)
Adds a type to the current set of types. Can be a complete type or a wildcard namespace e.g., java.util.HashMap and java.util.* are both legal.
-
getUsesStatements
java.util.Set<IUsesStatement> getUsesStatements()
Return the set of uses-statements that participate in this map. Note these are the uses-statements compiled from source.
-
addToDefaultTypeUses
void addToDefaultTypeUses(java.lang.String strQualifiedType)
Add the specified type to the set of default types. NOTE: The type is always treated as a package. If it ends in .* then it will be stripped
-
resolveType
IType resolveType(java.lang.String strRelativeName)
Resolve the type of a relative name via the type uses. if the relative type matches uses-type, resolves the type as such. If the type matches, but does not resove, throws an exception, otherwise returns null if there is no match.
-
resolveRelativeNamespaceInAllNamespaces
INamespaceType resolveRelativeNamespaceInAllNamespaces(java.lang.String strRelativeName)
- Parameters:
strRelativeName- A relative path name. E.g., "lang" is a relative package name of "java.lang"- Returns:
- The absolute namespace type for the relative name or null if not found.
-
clearNonDefaultTypeUses
void clearNonDefaultTypeUses()
Clears all types not in the default set of types;
-
copy
ITypeUsesMap copy()
Returns a shallow copy of this map.
-
copyLocalScope
ITypeUsesMap copyLocalScope()
Copies the type uses map but alias the global map from this.- Returns:
- a copy of this type uses map.
-
lock
ITypeUsesMap lock()
Locks this ITypeUsesMap so that it cannot be mutated in the future- Returns:
- this ITypeUsesMap, so that this method can be used in a builder-like manner.
-
containsType
boolean containsType(java.lang.String qualifiedName)
- Returns:
- if a type wit the given name can be resolved via this type uses map.
-
addToSpecialTypeUses
void addToSpecialTypeUses(java.lang.String strType)
-
isSupportRelativePackageResolution
boolean isSupportRelativePackageResolution()
-
setSupportRelativePackageResolution
void setSupportRelativePackageResolution(boolean bSupportRelativePackageResolution)
-
-