Interface JavaParser

    • Method Detail

      • create

        <T extends JavaSource<?>> T create​(java.lang.Class<T> type)
        Create a new empty JavaSource instance.
        Type Parameters:
        T - the java type
        Parameters:
        type - desired source type for the java source
        Returns:
        either a instance of T or null if the JavaSource type is not supported by this JavaParser.
      • parseUnit

        JavaUnit parseUnit​(java.lang.String data)
        Read the given source and parse the data into a new JavaUnit instance.
        Parameters:
        data - the source to parse
        Returns:
        a JavaUnit or null if the data format is not recognised by this JavaParser
        Throws:
        ParserException - if the source coudn't be parsed
      • validateSnippet

        java.util.List<Problem> validateSnippet​(java.lang.String code)
        Checks which problems occur while parsing the provided source code.
        Parameters:
        code - the code to parse
        Returns:
        a list of problems which occurred (maybe empty but not null)