Package org.jfree.data.xml
Class DatasetReader
java.lang.Object
org.jfree.data.xml.DatasetReader
public class DatasetReader extends Object
A utility class for reading datasets from XML.
-
Constructor Summary
Constructors Constructor Description DatasetReader()
-
Method Summary
Modifier and Type Method Description static SAXParserFactory
getSAXParserFactory()
Returns theSAXParserFactory
used to createSAXParser
instances.static CategoryDataset
readCategoryDatasetFromXML(File file)
Reads aCategoryDataset
from a file.static CategoryDataset
readCategoryDatasetFromXML(InputStream in)
Reads aCategoryDataset
from a stream.static PieDataset
readPieDatasetFromXML(File file)
Reads aPieDataset
from an XML file.static PieDataset
readPieDatasetFromXML(InputStream in)
Reads aPieDataset
from a stream.static void
setSAXParserFactory(SAXParserFactory f)
Sets the SAXParserFactory that will be used to create SAXParser instances.
-
Constructor Details
-
DatasetReader
public DatasetReader()
-
-
Method Details
-
getSAXParserFactory
Returns theSAXParserFactory
used to createSAXParser
instances.- Returns:
- The
SAXParserFactory
(nevernull
).
-
setSAXParserFactory
Sets the SAXParserFactory that will be used to create SAXParser instances. You would only call this method if you wish to configure a new factory because the default does not meet requirements.- Parameters:
f
- the new factory (null
not permitted).
-
readPieDatasetFromXML
Reads aPieDataset
from an XML file.- Parameters:
file
- the file (null
not permitted).- Returns:
- A dataset.
- Throws:
IOException
- if there is a problem reading the file.
-
readPieDatasetFromXML
Reads aPieDataset
from a stream.- Parameters:
in
- the input stream.- Returns:
- A dataset.
- Throws:
IOException
- if there is an I/O error.
-
readCategoryDatasetFromXML
Reads aCategoryDataset
from a file.- Parameters:
file
- the file.- Returns:
- A dataset.
- Throws:
IOException
- if there is a problem reading the file.
-
readCategoryDatasetFromXML
Reads aCategoryDataset
from a stream.- Parameters:
in
- the stream.- Returns:
- A dataset.
- Throws:
IOException
- if there is a problem reading the file.
-