- java.lang.Object
-
- ilusr.core.datamanager.xml.XmlManager
-
public class XmlManager extends Object
- Author:
- Jeff Riggle
-
-
Constructor Summary
Constructors Constructor Description XmlManager(String saveLocation)XmlManager(String saveLocation, XmlGenerator generator, IReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateNewFile(String location)Documentdocument()XmlGeneratorgenerator()voidload()Loads the xml file into memory.voidsave()Saves the xml file to disk.StringsaveLocation()voidsaveLocation(String value)
-
-
-
Constructor Detail
-
XmlManager
public XmlManager(String saveLocation) throws TransformerConfigurationException, ParserConfigurationException, SAXException, IOException
- Parameters:
saveLocation- The location of the xml document.- Throws:
TransformerConfigurationException- When the generated xml cannot be transformed.ParserConfigurationException- When the generated xml cannot be transformed.SAXException- When the xml document cannot be parsed.IOException- When file does not exist or when access is restricted to the file.
-
XmlManager
public XmlManager(String saveLocation, XmlGenerator generator, IReader reader)
- Parameters:
saveLocation- The location of the xml document.generator- A xml generator for creating xml files @see XmlGenerator.reader- A xml reader for reading in xml files @see XmlReader.
-
-
Method Detail
-
saveLocation
public String saveLocation()
- Returns:
- The current xml file location.
-
saveLocation
public void saveLocation(String value)
- Parameters:
value- The new location for the xml file location.
-
createNewFile
public void createNewFile(String location) throws TransformerConfigurationException, ParserConfigurationException
- Parameters:
location- The location the file is to be created in.- Throws:
TransformerConfigurationException- When the generated xml cannot be transformed.ParserConfigurationException- When the generated xml cannot be transformed.
-
generator
public XmlGenerator generator()
- Returns:
- The current @see XmlGenerator.
-
document
public Document document()
- Returns:
- The document associated with this manager.
-
load
public void load() throws SAXException, IOExceptionLoads the xml file into memory.- Throws:
SAXException- When the xml document cannot be parsed.IOException- When file does not exist or when access is restricted to the file.
-
save
public void save() throws TransformerExceptionSaves the xml file to disk.- Throws:
TransformerException- When the generated xml cannot be transformed.
-
-