public abstract class AbstractNamespace extends java.lang.Object implements NamespaceModel
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNamespace(java.lang.String name)
Creates a new namespace with given name.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addModules(java.util.Collection<? extends Module> modules,
java.util.Map<java.lang.String,Module> map,
boolean transitive)
Adds modules to a map.
|
void |
addVariable(java.lang.String variableName,
Type variableType)
Registers a public variable in this namespace.
|
void |
addVariable(java.lang.String variableName,
Type variableType,
boolean isPrivate)
Registers a variable in this namespace.
|
void |
addVariable(java.lang.String variableName,
Type variableType,
boolean isPrivate,
boolean isReadOnly)
Registers a variable in this namespace.
|
void |
addVariable(VariableInfo variable)
Registers the given variable in this namespace.
|
abstract java.util.Map<java.lang.String,Module> |
allImportedModules()
Returns an immutable map of all imports.
|
NamedType |
findNamedType(QID qid)
Find a named type.
|
java.util.Collection<Module> |
getAllImportedModules()
Returns this module and all imported modules along with their imported modules recursively.
|
java.lang.String |
getAlternativeName()
Returns alternative name.
|
java.lang.reflect.Constructor<?> |
getCompiled()
Returns constructor of class that was generated by compilation to java for this namespace model.
|
java.util.Collection<ConstantInfo> |
getConstants(QID name)
Returns a list of constants for the given fully qualified name.
|
java.util.Collection<SignatureMapping> |
getExtensionMethods(Type type)
Returns a collection of extension methods for a given type.
|
java.util.Collection<SignatureMapping> |
getExtensionMethods(Type type,
java.lang.String methodName)
Returns a collection of extension methods for a given type and name.
|
Module |
getImportedModuleByName(java.lang.String moduleName)
Returns a reachable imported module by its module name or null if no such module exists.
|
java.util.Collection<Module> |
getImportedModules()
Returns imported modules.
|
java.lang.String |
getName()
Returns the name of defined type, which is unique in the module.
|
java.util.Collection<SignatureMapping> |
getSignatures(java.lang.String namePattern,
java.util.List<? extends Type> args,
Type returnType,
java.util.Map<java.lang.String,java.lang.String> metadataPattern)
Returns a collection of function signatures for the given parameters.
|
java.util.Collection<SignatureMapping> |
getSignaturesForName(QID name)
Returns a collection of function signatures for the given name.
|
java.util.Collection<SignatureMapping> |
getSignaturesForName(QID name,
ClosureType type)
Returns a collection of function signatures for the given name, argument
count and expected signature closure type.
|
java.util.Collection<SignatureMapping> |
getSignaturesForNamedArgs(QID name,
java.util.Map<java.lang.String,Type> args,
Type returnType)
Returns a collection of function signatures for the given name, arguments
names and types and a return type.
|
VariableInfo |
getVariable(java.lang.String variableName)
Returns a local variable for the given name.
|
VariableInfo |
getVariable(java.lang.String variableName,
boolean includePrivate)
Returns a local variable info for the given name.
|
boolean |
getVariablePrivacy(java.lang.String variableName)
Returns a local variable privacy for the given name.
|
java.util.Collection<VariableInfo> |
getVariables()
Returns a collection of all variables in this namespace.
|
java.util.Collection<VariableInfo> |
getVariables(QID name)
Returns a list of variables for the given fully qualified name.
|
java.util.Collection<ConstantInfo> |
getVisibleConstants()
Returns a collection of all visible constants.
|
java.util.Collection<NamedType> |
getVisibleNamedTypes()
Returns a collection of all visible named types (records, enumerations etc.).
|
java.util.Collection<RecordType> |
getVisibleRecordTypes()
Returns a collection of all visible defined record types.
|
java.util.Collection<FunctionSignature> |
getVisibleSignatures()
Returns a collection of all visible function signatures.
|
java.util.Collection<VariableInfo> |
getVisibleVariables()
Returns a collection of all visible variables.
|
protected abstract java.util.Map<java.lang.String,Module> |
importedModules()
Returns an immutable map of imports.
|
void |
setAlternativeName(java.lang.String alternativeName)
Sets alternative name.
|
void |
setCompiled(java.lang.reflect.Constructor<?> constructor)
Sets constructor of class that was generated by compilation to java for this namespace model.
|
java.lang.String |
toString() |
boolean |
validateIdentifier(java.lang.String identifierName)
Returns true if name is valid identifier according the used language.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddReferencedOperation, addSignature, getLocalSignaturesForName, getModule, getParent, getReferencedOperation, getSignatures, getStaticType, getThisType, getTypeForName, isModuleprotected AbstractNamespace(java.lang.String name)
name - string containing name for the new namespacepublic void addVariable(java.lang.String variableName,
Type variableType)
NamespaceModeladdVariable in interface NamespaceModelvariableName - string containing the name of the variablevariableType - type of the variablepublic void addVariable(java.lang.String variableName,
Type variableType,
boolean isPrivate)
NamespaceModeladdVariable in interface NamespaceModelvariableName - string containing the name of the variablevariableType - type of the variableisPrivate - true if the variable is private, false if it is publicpublic void addVariable(java.lang.String variableName,
Type variableType,
boolean isPrivate,
boolean isReadOnly)
NamespaceModeladdVariable in interface NamespaceModelvariableName - string containing the name of the variablevariableType - type of the variableisPrivate - true if the variable is private, false if it is publicisReadOnly - true if the variable is read-only, false otherwisepublic void addVariable(VariableInfo variable)
NamespaceModeladdVariable in interface NamespaceModelpublic boolean validateIdentifier(java.lang.String identifierName)
validateIdentifier in interface NamespaceModelidentifierName - string containing the proposed identifierpublic VariableInfo getVariable(java.lang.String variableName)
NamespaceModelgetVariable in interface NamespaceModelnullpublic boolean getVariablePrivacy(java.lang.String variableName)
NamespaceModelgetVariablePrivacy in interface NamespaceModelpublic final VariableInfo getVariable(java.lang.String variableName, boolean includePrivate)
NamespaceModelgetVariable in interface NamespaceModelincludePrivate - true if also private variable can be returned, false if only publicpublic java.util.Collection<VariableInfo> getVariables(QID name)
NamespaceModelgetVariables in interface NamespaceModelpublic java.util.Collection<ConstantInfo> getConstants(QID name)
NamespaceModelgetConstants in interface NamespaceModelpublic java.util.Collection<VariableInfo> getVariables()
NamespaceModelgetVariables in interface NamespaceModelpublic java.util.Collection<SignatureMapping> getSignaturesForName(QID name)
NamespaceModelgetSignaturesForName in interface NamespaceModelpublic java.util.Collection<SignatureMapping> getSignaturesForName(QID name, ClosureType type)
NamespaceModelgetSignaturesForName in interface NamespaceModelpublic java.util.Collection<SignatureMapping> getSignaturesForNamedArgs(QID name, java.util.Map<java.lang.String,Type> args, Type returnType)
NamespaceModelgetSignaturesForNamedArgs in interface NamespaceModelpublic java.util.Collection<SignatureMapping> getSignatures(java.lang.String namePattern, java.util.List<? extends Type> args, Type returnType, java.util.Map<java.lang.String,java.lang.String> metadataPattern)
NamespaceModelgetSignatures in interface NamespaceModelnamePattern - regular expressionmetadataPattern - map with required metadata, values are regular expressions.public java.util.Collection<SignatureMapping> getExtensionMethods(Type type, java.lang.String methodName)
NamespaceModelgetExtensionMethods in interface NamespaceModelpublic java.util.Collection<SignatureMapping> getExtensionMethods(Type type)
NamespaceModelgetExtensionMethods in interface NamespaceModelprotected abstract java.util.Map<java.lang.String,Module> importedModules()
public abstract java.util.Map<java.lang.String,Module> allImportedModules()
protected void addModules(java.util.Collection<? extends Module> modules, java.util.Map<java.lang.String,Module> map, boolean transitive)
modules - map - transitive - public java.util.Collection<Module> getImportedModules()
NamespaceModelgetImportedModules in interface NamespaceModelpublic java.util.Collection<Module> getAllImportedModules()
NamespaceModelgetAllImportedModules in interface NamespaceModelpublic Module getImportedModuleByName(java.lang.String moduleName)
NamespaceModelgetImportedModuleByName in interface NamespaceModelpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getName()
NamespaceModelgetName in interface NamespaceModelpublic java.util.Collection<RecordType> getVisibleRecordTypes()
NamespaceModelgetVisibleRecordTypes in interface NamespaceModelpublic java.util.Collection<NamedType> getVisibleNamedTypes()
NamespaceModelgetVisibleNamedTypes in interface NamespaceModelpublic java.util.Collection<FunctionSignature> getVisibleSignatures()
NamespaceModelgetVisibleSignatures in interface NamespaceModelpublic java.util.Collection<VariableInfo> getVisibleVariables()
NamespaceModelgetVisibleVariables in interface NamespaceModelpublic java.lang.String getAlternativeName()
NamespaceModelgetAlternativeName in interface NamespaceModelpublic void setAlternativeName(java.lang.String alternativeName)
NamespaceModelsetAlternativeName in interface NamespaceModelpublic java.util.Collection<ConstantInfo> getVisibleConstants()
NamespaceModelgetVisibleConstants in interface NamespaceModelpublic NamedType findNamedType(QID qid) throws AmbiguousTypeException
NamespaceModelfindNamedType in interface NamespaceModelqid - the type name, not null.null if not foundAmbiguousTypeExceptionpublic java.lang.reflect.Constructor<?> getCompiled()
NamespaceModelNamespacegetCompiled in interface NamespaceModelpublic void setCompiled(java.lang.reflect.Constructor<?> constructor)
NamespaceModelNamespacesetCompiled in interface NamespaceModelCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.