Package de.svws_nrw.transpiler
Klasse TranspilerUnit
java.lang.Object
de.svws_nrw.transpiler.TranspilerUnit
This class represents information gathered from a compilation unit
of the java compiler.
-
Feldübersicht
Modifizierer und TypFeldBeschreibungfinal Map
<IdentifierTree, String> a map with all annotation identifiers that are not defined locally and must be importedfinal Map
<String, LinkedHashSet<String>> a map with all imports for default method implementationsfinal Map
<ExecutableElement, List<TypeElement>> a set with all default methods of interfaces implemented by this unit (except this unit is an interface)final List
<ExpressionTree> a map with all expressions of this transpiler units in the order of their occurrence.final Map
<ExpressionTree, ExpressionType> a map that maps all expressions of this transpiler unit to its typea list with all identifiers with the tree path that are visitedfinal Map
<IdentifierTree, String> a map with all identifiers that are not defined locally and must be importedfinal Map
<IdentifierTree, String> a map with all identifiers in annotations that are not defined locally and must be imported bit are not in the import list of allImportsfinal Map
<MemberSelectTree, ExecutableElement> a map with a mapping from a member select tree to the invoked methodfinal Map
<String, Set<ExecutableElement>> a map with a mapping from the local method name to a set ofExecutableElement
objectsa map with a mapping from the local method name to a set of scopes where it is usedfinal Map
<Tree, Map<String, MethodTree>> a map with a mapping from a method scope to a map with all defined methods by their namesa map with a mapping from the local variable name to a set of scopes where it is usedfinal Map
<Tree, Map<String, VariableTree>> a map with a mapping from a variable scope to a map with all defined variables by their namesa map that maps the name of an annotation identifier to the name of its packagea map that maps the name of an identifier to the name of its packagea map that maps a short class name in case of nested classes to its full class name with it enclosing classesa map that maps the name of an identifier to the name of its package, if the identifier was imported in a super classa map containing a mapping between a java compiler abstract syntax tree node ant the corresponding tree path objecta set with the full qualified names of all super types of the class of this transpiler unitthe list of type parameter of this class -
Konstruktorübersicht
KonstruktorBeschreibungTranspilerUnit
(Transpiler transpiler, CompilationUnitTree compilationUnit, ClassTree classTree, TypeElement classElement) Creates a new transpiler unit associated with the specified compilation unit and class. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Determines all the result types for all expression of this transpiler unitvoid
Determines all imports in this transpiler unit.void
determineInheritedMembers
(TypeElement elem, List<TypeElement> path) Determines all attributes and methods defined in super classes and interfaces recursively.Returns the class name of this transpiler unitSearches for the iterable type by recursively traversing the super classes and interfaces of the class of this transpiler unit.Returns the package name of this transpiler unitboolean
isEnum()
Returns whether the class is an enum class or not.boolean
isLocal
(TreePath path, IdentifierTree node) Checks whether the identifer is a known identifier with a valid scope.
-
Felddetails
-
superTypes
a set with the full qualified names of all super types of the class of this transpiler unit -
allLocalVariables
a map with a mapping from the local variable name to a set of scopes where it is used -
allLocalVariablesByScope
a map with a mapping from a variable scope to a map with all defined variables by their names -
allLocalMethodElements
a map with a mapping from the local method name to a set ofExecutableElement
objects -
allLocalMethods
a map with a mapping from the local method name to a set of scopes where it is used -
allLocalMethodsByScope
a map with a mapping from a method scope to a map with all defined methods by their names -
allInvokedMethods
a map with a mapping from a member select tree to the invoked method -
allDefaultMethodsToBeImplemented
a set with all default methods of interfaces implemented by this unit (except this unit is an interface) -
allIdentifier
a list with all identifiers with the tree path that are visited -
allImports
a map with all identifiers that are not defined locally and must be imported -
allDefaultMethodImports
a map with all imports for default method implementations -
allImportsForAnnotations
a map with all identifiers in annotations that are not defined locally and must be imported bit are not in the import list of allImports -
allAnnotations
a map with all annotation identifiers that are not defined locally and must be imported -
importsSuper
a map that maps the name of an identifier to the name of its package, if the identifier was imported in a super class -
importsFullClassnames
a map that maps a short class name in case of nested classes to its full class name with it enclosing classes -
imports
a map that maps the name of an identifier to the name of its package -
annotations
a map that maps the name of an annotation identifier to the name of its package -
typeParameters
the list of type parameter of this class -
allExpressions
a map with all expressions of this transpiler units in the order of their occurrence. -
allExpressionTypes
a map that maps all expressions of this transpiler unit to its type -
mapTreePath
a map containing a mapping between a java compiler abstract syntax tree node ant the corresponding tree path object
-
-
Konstruktordetails
-
TranspilerUnit
public TranspilerUnit(Transpiler transpiler, CompilationUnitTree compilationUnit, ClassTree classTree, TypeElement classElement) Creates a new transpiler unit associated with the specified compilation unit and class.- Parameter:
transpiler
- a reference to the transpilercompilationUnit
- the compilation unitclassTree
- the class treeclassElement
- the class element
-
-
Methodendetails
-
isLocal
Checks whether the identifer is a known identifier with a valid scope.- Parameter:
path
- the tree path object of the identifiernode
- the identifier tree node- Gibt zurück:
- true if identifier is a local identifier
-
isEnum
public boolean isEnum()Returns whether the class is an enum class or not.- Gibt zurück:
- true if the class is an enum class and false otherwise
-
getClassName
Returns the class name of this transpiler unit- Gibt zurück:
- the class name
-
getPackageName
Returns the package name of this transpiler unit- Gibt zurück:
- the package name
-
determineInheritedMembers
Determines all attributes and methods defined in super classes and interfaces recursively.- Parameter:
elem
- the element that is analyzedpath
- the path in the inheritance tree
-
getIterableTypeArgument
Searches for the iterable type by recursively traversing the super classes and interfaces of the class of this transpiler unit.- Gibt zurück:
- the iterable type
-
determineImports
public void determineImports()Determines all imports in this transpiler unit. -
determineExpressionTypes
public void determineExpressionTypes()Determines all the result types for all expression of this transpiler unit
-