edu.rice.cs.cunit.threadCheck
Class XMLAnnotUtils

java.lang.Object
  extended by edu.rice.cs.cunit.threadCheck.XMLAnnotUtils

public class XMLAnnotUtils
extends java.lang.Object

Utilities to write annotations to an XML configuration.

Author:
Mathias Ricken

Nested Class Summary
static class XMLAnnotUtils.AnnotationToXML
          Utilities for putting annotations into an XML configuration.
static class XMLAnnotUtils.ClassBased
          Utilities for working with class-based thread checker definitions ().
static class XMLAnnotUtils.ConcurrentyDefinitions
          Class that maintains a map between invariants and definitions.
 
Field Summary
private static java.lang.String CD_PREFIX_NOSLASH
          Definition of DEFALT_XML_CONC_DEF_PATH_PREFIX without the trailing '/'
 
Constructor Summary
XMLAnnotUtils()
           
 
Method Summary
static XMLConfig convertConcDefsToClassBasedXML(XMLAnnotUtils.ConcurrentyDefinitions defsAccum)
          Convert the map between invariants and definitions back to a class-based XML configuration ().
static XMLConfig convertConcDefsToConcDefBasedXML(XMLAnnotUtils.ConcurrentyDefinitions defsAccum)
          Convert the map between invariants and definitions back to XML concurrency definitions ().
static XMLConfig convertXMLToClassBasedXML(XMLConfig xc)
          Convert an XML thread checker configuration to a class-based representation ().
static XMLAnnotUtils.ConcurrentyDefinitions convertXMLToConcDefs(XMLConfig xc)
          Convert XML concurrency definitions into a map between invariants and definitions.
static XMLConfig convertXMLToConcDefXML(XMLConfig xc)
          Convert an XML thread checker configuration to an XML concurrency definition configuration ().
static AAddThreadCheckStrategy createDummy()
          Creates enough of a dummy AAddThreadCheckStrategy to let us do our work.
static XMLConfig createEmptyXMLAnnotaations()
          Create an empty set of XML annotations.
static XMLConfig createEmptyXMLConcDefs()
          Create an empty set of XML concurrency definitions.
static XMLAnnotUtils.ConcurrentyDefinitions joinXMLConcDefs(XMLConfig xc, XMLAnnotUtils.ConcurrentyDefinitions defsAccum)
          Add the XML concurrency definitions in xc to the ones already in the accumulator.
static XMLConfig joinXMLConcDefs(XMLConfig concDef1, XMLConfig concDef2)
          Join the two XML concurrency definitions This works for both and .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CD_PREFIX_NOSLASH

private static final java.lang.String CD_PREFIX_NOSLASH
Definition of DEFALT_XML_CONC_DEF_PATH_PREFIX without the trailing '/'

Constructor Detail

XMLAnnotUtils

public XMLAnnotUtils()
Method Detail

convertXMLToConcDefs

public static XMLAnnotUtils.ConcurrentyDefinitions convertXMLToConcDefs(XMLConfig xc)
Convert XML concurrency definitions into a map between invariants and definitions. This works for both and .

Parameters:
xc - new XML concurrency definitions
Returns:
the map between invariants and definitions

joinXMLConcDefs

public static XMLConfig joinXMLConcDefs(XMLConfig concDef1,
                                        XMLConfig concDef2)
Join the two XML concurrency definitions This works for both and .

Parameters:
concDef1 - first XML file
concDef2 - second XML file
Returns:
joined XML concurrency definitions

convertConcDefsToConcDefBasedXML

public static XMLConfig convertConcDefsToConcDefBasedXML(XMLAnnotUtils.ConcurrentyDefinitions defsAccum)
Convert the map between invariants and definitions back to XML concurrency definitions ().

Parameters:
defsAccum - accumulated map
Returns:
XML concurrency definition configuration ()

convertConcDefsToClassBasedXML

public static XMLConfig convertConcDefsToClassBasedXML(XMLAnnotUtils.ConcurrentyDefinitions defsAccum)
Convert the map between invariants and definitions back to a class-based XML configuration ().

Parameters:
defsAccum - accumulated map
Returns:
class-based XML configuration ()

joinXMLConcDefs

public static XMLAnnotUtils.ConcurrentyDefinitions joinXMLConcDefs(XMLConfig xc,
                                                                   XMLAnnotUtils.ConcurrentyDefinitions defsAccum)
Add the XML concurrency definitions in xc to the ones already in the accumulator. This works for both and .

Parameters:
xc - new XML concurrency definitions
defsAccum - accumulator of all the invariants and definitions
Returns:
the accumulator, i.e. defsAccum

convertXMLToClassBasedXML

public static XMLConfig convertXMLToClassBasedXML(XMLConfig xc)
Convert an XML thread checker configuration to a class-based representation (). The input XML configuration can be mixed between and .

Parameters:
xc - input XML thread checker configuration
Returns:
class-based XML thread checker configuration ()

convertXMLToConcDefXML

public static XMLConfig convertXMLToConcDefXML(XMLConfig xc)
Convert an XML thread checker configuration to an XML concurrency definition configuration (). The input XML configuration can be mixed between and .

Parameters:
xc - input XML thread checker configuration
Returns:
XML concurrency definition configuration ()

createDummy

public static AAddThreadCheckStrategy createDummy()
Creates enough of a dummy AAddThreadCheckStrategy to let us do our work.

Returns:
dummy AAddThreadCheckStrategy with limited capabilities

createEmptyXMLConcDefs

public static XMLConfig createEmptyXMLConcDefs()
Create an empty set of XML concurrency definitions.

Returns:
empty set of XML concurrency definitions

createEmptyXMLAnnotaations

public static XMLConfig createEmptyXMLAnnotaations()
Create an empty set of XML annotations.

Returns:
empty set of XML annotations