This package provides classes to interpret the results produced by classes
in analysis.hit. A judgement extends the abstract Judgement class and
implements its methods. Each judgement corresponds to a hit analysis class and
is designed specifically to read and interpret the XML results produced when a
hit analysis returns its results to the file system. As a result, each
judgement must be carefully tailored to interpret the data extracted by hit
analysis, and the two classes should be written by the same developer or at
least by a small team of developers who work together extremely closely.
Judgement
This is an abstract class designed to define the functionality of judgement
classes and to restrict that functionality sufficiently that it can be applied
within a generic framework. Any judgement class must extend Judgment and
implement the methods it defines.
It should be noted that Judgment has far fewer abstract methods than
its cousin HitAnalysis. This is because Judgement has far greater freedom from
the Master, since it does not require input from a data file after it has been
initialized. However, this also means that it is up to the developer to break
up sub-tasks in an efficient and easily-digested way.
- protected Judgement()
- This do-nothing constructor allows Judgement to be extended.
- protected Judgement(File inputFile) throws JAXBException
- This constructor passes input to Judgement in the form of a file on
disk. It should be uncommon that this constructor is used, but it is
available for the sake of flexibility. An exception is thrown if the format of
inputFile does not correspond to the expected Judgement input format.
- protected Judgement(JudgementInputType input) throws JAXBException
- This constructor is called by the Master, and passes Judgement its input
through a live connection rather than through an intermediate file. A
constructor with this signature must be present in any class that extends
Judgement so it can interact with the Master. This constructor must also
call super(input) in order to initialize the necessary elements in the abstract
class.
- public abstract void analyze() throws JAXBException
- This method is called by the Master and instructs the judgement class to
interpret and analyze the results exported by its related hit analysis. This
method is very broad, and should iterate over the entire Tree structure.
- public abstract void exportXML() throws JAXBException, IOException
- This method should create and write to a file on disk that will contain
the findings of the judgement. The XML format for the results can be found
here. No convenience method has
been provided, since the structure of the output is very simple.
- public abstract void finalize() throws JAXBException
- This method is called by the Master before exportXML() but after analyze().
The purpose of this method is to provide a convenient place to perform any
clean-up or final checks that must be made before making a determination about
the DOMs examined in the test. This method should also contain the code that
makes the final determination about the DOMs. However, if the developer wishes
to include this code in the analyze() method, for whatever reason, this method
could potentially be left empty without harm to the test structure. However,
since this would compromise the uniformity of the testing structure and make
the code more difficult for others to understand, this practice is not
recommended.