public final class Roaster extends Object
JavaType
instances.Modifier and Type | Method and Description |
---|---|
static <T extends JavaSource<?>> |
create(Class<T> type)
Create a new empty
JavaSource instance. |
static String |
format(Properties properties,
String source)
Format the given
String as a Java source type, using the given code format Properties |
static String |
format(String source)
Format the given
String as a Java source file, using the built in code format style. |
static JavaType<?> |
parse(char[] data)
Parse the given character array into a new
JavaType instance. |
static <T extends JavaType<?>> |
parse(Class<T> type,
char[] data)
Read the given character array and parse its data into a new
JavaType instance of the given type. |
static <T extends JavaType<?>> |
parse(Class<T> type,
File file)
|
static <T extends JavaType<?>> |
parse(Class<T> type,
InputStream data)
Read the given
InputStream and parse its data into a new JavaType instance of the given type. |
static <T extends JavaType<?>> |
parse(Class<T> type,
String data)
Read the given string and parse its data into a new
JavaType instance of the given type. |
static <T extends JavaType<?>> |
parse(Class<T> type,
URL url)
|
static JavaType<?> |
parse(File file)
|
static JavaType<?> |
parse(InputStream data)
Read the given
InputStream and parse the data into a new JavaType instance. |
static JavaType<?> |
parse(String data)
Parse the given String data into a new
JavaType instance. |
static JavaType<?> |
parse(URL data)
|
static JavaUnit |
parseUnit(InputStream data)
Read the given
InputStream and parse its data into a new JavaUnit instance of the given type. |
static JavaUnit |
parseUnit(String data)
|
static List<Problem> |
validateSnippet(String snippet)
|
public static <T extends JavaSource<?>> T create(Class<T> type)
JavaSource
instance.public static JavaType<?> parse(File file) throws FileNotFoundException
FileNotFoundException
public static JavaType<?> parse(URL data) throws IOException
IOException
public static JavaType<?> parse(InputStream data)
InputStream
and parse the data into a new JavaType
instance.public static JavaType<?> parse(char[] data)
JavaType
instance.public static JavaType<?> parse(String data)
JavaType
instance.public static <T extends JavaType<?>> T parse(Class<T> type, URL url) throws IOException
FileNotFoundException
IOException
public static <T extends JavaType<?>> T parse(Class<T> type, File file) throws FileNotFoundException
FileNotFoundException
public static <T extends JavaType<?>> T parse(Class<T> type, char[] data)
JavaType
instance of the given type.public static List<Problem> validateSnippet(String snippet) throws ParserException
snippet
- any Java codeParserException
- if no JavaParser
implementation could be foundpublic static <T extends JavaType<?>> T parse(Class<T> type, String data)
JavaType
instance of the given type.public static <T extends JavaType<?>> T parse(Class<T> type, InputStream data)
InputStream
and parse its data into a new JavaType
instance of the given type. The
caller is responsible for closing the stream.public static JavaUnit parseUnit(InputStream data)
InputStream
and parse its data into a new JavaUnit
instance of the given type. The
caller is responsible for closing the stream.public static String format(String source)
String
as a Java source file, using the built in code format style.source
- a java source codepublic static String format(Properties properties, String source)
String
as a Java source type, using the given code format Properties
Copyright © 2018 JBoss by Red Hat. All rights reserved.