cvm.model.handlers.schema
Class NegotiationSchemaParser

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

public class NegotiationSchemaParser
extends java.lang.Object

This class is used to parse the negotiation schema. Negotiation schemas are nothing more than an encasulation around the control and data schemas.

Author:
Frank Hernandez, Raidel Batista, Eddie Incert
See Also:
NegotiationSchema, ControlSchema, DataSchema

Method Summary
static NegotiationSchemaParser getInstance()
          Implementation of the singleton pattern.
 com.thoughtworks.xstream.XStream getXStreamParser()
          This function initializes the XStream parser for parsing the NegotiationSchema/.
 java.lang.String parseSchemaToXML(NegotiationSchema schema)
          This function takes a data schema object and converts it into XML format.
 NegotiationSchema parseXMLToSchema(java.lang.String xmlString)
          This function parses an xml string in the format of a NegotiationSchema/ XML and creates a DataSchema object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NegotiationSchemaParser getInstance()
Implementation of the singleton pattern.

Returns:
singleton instance

getXStreamParser

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

Returns:
XStream instance
See Also:
XStream

parseXMLToSchema

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

Parameters:
xmlString - negotiationSchema in XML
Returns:
DataSchema instance.

parseSchemaToXML

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

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