Forge - Parent 1.0.0.Final

org.jboss.forge.parser
Class JavaParser

java.lang.Object
  extended by org.jboss.forge.parser.JavaParser

public final class JavaParser
extends Object

Responsible for parsing data into new JavaClass instances.

Author:
Lincoln Baxter, III

Field Summary
static ServiceLoader<JavaParserProvider> loader
           
 
Constructor Summary
JavaParser()
           
 
Method Summary
static
<T extends JavaSource<?>>
T
create(Class<T> type)
          Create a new empty JavaClass instance.
static JavaSource<?> parse(char[] data)
          Parse the given character array into a new JavaClass instance.
static
<T extends JavaSource<?>>
T
parse(Class<T> type, char[] data)
          Read the given character array and parse its data into a new JavaSource instance of the given type.
static
<T extends JavaSource<?>>
T
parse(Class<T> type, File file)
          Read the given File and parse its data into a new JavaSource instance of the given type.
static
<T extends JavaSource<?>>
T
parse(Class<T> type, InputStream data)
          Read the given InputStream and parse its data into a new JavaSource instance of the given type.
static
<T extends JavaSource<?>>
T
parse(Class<T> type, String data)
          Read the given string and parse its data into a new JavaSource instance of the given type.
static JavaSource<?> parse(File file)
          Open the given File, parsing its contents into a new JavaClass instance.
static JavaSource<?> parse(InputStream data)
          Read the given InputStream and parse the data into a new JavaClass instance.
static JavaSource<?> parse(String data)
          Parse the given String data into a new JavaClass instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loader

public static ServiceLoader<JavaParserProvider> loader
Constructor Detail

JavaParser

public JavaParser()
Method Detail

parse

public static JavaSource<?> parse(File file)
                           throws FileNotFoundException
Open the given File, parsing its contents into a new JavaClass instance.

Throws:
FileNotFoundException

parse

public static JavaSource<?> parse(InputStream data)
Read the given InputStream and parse the data into a new JavaClass instance.


parse

public static JavaSource<?> parse(char[] data)
Parse the given character array into a new JavaClass instance.


parse

public static JavaSource<?> parse(String data)
Parse the given String data into a new JavaClass instance.


create

public static <T extends JavaSource<?>> T create(Class<T> type)
Create a new empty JavaClass instance.


parse

public static <T extends JavaSource<?>> T parse(Class<T> type,
                                                File file)
                                     throws FileNotFoundException
Read the given File and parse its data into a new JavaSource instance of the given type.

Throws:
FileNotFoundException

parse

public static <T extends JavaSource<?>> T parse(Class<T> type,
                                                InputStream data)
Read the given InputStream and parse its data into a new JavaSource instance of the given type.


parse

public static <T extends JavaSource<?>> T parse(Class<T> type,
                                                char[] data)
Read the given character array and parse its data into a new JavaSource instance of the given type.


parse

public static <T extends JavaSource<?>> T parse(Class<T> type,
                                                String data)
Read the given string and parse its data into a new JavaSource instance of the given type.


Forge - Parent 1.0.0.Final

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.