Class JavaLanguageFrontend


  • public class JavaLanguageFrontend
    extends LanguageFrontend
    Main parser for ONE Java files.
    • Method Detail

      • parse

        protected com.github.javaparser.ast.CompilationUnit parse​(java.io.File file,
                                                                  com.github.javaparser.JavaParser parser)
                                                           throws TranslationException,
                                                                  java.io.FileNotFoundException
        Throws:
        TranslationException
        java.io.FileNotFoundException
      • getCodeFromRawNode

        public <T> java.lang.String getCodeFromRawNode​(T astNode)
        Description copied from class: LanguageFrontend
        Returns the raw code of the ast node, generic for java or c++ ast nodes.
        Specified by:
        getCodeFromRawNode in class LanguageFrontend
        Type Parameters:
        T - the raw ast type
        Parameters:
        astNode - the ast node
        Returns:
        the source code
      • getLocationFromRawNode

        public <T> @Nullable PhysicalLocation getLocationFromRawNode​(T astNode)
        Description copied from class: LanguageFrontend
        Returns the Region of the code with line and column, index starting at 1, generic for java or c++ ast nodes.
        Specified by:
        getLocationFromRawNode in class LanguageFrontend
        Type Parameters:
        T - the raw ast type
        Parameters:
        astNode - the ast node
        Returns:
        the location
      • getTypeAsGoodAsPossible

        public Type getTypeAsGoodAsPossible​(com.github.javaparser.ast.nodeTypes.NodeWithType nodeWithType,
                                            com.github.javaparser.resolution.declarations.ResolvedValueDeclaration resolved)
      • getQualifiedMethodNameAsGoodAsPossible

        public java.lang.String getQualifiedMethodNameAsGoodAsPossible​(com.github.javaparser.ast.expr.MethodCallExpr callExpr)
      • recoverTypeFromUnsolvedException

        public java.lang.String recoverTypeFromUnsolvedException​(java.lang.Throwable ex)
      • getQualifiedNameFromImports

        public java.lang.String getQualifiedNameFromImports​(java.lang.String className)
      • getTypeAsGoodAsPossible

        public Type getTypeAsGoodAsPossible​(com.github.javaparser.ast.type.Type type)
      • getReturnTypeAsGoodAsPossible

        public Type getReturnTypeAsGoodAsPossible​(com.github.javaparser.ast.nodeTypes.NodeWithType nodeWithType,
                                                  com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration resolved)
      • getContext

        public com.github.javaparser.ast.CompilationUnit getContext()