public abstract class PS_Report
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getGenerator()
Returns a string describing the program
that generates this PerfSuite report XML document.
|
java.lang.String |
getVersion()
Returns a string describing the DTD version of
this PerfSuite report XML document.
|
java.lang.StringBuilder |
getXmlBuf()
Returns the string buffer that contains the XML content
generated at the parsing time.
|
static PS_Report |
newInstance(java.io.InputStream ais,
boolean validateDTD)
Returns an object of class PS_Report, which is
the result of parsing a PerfSuite report XML document
with the given input stream, with the given DTD validation option.
|
static PS_Report |
newInstance(java.lang.String filename)
Returns an object of class PS_Report, which is
the result of parsing a PerfSuite report XML document
with the given file name, with the DTD validation on.
|
static PS_Report |
newInstance(java.lang.String filename,
boolean validateDTD)
Returns an object of class PS_Report, which is
the result of parsing a PerfSuite report XML document
with the given file name, with the given DTD validation option.
|
static PS_Report |
newInstanceGenXML(java.lang.String filename,
boolean validateDTD,
int genXmlType)
Exactly like the method
newInstance (String filename, boolean validateDTD) ,
except that the XML content could be generated in a string buffer,
which can be obtained after this method by calling
getXmlBuf() . |
void |
setXmlBuf(java.lang.StringBuilder buf) |
java.lang.String |
toString()
Returns a string describing the DTD version
and the generator of this report.
|
public static PS_Report newInstance(java.lang.String filename) throws java.io.FileNotFoundException, java.net.MalformedURLException
If the given file name is null
, standard input is used
as input. This functionality can be used to pipe data in.
The environment variable PS_DEBUG
can be used to control
whether or not debug information on standard out and standard error
are printed out. If it is set to a positive integer, the
debug information will be printed out.
filename
- the name of the PerfSuite report to parse.null
is returned
if the given file is not a valid, currently supported
PerfSuite report XML file.java.io.FileNotFoundException
- if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for reading.java.net.MalformedURLException
- if an unknown protocol is specified.public static PS_Report newInstance(java.lang.String filename, boolean validateDTD) throws java.io.FileNotFoundException, java.net.MalformedURLException
If the given file name is null
, standard input is used
as input. This functionality can be used to pipe data in.
The environment variable PS_DEBUG
can be used to control
whether or not debug information on standard out and standard error
are printed out. If it is set to a positive integer, the
debug information will be printed out.
filename
- the name of the PerfSuite report to parse.validateDTD
- a flag indicating whether to do DTD validation or not.null
is returned
if the given file is not a valid, currently supported
PerfSuite report XML file.java.io.FileNotFoundException
- if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for reading.java.net.MalformedURLException
- if an unknown protocol is specified.java.lang.UnsupportedOperationException
- if the given report is a
PerfSuite HWPC report with the mode
attribute
present, but the value of the mode
attribute
is neither "count" nor "profile".
UnsupportedOperationException
can be thrown only if DTD validation is set to false;
if DTD validation is set to true,
since hwpcreport.dtd specifies that the only allowed values
for mode
attribute
are "count" and "profile",
SAX parser will validate it
and throw a SAXException
,
then this API will convert it
to a RuntimeException
.public static PS_Report newInstance(java.io.InputStream ais, boolean validateDTD) throws java.io.IOException
The environment variable PS_DEBUG
can be used to control
whether or not debug information on standard out and standard error
are printed out. If it is set to a positive integer, the
debug information will be printed out.
ais
- an InputStream object containing the content to parse.validateDTD
- a flag indicating whether to do DTD validation or not.null
is returned
if the given file is not a valid, currently supported
PerfSuite report XML file.java.io.IOException
- an IO exception from the parser, possibly from
a byte stream or character stream supplied by the application.java.lang.UnsupportedOperationException
- if the given report is a
PerfSuite HWPC report with the mode
attribute
present, but the value of the mode
attribute
is neither "count" nor "profile".
UnsupportedOperationException
can be thrown only if DTD validation is set to false;
if DTD validation is set to true,
since hwpcreport.dtd specifies that the only allowed values
for mode
attribute
are "count" and "profile",
SAX parser will validate it
and throw a SAXException
,
then this API will convert it
to a RuntimeException
.public static PS_Report newInstanceGenXML(java.lang.String filename, boolean validateDTD, int genXmlType) throws java.io.FileNotFoundException, java.net.MalformedURLException
newInstance (String filename, boolean validateDTD)
,
except that the XML content could be generated in a string buffer,
which can be obtained after this method by calling
getXmlBuf()
.
Additional parameter besides those in
newInstance (String filename, boolean validateDTD)
:genXmlType
- the type indicating how the XML content should be generated,
with the following meanings:
0: don't generate XML file;
1: generate the same level of indentation,
with top level element tags such as
"<hwpcreport" starting from the first column in a line
-- for extract "--extract";
2: add one level of indentation in XML content
-- for combination "-c" and XML output "-x".java.io.FileNotFoundException
java.net.MalformedURLException
public java.lang.String getVersion()
public java.lang.String getGenerator()
public java.lang.String toString()
toString
in class java.lang.Object
public void setXmlBuf(java.lang.StringBuilder buf)
public java.lang.StringBuilder getXmlBuf()