Package jamopp.parser.jdt.singlefile
Class JaMoPPJDTSingleFileParser
- java.lang.Object
-
- jamopp.parser.jdt.singlefile.JaMoPPJDTSingleFileParser
-
- All Implemented Interfaces:
JaMoPPParserAPI
public class JaMoPPJDTSingleFileParser extends Object implements JaMoPPParserAPI
-
-
Constructor Summary
Constructors Constructor Description JaMoPPJDTSingleFileParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]findClasspathEntries(Path directory)String[]findSources(Path directory)JavaRootparse(String fileName, InputStream input)Reads an InputStream and parses its content into a Java model instance.ResourceSetparseDirectory(Path dir)Visits all files and directories in a directory and parses all found Java source files.ResourceparseFile(Path file)Reads a file and parses its content into a Java model instance.voidresolveBindings()voidsetExclusionPatterns(String... patterns)voidsetResourceSet(ResourceSet set)Sets the ResourceSet that is used to create Resources if new Resource instances are needed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jamopp.parser.api.JaMoPPParserAPI
parseUri
-
-
-
-
Method Detail
-
setExclusionPatterns
public void setExclusionPatterns(String... patterns)
-
parse
public JavaRoot parse(String fileName, InputStream input)
Description copied from interface:JaMoPPParserAPIReads an InputStream and parses its content into a Java model instance.- Specified by:
parsein interfaceJaMoPPParserAPI- Parameters:
fileName- name of the Java source file which will be read.input- the InputStream to read.- Returns:
- the created Java model instance or null if the InputStream could not be read.
-
parseFile
public Resource parseFile(Path file)
Description copied from interface:JaMoPPParserAPIReads a file and parses its content into a Java model instance.- Specified by:
parseFilein interfaceJaMoPPParserAPI- Parameters:
file- the Java source file.- Returns:
- the created Java model instance contained in its associated Resource instance or null if the file could not be read.
-
parseDirectory
public ResourceSet parseDirectory(Path dir)
Description copied from interface:JaMoPPParserAPIVisits all files and directories in a directory and parses all found Java source files. It is assumed that the given directory is a Java source folder containing sub-directories representing a Java package hierarchy.- Specified by:
parseDirectoryin interfaceJaMoPPParserAPI- Parameters:
dir- the directory to search for Java source files.- Returns:
- a ResourceSet containing all parsed source files with their associated Resources.
-
findSources
public String[] findSources(Path directory) throws IOException
- Throws:
IOException
-
findClasspathEntries
public String[] findClasspathEntries(Path directory) throws IOException
- Throws:
IOException
-
resolveBindings
public void resolveBindings()
-
setResourceSet
public void setResourceSet(ResourceSet set)
Description copied from interface:JaMoPPParserAPISets the ResourceSet that is used to create Resources if new Resource instances are needed. If no ResourceSet is provided, a ResourceSet is created.- Specified by:
setResourceSetin interfaceJaMoPPParserAPI- Parameters:
set- the ResourceSet.
-
-