org.semwebcentral.sweetrules.ruleml
Class SweetRuleMLJaxbBridge

java.lang.Object
  extended byorg.semwebcentral.sweetrules.ruleml.SweetRuleMLJaxbBridge

public final class SweetRuleMLJaxbBridge
extends java.lang.Object

Created on Nov 5, 2004 The RuleML serializer/deserializer

Author:
Shashidhara K Ganjugunte, Dr. Benjamin Grosof, Dr. Said Tabet, Chitravanu Neogy

Field Summary
private  JAXBContext jaxbContext
          The JAXBContext
private  Marshaller marshaller
          The marshaller
private static SweetRuleMLJaxbBridge ruleMLJaxbBridge
          The RuleML JaxbBridge singleton instance
private  Unmarshaller unMarshaller
          The unmarshaller
 
Constructor Summary
private SweetRuleMLJaxbBridge()
          The private constructor for the singleton instance
 
Method Summary
 org.semwebcentral.sweetrules.ruleml.sweetrulemlobjectmodel.RulebaseType deSerialize(java.lang.String ruleMLRulebase)
          Deserializes a RuleML rule base (in XML encoding) (synchronized to ensure thread safety of the singleton members)
static SweetRuleMLJaxbBridge getInstance()
          Accessor method for the singleton
 java.lang.String serialize(org.semwebcentral.sweetrules.ruleml.sweetrulemlobjectmodel.RulebaseType rb)
          Serializes a RuleML rule base into XML (synchronized to ensure thread safety of the singleton members)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jaxbContext

private JAXBContext jaxbContext
The JAXBContext


marshaller

private Marshaller marshaller
The marshaller


unMarshaller

private Unmarshaller unMarshaller
The unmarshaller


ruleMLJaxbBridge

private static SweetRuleMLJaxbBridge ruleMLJaxbBridge
The RuleML JaxbBridge singleton instance

Constructor Detail

SweetRuleMLJaxbBridge

private SweetRuleMLJaxbBridge()
                       throws SweetException
The private constructor for the singleton instance

Throws:
SweetException - if an error occurs
Method Detail

getInstance

public static SweetRuleMLJaxbBridge getInstance()
                                         throws SweetException
Accessor method for the singleton

Returns:
The singleton object
Throws:
SweetException - if an error occurs

serialize

public java.lang.String serialize(org.semwebcentral.sweetrules.ruleml.sweetrulemlobjectmodel.RulebaseType rb)
                           throws SweetException
Serializes a RuleML rule base into XML (synchronized to ensure thread safety of the singleton members)

Parameters:
rb - The rulebase to serialize
Returns:
The serialized rulebase
Throws:
SweetException - if an error occurs

deSerialize

public org.semwebcentral.sweetrules.ruleml.sweetrulemlobjectmodel.RulebaseType deSerialize(java.lang.String ruleMLRulebase)
                                                                                    throws SweetException
Deserializes a RuleML rule base (in XML encoding) (synchronized to ensure thread safety of the singleton members)

Parameters:
ruleMLRulebase - The ruleML rule base in XML encoding
Returns:
The de serialized rulebase
Throws:
SweetException - if an error occurs