- 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 void
createNewFile(String location)
Document
document()
XmlGenerator
generator()
void
load()
Loads the xml file into memory.void
save()
Saves the xml file to disk.String
saveLocation()
void
saveLocation(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, IOException
Loads 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 TransformerException
Saves the xml file to disk.- Throws:
TransformerException
- When the generated xml cannot be transformed.
-
-