public class BasicModule extends AbstractNamespace implements Module
Module| Constructor and Description |
|---|
BasicModule(java.lang.String name)
Creates new instance.
|
BasicModule(java.lang.String name,
java.util.Collection<? extends Module> imports)
Creates new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConstant(ConstantInfo constantInfo)
Adds a constant.
|
void |
addReferencedOperation(ReferencedOperation operation)
Adds referenced operation so that it can be referenced for expressions compiled to java.
|
void |
addSignature(FunctionSignature signature)
Registers a function signature in this namespace.
|
java.util.Map<java.lang.String,Module> |
allImportedModules()
Returns an immutable map of all imports.
|
BasicModule |
copyStatic()
Creates a new basic module with same types, functions, constants, but
variables are not copied.
|
NamedClassType |
getClassType(java.lang.String name)
Returns a class type defined in this module with a given name.
|
java.util.Collection<NamedClassType> |
getClassTypes()
Returns class types, declared in this Module
|
ConstantInfo |
getConstant(java.lang.String name)
Returns a constant declared in this module.
|
java.util.Collection<ConstantInfo> |
getConstants()
Returns a collection of constants declared in this module.
|
java.lang.Object |
getConstantValue(java.lang.String name)
Returns the constant value.
|
java.util.Collection<EnumerationType> |
getEnumerationTypes()
Returns a collection of enumeration types declared in this module.
|
java.util.Collection<InterfaceType> |
getInterfaceTypes()
Returns interface types, declared in this Module
|
java.util.Collection<FunctionSignature> |
getLocalSignaturesForName(java.lang.String name)
Returns the local function signatures for given name.
|
Module |
getModule()
Returns the enclosing module.
|
java.util.Collection<NamedType> |
getNamedTypes()
Returns a collection of named types (records, enumerations etc.) declared
in this module.
|
NamespaceModel |
getParent()
Returns the parent namespace or null.
|
java.util.Collection<RecordType> |
getRecordTypes()
Returns record types, declared in this Module
|
ReferencedOperation |
getReferencedOperation(java.lang.String id)
Returns operation for the id.
|
java.util.Collection<FunctionSignature> |
getSignatures()
Returns function signatures defined in this namespace.
|
ClassType |
getStaticType()
Returns type for this namespace used for static methods.
|
ClassType |
getThisType()
Returns type for this namespace.
|
NamedType |
getTypeForName(java.lang.String typeName)
Returns registered named type corresponding to given name.
|
protected java.util.Map<java.lang.String,Module> |
importedModules()
Returns an immutable map of imports.
|
boolean |
isModule()
Returns true if this is a module.
|
void |
registerEnumeration(EnumerationType type)
Registers an enumeration type.
|
void |
registerInterfaceType(InterfaceType type)
Registers given interface type, that is declared in this Module
|
void |
registerRecordType(RecordType type)
Registers given record type, that is declared in this Module
|
void |
setConstantValue(java.lang.String name,
java.lang.Object value)
Sets the constant value.
|
addModules, addVariable, addVariable, addVariable, addVariable, findNamedType, getAllImportedModules, getAlternativeName, getCompiled, getConstants, getExtensionMethods, getExtensionMethods, getImportedModuleByName, getImportedModules, getName, getSignatures, getSignaturesForName, getSignaturesForName, getSignaturesForNamedArgs, getVariable, getVariable, getVariablePrivacy, getVariables, getVariables, getVisibleConstants, getVisibleNamedTypes, getVisibleRecordTypes, getVisibleSignatures, getVisibleVariables, setAlternativeName, setCompiled, toString, validateIdentifierclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddVariable, addVariable, addVariable, addVariable, findNamedType, getAllImportedModules, getAlternativeName, getCompiled, getConstants, getExtensionMethods, getExtensionMethods, getImportedModuleByName, getImportedModules, getName, getSignatures, getSignaturesForName, getSignaturesForName, getSignaturesForNamedArgs, getVariable, getVariable, getVariablePrivacy, getVariables, getVariables, getVisibleConstants, getVisibleNamedTypes, getVisibleRecordTypes, getVisibleSignatures, getVisibleVariables, setAlternativeName, setCompiled, validateIdentifierpublic BasicModule(java.lang.String name)
name - the namepublic BasicModule(java.lang.String name,
java.util.Collection<? extends Module> imports)
name - the nameimports - the importsprotected java.util.Map<java.lang.String,Module> importedModules()
AbstractNamespaceimportedModules in class AbstractNamespacepublic java.util.Map<java.lang.String,Module> allImportedModules()
AbstractNamespaceallImportedModules in class AbstractNamespacepublic NamedType getTypeForName(java.lang.String typeName)
NamespaceModelgetTypeForName in interface NamespaceModelpublic NamedClassType getClassType(java.lang.String name)
ModulegetClassType in interface Modulepublic java.util.Collection<NamedClassType> getClassTypes()
ModulegetClassTypes in interface Modulepublic java.util.Collection<RecordType> getRecordTypes()
ModulegetRecordTypes in interface Modulepublic void registerRecordType(RecordType type)
ModuleregisterRecordType in interface Modulepublic void registerInterfaceType(InterfaceType type)
ModuleregisterInterfaceType in interface Modulepublic java.util.Collection<InterfaceType> getInterfaceTypes()
ModulegetInterfaceTypes in interface Modulepublic void registerEnumeration(EnumerationType type)
ModuleregisterEnumeration in interface Modulepublic java.util.Collection<EnumerationType> getEnumerationTypes()
ModulegetEnumerationTypes in interface Modulepublic java.util.Collection<NamedType> getNamedTypes()
ModulegetNamedTypes in interface Modulepublic NamespaceModel getParent()
NamespaceModelgetParent in interface NamespaceModelpublic void addSignature(FunctionSignature signature)
NamespaceModeladdSignature in interface NamespaceModelsignature - function signature to be registered in this namespacepublic final java.util.Collection<FunctionSignature> getSignatures()
NamespaceModelgetSignatures in interface NamespaceModelpublic java.util.Collection<FunctionSignature> getLocalSignaturesForName(java.lang.String name)
NamespaceModelgetLocalSignaturesForName in interface NamespaceModelpublic Module getModule()
NamespaceModelgetModule in interface NamespaceModelpublic boolean isModule()
NamespaceModelisModule in interface NamespaceModelpublic void addConstant(ConstantInfo constantInfo)
ModuleaddConstant in interface Modulepublic ConstantInfo getConstant(java.lang.String name)
ModulegetConstant in interface Modulenull if there is no constant with a given namepublic java.lang.Object getConstantValue(java.lang.String name)
ModulegetConstantValue in interface Modulepublic void setConstantValue(java.lang.String name,
java.lang.Object value)
ModulesetConstantValue in interface Modulepublic java.util.Collection<ConstantInfo> getConstants()
ModulegetConstants in interface Modulepublic void addReferencedOperation(ReferencedOperation operation)
NamespaceModeladdReferencedOperation in interface NamespaceModelpublic ReferencedOperation getReferencedOperation(java.lang.String id)
NamespaceModelgetReferencedOperation in interface NamespaceModelpublic BasicModule copyStatic()
public ClassType getThisType()
NamespaceModelgetThisType in interface NamespaceModelpublic ClassType getStaticType()
NamespaceModelgetStaticType in interface NamespaceModelCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.