Class NatureHelper.ProjectHandler
- java.lang.Object
-
- net.ssehub.easy.producer.core.persistence.standard.NatureHelper.ProjectHandler
-
- Enclosing class:
- NatureHelper
private static class NatureHelper.ProjectHandler extends java.lang.ObjectImplements core functionality accessing the project file. May also be implemented in NatureHelper but shall exhibit now the responsibilities.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Modifier Constructor Description privateProjectHandler(java.io.File project)Creates a handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.w3c.dom.NodeaddNature(org.w3c.dom.Node node, java.lang.String nature)Adds a nature tonoderegardless whether it already exists.private org.w3c.dom.NodeaddNatureSection()Add nature-section regardless whether it exists.private org.w3c.dom.NodeListgetNatures()Returns the natures node.private voidwriteBack()Writes back a modified file.
-
-
-
Method Detail
-
getNatures
private org.w3c.dom.NodeList getNatures()
Returns the natures node.- Returns:
- the natures node
-
writeBack
private void writeBack() throws java.io.IOExceptionWrites back a modified file.- Throws:
java.io.IOException- in case that writing back the file fails
-
addNatureSection
private org.w3c.dom.Node addNatureSection()
Add nature-section regardless whether it exists.- Returns:
- the node representing the new nature section
-
addNature
private org.w3c.dom.Node addNature(org.w3c.dom.Node node, java.lang.String nature)Adds a nature tonoderegardless whether it already exists.- Parameters:
node- the node to add the nature tonature- the nature- Returns:
- the node representing the nature entry
-
-