Package org.jboss.forge.roaster.spi
Interface JavaParser
public interface JavaParser
Main interface for Roaster parser implementations.
- Author:
- Lincoln Baxter, III, George Gastaldi
-
Method Summary
Modifier and TypeMethodDescription<T extends JavaSource<?>>
TCreate a new emptyJavaSourceinstance.Read the given source and parse the data into a newJavaUnitinstance.validateSnippet(String code) Checks which problems occur while parsing the provided source code.
-
Method Details
-
create
Create a new emptyJavaSourceinstance.- Type Parameters:
T- the java type- Parameters:
type- desired source type for the java source- Returns:
- either a instance of
Tornullif theJavaSourcetype is not supported by thisJavaParser.
-
parseUnit
Read the given source and parse the data into a newJavaUnitinstance.- Parameters:
data- the source to parse- Returns:
- a
JavaUnitornullif the data format is not recognised by thisJavaParser - Throws:
ParserException- if the source coudn't be parsed
-
validateSnippet
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)
-