Klasse VariableNode
java.lang.Object
de.svws_nrw.transpiler.typescript.VariableNode
This class is used to store the information of transpiled java method parameters.
-
Konstruktorübersicht
KonstruktorBeschreibungVariableNode
(TranspilerTypeScriptPlugin plugin, VariableTree variable) Creates a new variable with transpiled variable information.VariableNode
(TranspilerTypeScriptPlugin plugin, VariableElement varElem, boolean isVarArg, Map<String, TypeMirror> resolved) Creates a new variable with transpiled variable information. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetName()
Gibt den Namen der Variable zurück.getTypeCast
(String identifier) Returns transpiled code for casting the specified identifier to the type of this variable.getTypeCheck
(String identifier) Returns transpiled code to check whether the specified identifier matches the type of this variable.Returns the type node of this variable node.boolean
isFinal()
Returns whether this variable declaration is marked finalboolean
isStatic()
Returns whether this variable declaration is a static class attributeReturns the transpiled code of this node.Returns the transpiled code for the type of this node.
-
Konstruktordetails
-
VariableNode
Creates a new variable with transpiled variable information.- Parameter:
plugin
- theTranspilerTypeScriptPlugin
usedvariable
- theVariableTree
object of the java compiler
-
VariableNode
public VariableNode(TranspilerTypeScriptPlugin plugin, VariableElement varElem, boolean isVarArg, Map<String, TypeMirror> resolved) Creates a new variable with transpiled variable information.- Parameter:
plugin
- theTranspilerTypeScriptPlugin
usedvarElem
- theVariableElement
object of the java compilerisVarArg
- specifies whether this variable node is a methods var arg parameterresolved
- a map with a mapping from a type variable to its resolved type
-
-
Methodendetails
-
isStatic
public boolean isStatic()Returns whether this variable declaration is a static class attribute- Gibt zurück:
- true if this variable declaration is a static class attribute and false otherwise
-
isFinal
public boolean isFinal()Returns whether this variable declaration is marked final- Gibt zurück:
- true if this variable declaration is marked final and false otherwise
-
transpileType
Returns the transpiled code for the type of this node.- Gibt zurück:
- the transpiled code for the type of this node
-
getTypeNode
Returns the type node of this variable node.- Gibt zurück:
- the type node
-
getTypeCheck
Returns transpiled code to check whether the specified identifier matches the type of this variable.- Parameter:
identifier
- the identifier to be checked- Gibt zurück:
- the type check code
-
getTypeCast
Returns transpiled code for casting the specified identifier to the type of this variable. Casting is only used for Java object types.- Parameter:
identifier
- the identifier- Gibt zurück:
- the transpiled code
-
getName
Gibt den Namen der Variable zurück.- Gibt zurück:
- der Name der Variable
-
transpile
Returns the transpiled code of this node.- Gibt zurück:
- the transpiled code
-