Class RecipeXMLParser
- java.lang.Object
-
- fr.ens.biologie.genomique.aozan.aozan3.recipe.RecipeXMLParser
-
public class RecipeXMLParser extends Object
This class define a recipe XML parser.- Since:
- 3.0
- Author:
- Laurent Jourdren
-
-
Constructor Summary
Constructors Constructor Description RecipeXMLParser(Configuration conf, Configuration cliConf, fr.ens.biologie.genomique.kenetre.log.GenericLogger logger)
Public constructor.RecipeXMLParser(Configuration conf, fr.ens.biologie.genomique.kenetre.log.GenericLogger logger)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Path
getIncludePath(Element element, String source)
Get the path of a file to include.protected fr.ens.biologie.genomique.kenetre.log.GenericLogger
getLogger()
Get the logger.protected String
getRootTagName()
Get the root tag nameE
parse(InputStream is)
Parse XML as an input stream.E
parse(InputStream is, String source)
Parse XML as an input stream.E
parse(Path path)
Parse XML as an input stream.protected Recipe
parse(NodeList nList, String source)
Parse a run step XML tag.
-
-
-
Constructor Detail
-
RecipeXMLParser
public RecipeXMLParser(Configuration conf, fr.ens.biologie.genomique.kenetre.log.GenericLogger logger)
Public constructor.- Parameters:
conf
- initial configurationlogger
- default logger
-
RecipeXMLParser
public RecipeXMLParser(Configuration conf, Configuration cliConf, fr.ens.biologie.genomique.kenetre.log.GenericLogger logger)
Public constructor.- Parameters:
conf
- initial configurationcliConf
- configuration that will overwrite global configuration of the recipelogger
- default logger
-
-
Method Detail
-
parse
protected Recipe parse(NodeList nList, String source) throws Aozan3Exception
Parse a run step XML tag.- Parameters:
nList
- node listsource
- XML source description- Returns:
- a list with step objects
- Throws:
Aozan3Exception
- if an error occurs while parsing the XML
-
getLogger
protected fr.ens.biologie.genomique.kenetre.log.GenericLogger getLogger()
Get the logger.- Returns:
- the logger
-
getRootTagName
protected String getRootTagName()
Get the root tag name- Returns:
- the root tag name
-
parse
public E parse(Path path) throws Aozan3Exception
Parse XML as an input stream.- Parameters:
path
- file path- Returns:
- a list of Step
- Throws:
Aozan3Exception
- if an error occurs while parsing the file
-
parse
public E parse(InputStream is) throws Aozan3Exception
Parse XML as an input stream.- Parameters:
is
- input stream- Returns:
- a Recipe object
- Throws:
Aozan3Exception
- if an error occurs while parsing the file
-
parse
public E parse(InputStream is, String source) throws Aozan3Exception
Parse XML as an input stream.- Parameters:
is
- input streamsource
- XML source description- Returns:
- a Recipe object
- Throws:
Aozan3Exception
- if an error occurs while parsing the file
-
getIncludePath
protected Path getIncludePath(Element element, String source) throws Aozan3Exception
Get the path of a file to include.- Parameters:
element
- element to parse- Returns:
- a Path object if the element to include exists or null
- Throws:
Aozan3Exception
- if other attribute than include exists for the tag
-
-