Package edu.hm.hafner.analysis.registry
Class ParserRegistry
- java.lang.Object
-
- edu.hm.hafner.analysis.registry.ParserRegistry
-
public class ParserRegistry extends Object
Provides aParserRegistrythat returns a map for all available Parsers.- Author:
- Lorenz Munsch
-
-
Constructor Summary
Constructors Constructor Description ParserRegistry()Creates a new registry instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(String id)Returns whether a parser with the specified ID exists.ParserDescriptorget(String id)Returns theParserDescriptorwith the specified ID.List<ParserDescriptor>getAllDescriptors()Returns all descriptors.Set<String>getIds()Returns the IDs of all available parsers.Set<String>getNames()Returns the names of all available parsers.static voidmain(String[] unused)Utility to create a report with all available descriptors.
-
-
-
Method Detail
-
getIds
public Set<String> getIds()
Returns the IDs of all available parsers.- Returns:
- a set of all IDs
-
getNames
public Set<String> getNames()
Returns the names of all available parsers.- Returns:
- a set of all names
-
contains
public boolean contains(String id)
Returns whether a parser with the specified ID exists.- Parameters:
id- the ID to check- Returns:
trueif the parser exists,falseotherwise
-
get
public ParserDescriptor get(String id)
Returns theParserDescriptorwith the specified ID.- Parameters:
id- the ID of the parser- Returns:
- the requested descriptor
- Throws:
NoSuchElementException- if no such parser exists
-
getAllDescriptors
public List<ParserDescriptor> getAllDescriptors()
Returns all descriptors.- Returns:
- all supported descriptors
-
main
public static void main(String[] unused) throws IOException
Utility to create a report with all available descriptors. The report will be stored in the file "SUPPORTED-FORMATS.md" in the top level directory.- Parameters:
unused- not used- Throws:
IOException- of the file `SUPPORTED-FORMATS.md` cannot be written locally
-
-