Package com.github.javaparser
Class Providers
- java.lang.Object
-
- com.github.javaparser.Providers
-
public final class Providers extends Object
Factory for providers of source code for JavaParser. Providers that have no parameter for encoding but need it will use UTF-8.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Provider
provider(File file)
static Provider
provider(File file, Charset encoding)
static Provider
provider(InputStream input)
static Provider
provider(InputStream input, Charset encoding)
static Provider
provider(Reader reader)
static Provider
provider(String source)
static Provider
provider(Path path)
static Provider
provider(Path path, Charset encoding)
static Provider
resourceProvider(ClassLoader classLoader, String pathToResource, Charset encoding)
Provide a Provider from the resource found in class loader with the provided encoding.
As resource is accessed through a class loader, a leading "/" is not allowed in pathToResourcestatic Provider
resourceProvider(String pathToResource)
Provide a Provider from the resource found in the current class loader with UTF-8 encoding.
As resource is accessed through a class loader, a leading "/" is not allowed in pathToResourcestatic Provider
resourceProvider(String pathToResource, Charset encoding)
Provide a Provider from the resource found in the current class loader with the provided encoding.
As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource
-
-
-
Field Detail
-
UTF8
public static final Charset UTF8
-
-
Method Detail
-
provider
public static Provider provider(InputStream input, Charset encoding)
-
provider
public static Provider provider(InputStream input)
-
provider
public static Provider provider(File file, Charset encoding) throws FileNotFoundException
- Throws:
FileNotFoundException
-
provider
public static Provider provider(File file) throws FileNotFoundException
- Throws:
FileNotFoundException
-
provider
public static Provider provider(Path path, Charset encoding) throws IOException
- Throws:
IOException
-
provider
public static Provider provider(Path path) throws IOException
- Throws:
IOException
-
resourceProvider
public static Provider resourceProvider(ClassLoader classLoader, String pathToResource, Charset encoding) throws IOException
Provide a Provider from the resource found in class loader with the provided encoding.
As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource- Throws:
IOException
-
resourceProvider
public static Provider resourceProvider(String pathToResource, Charset encoding) throws IOException
Provide a Provider from the resource found in the current class loader with the provided encoding.
As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource- Throws:
IOException
-
resourceProvider
public static Provider resourceProvider(String pathToResource) throws IOException
Provide a Provider from the resource found in the current class loader with UTF-8 encoding.
As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource- Throws:
IOException
-
-