Klasse TranspilerUnit

java.lang.Object
de.svws_nrw.transpiler.TranspilerUnit

public final class TranspilerUnit extends Object
This class represents information gathered from a compilation unit of the java compiler.
  • Felddetails

    • superTypes

      public final Set<String> superTypes
      a set with the full qualified names of all super types of the class of this transpiler unit
    • allLocalVariables

      public final Map<String,Set<Tree>> allLocalVariables
      a map with a mapping from the local variable name to a set of scopes where it is used
    • allLocalVariablesByScope

      public final Map<Tree,Map<String,VariableTree>> allLocalVariablesByScope
      a map with a mapping from a variable scope to a map with all defined variables by their names
    • allLocalMethodElements

      public final Map<String,Set<ExecutableElement>> allLocalMethodElements
      a map with a mapping from the local method name to a set of ExecutableElement objects
    • allLocalMethods

      public final Map<String,Set<Tree>> allLocalMethods
      a map with a mapping from the local method name to a set of scopes where it is used
    • allLocalMethodsByScope

      public final Map<Tree,Map<String,MethodTree>> allLocalMethodsByScope
      a map with a mapping from a method scope to a map with all defined methods by their names
    • allInvokedMethods

      public final Map<MemberSelectTree,ExecutableElement> allInvokedMethods
      a map with a mapping from a member select tree to the invoked method
    • allDefaultMethodsToBeImplemented

      public final Map<ExecutableElement,List<TypeElement>> allDefaultMethodsToBeImplemented
      a set with all default methods of interfaces implemented by this unit (except this unit is an interface)
    • allIdentifier

      public final List<AbstractMap.SimpleEntry<IdentifierTree,TreePath>> allIdentifier
      a list with all identifiers with the tree path that are visited
    • allImports

      public final Map<IdentifierTree,String> allImports
      a map with all identifiers that are not defined locally and must be imported
    • allDefaultMethodImports

      public final Map<String,LinkedHashSet<String>> allDefaultMethodImports
      a map with all imports for default method implementations
    • allImportsForAnnotations

      public final Map<IdentifierTree,String> 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

      public final Map<IdentifierTree,String> allAnnotations
      a map with all annotation identifiers that are not defined locally and must be imported
    • importsSuper

      public final Map<String,String> 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

      public final Map<String,String> importsFullClassnames
      a map that maps a short class name in case of nested classes to its full class name with it enclosing classes
    • imports

      public final Map<String,String> imports
      a map that maps the name of an identifier to the name of its package
    • annotations

      public final Map<String,String> annotations
      a map that maps the name of an annotation identifier to the name of its package
    • typeParameters

      public final List<String> typeParameters
      the list of type parameter of this class
    • allExpressions

      public final List<ExpressionTree> allExpressions
      a map with all expressions of this transpiler units in the order of their occurrence.
    • allExpressionTypes

      public final Map<ExpressionTree,ExpressionType> allExpressionTypes
      a map that maps all expressions of this transpiler unit to its type
    • mapTreePath

      public final Map<Tree,TreePath> 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 transpiler
      compilationUnit - the compilation unit
      classTree - the class tree
      classElement - the class element
  • Methodendetails

    • isLocal

      public boolean isLocal(TreePath path, IdentifierTree node)
      Checks whether the identifer is a known identifier with a valid scope.
      Parameter:
      path - the tree path object of the identifier
      node - 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

      public String getClassName()
      Returns the class name of this transpiler unit
      Gibt zurück:
      the class name
    • getPackageName

      public String getPackageName()
      Returns the package name of this transpiler unit
      Gibt zurück:
      the package name
    • determineInheritedMembers

      public void determineInheritedMembers(TypeElement elem, List<TypeElement> path)
      Determines all attributes and methods defined in super classes and interfaces recursively.
      Parameter:
      elem - the element that is analyzed
      path - the path in the inheritance tree
    • getIterableTypeArgument

      public TypeMirror 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