metricsOverlay.xml
Class XMLManager

java.lang.Object
  extended by metricsOverlay.xml.XMLManager

public class XMLManager
extends java.lang.Object

This singleton class manages the stored location of XML files for the plug-in.

Version:
26/6/2009
Author:
Matthew Harward

Method Summary
static java.lang.String extractXMLPath(org.eclipse.core.runtime.IPath path)
          This method extracts the appropriate XML path, given the absolute path of a java file.
static XMLManager getInstance()
          Returns an instance of this singleton class.
 MetricDocument locateXML(org.eclipse.core.runtime.IPath path)
          This method locates the XML for a Java file used in eclipse, reads in the XML and creates a document representing the metrics to be overlaid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static XMLManager getInstance()
Returns an instance of this singleton class.

Returns:
an instance of the class.

locateXML

public MetricDocument locateXML(org.eclipse.core.runtime.IPath path)
This method locates the XML for a Java file used in eclipse, reads in the XML and creates a document representing the metrics to be overlaid.

Parameters:
path - the absolute path to the Java file.
Returns:
a document containing all of the metrics information.

extractXMLPath

public static java.lang.String extractXMLPath(org.eclipse.core.runtime.IPath path)
This method extracts the appropriate XML path, given the absolute path of a java file. If the Eclipse project's source code is in a file named "src" the code is placed in an identical adjacent directory structure, "metricsxml". If this is not the case, for each directory (effectively per package) containing Java files, a sub-directory is created called "packagemetricsxml". These directory's contain all of the XML information that can be used by the program. Any applications seeking to produce XML for this plug-in need to populate these directories.

Parameters:
path - the absolute path of the Java file.