Class PythonCodeImport
java.lang.Object
net.ssehub.easy.instantiation.python.codeArtifacts.PythonCodeImport
- All Implemented Interfaces:
net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider,net.ssehub.easy.instantiation.core.model.vilTypes.IVilType,IPythonCodeElement,IPythonCodeImport,Storable
Represents a Python "import" in VTL.
- Author:
- Kevin Schaperjahn
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider
net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider.StringComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate IPythonCodeArtifactprivate booleanprivate StringFields inherited from interface net.ssehub.easy.instantiation.python.codeArtifacts.IPythonCodeElement
KEY_COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionPythonCodeImport(IPythonCodeArtifact artifact, String module, boolean explicit) PythonCodeImport(IPythonCodeArtifact artifact, String module, String name, boolean explicit) -
Method Summary
Modifier and TypeMethodDescriptionAdds a further name to be imported.getAlias()getName()getTracerStringValue(net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider.StringComparator comparator) private booleanbooleanbooleanmatch(IPythonCodeImport other) voidsetParent(IPythonCodeElement parent) voidstore(net.ssehub.easy.instantiation.core.model.templateModel.CodeWriter out) Moves this import to the imports at the beginning of the artifact.toImports(boolean apply) Moves this import conditionally to the imports at the beginning of the artifact.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ssehub.easy.instantiation.python.codeArtifacts.IPythonCodeElement
addAll, getSortKey, getStringValue, getTopClass, hasPythondocComment, isAttribute, isBlock, isClass, isEmptyLine, moveToAttributes, moveToImportsMethods inherited from interface net.ssehub.easy.instantiation.python.codeArtifacts.Storable
getElementCount, toCode
-
Field Details
-
module
-
names
-
alias
-
artifact
-
isWildcard
private boolean isWildcard
-
-
Constructor Details
-
PythonCodeImport
-
PythonCodeImport
-
-
Method Details
-
getAlias
- Specified by:
getAliasin interfaceIPythonCodeImport
-
toImports
Moves this import to the imports at the beginning of the artifact. By default, the import occurs wherever it is added.- Returns:
- this for chaining
-
toImports
Moves this import conditionally to the imports at the beginning of the artifact. By default, the import occurs wherever it is added.- Parameters:
apply- whether this import shall be moved or not- Returns:
- this for chaining
-
setAlias
-
store
public void store(net.ssehub.easy.instantiation.core.model.templateModel.CodeWriter out) -
getName
- Specified by:
getNamein interfaceIPythonCodeImport
-
getModule
- Specified by:
getModulein interfaceIPythonCodeImport
-
getTracerStringValue
public String getTracerStringValue(net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider.StringComparator comparator) - Specified by:
getTracerStringValuein interfaceIPythonCodeElement
-
isWildcard
public boolean isWildcard()- Specified by:
isWildcardin interfaceIPythonCodeImport
-
getArtifact
- Specified by:
getArtifactin interfaceIPythonCodeElement
-
getParent
- Specified by:
getParentin interfaceIPythonCodeElement
-
setParent
- Specified by:
setParentin interfaceIPythonCodeElement
-
match
- Specified by:
matchin interfaceIPythonCodeImport
-
hasName
-
addName
Adds a further name to be imported.- Parameters:
name- the name- Returns:
- this for chaining
-