Package org.jboss.forge.roaster.spi
Interface JavaParser
-
public interface JavaParserMain interface for Roaster parser implementations.- Author:
- Lincoln Baxter, III, George Gastaldi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends JavaSource<?>>
Tcreate(java.lang.Class<T> type)Create a new emptyJavaSourceinstance.JavaUnitparseUnit(java.lang.String data)Read the given source and parse the data into a newJavaUnitinstance.java.util.List<Problem>validateSnippet(java.lang.String code)Checks which problems occur while parsing the provided source code.
-
-
-
Method Detail
-
create
<T extends JavaSource<?>> T create(java.lang.Class<T> type)
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
JavaUnit parseUnit(java.lang.String data)
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
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)
-
-