|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.taskdefs.optional.metamata.MMetricsStreamHandler
A handy metrics handler. Most of this code was done only with the screenshots on the documentation since the evaluation version as of this writing does not allow to save metrics or to run it via command line.
This class can be used to transform a text file or to process the output stream directly.
Method Summary | |
protected org.xml.sax.Attributes |
createAttributes(org.apache.tools.ant.taskdefs.optional.metamata.MetricsElement elem)
Create all attributes of a MetricsElement skipping those who have an empty string |
protected java.lang.String |
getConstructType(org.apache.tools.ant.taskdefs.optional.metamata.MetricsElement elem)
return the construct type of the element. |
protected void |
parseOutput()
read each line and process it |
protected void |
processLine(java.lang.String line)
Process a metrics line. |
void |
setProcessErrorStream(java.io.InputStream p1)
Ignore. |
void |
setProcessInputStream(java.io.OutputStream p1)
Ignore. |
void |
setProcessOutputStream(java.io.InputStream is)
Set the inputstream |
void |
start()
Start handling of the streams. |
protected void |
startElement(org.apache.tools.ant.taskdefs.optional.metamata.MetricsElement elem)
Start a new construct. |
void |
stop()
Pretty dangerous business here. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void setProcessInputStream(java.io.OutputStream p1) throws java.io.IOException
setProcessInputStream
in interface ExecuteStreamHandler
p1
- output stream to write to the standard input stream of the
subprocess
java.io.IOException
public void setProcessErrorStream(java.io.InputStream p1) throws java.io.IOException
setProcessErrorStream
in interface ExecuteStreamHandler
p1
- input stream to read from the error stream from the subprocess
java.io.IOException
public void setProcessOutputStream(java.io.InputStream is) throws java.io.IOException
setProcessOutputStream
in interface ExecuteStreamHandler
is
- input stream to read from the error stream from the subprocess
java.io.IOException
public void start() throws java.io.IOException
ExecuteStreamHandler
start
in interface ExecuteStreamHandler
java.io.IOException
public void stop()
stop
in interface ExecuteStreamHandler
protected void parseOutput() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
protected void processLine(java.lang.String line) throws org.xml.sax.SAXException
line
- the line to process, it is normally a line full of metrics.
org.xml.sax.SAXException
protected void startElement(org.apache.tools.ant.taskdefs.optional.metamata.MetricsElement elem) throws org.xml.sax.SAXException
elem
- the element to process.
org.xml.sax.SAXException
- thrown if there is a problem when sending SAX events.protected java.lang.String getConstructType(org.apache.tools.ant.taskdefs.optional.metamata.MetricsElement elem)
elem
- the metrics element to guess for its type.
protected org.xml.sax.Attributes createAttributes(org.apache.tools.ant.taskdefs.optional.metamata.MetricsElement elem)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |