cvm.model.handlers.schema
Class ControlSchemaParser

java.lang.Object
  extended by cvm.model.handlers.schema.ControlSchemaParser

public class ControlSchemaParser
extends java.lang.Object

This class handles the parsing of the control schema. The control schema as of now has tags.

Author:
Frank Hernandez, Raidel Batista, Eddie Incert

Method Summary
static ControlSchemaParser getInstance()
          Implementation of the singleton design pattern.
 com.thoughtworks.xstream.XStream getXStreamParser()
          This function initializes the XStream parser for parsing the ControlSchema/userSchema.
 ControlSchema openControlSchemaFromXML(java.lang.String xmlFilePath)
           
 java.lang.String parseSchemaToXML(ControlSchema schema)
          This function takes a control schema object and converts it into XML format.
 ControlSchema parseXMLToSchema(java.lang.String xmlString)
          This function parses an xml string in the format of a ControlSchema/userSchem XML and creates a ControlSchema object.
 boolean saveControlSchemaToFile(ControlSchema schema, java.lang.String fileDestDir, java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ControlSchemaParser getInstance()
Implementation of the singleton design pattern.

Returns:
ControlSchemaParser instance.

getXStreamParser

public com.thoughtworks.xstream.XStream getXStreamParser()
This function initializes the XStream parser for parsing the ControlSchema/userSchema.

Returns:
XStream instance
See Also:
XStream

parseXMLToSchema

public ControlSchema parseXMLToSchema(java.lang.String xmlString)
This function parses an xml string in the format of a ControlSchema/userSchem XML and creates a ControlSchema object.

Parameters:
xmlString - userSchema in XML
Returns:
ControlSchema instance.

parseSchemaToXML

public java.lang.String parseSchemaToXML(ControlSchema schema)
This function takes a control schema object and converts it into XML format.

Parameters:
schema - ControlSchema Object
Returns:
XML representation of the object.

saveControlSchemaToFile

public boolean saveControlSchemaToFile(ControlSchema schema,
                                       java.lang.String fileDestDir,
                                       java.lang.String fileName)

openControlSchemaFromXML

public ControlSchema openControlSchemaFromXML(java.lang.String xmlFilePath)