org.eclipse.hyades.logging.events.cbe.util
Class EventFormatter

java.lang.Object
  extended byorg.eclipse.hyades.logging.events.cbe.util.EventFormatter

public final class EventFormatter
extends java.lang.Object

The EventFormatter class defines a utility object used for converting, serializing and de-serializing CommonBaseEvent and related objects.

Notes:

Since:
1.0
Version:
1.0.1
Author:
Richard K. Duggan, Paul E. Slauenwhite, John K. Gerken
See Also:
org.eclipse.hyades.logging.events.cbe.impl.CommonBaseEvent, org.eclipse.hyades.logging.events.cbe.impl.AssociationEngine, SAXEventHandler

Constructor Summary
EventFormatter()
           
 
Method Summary
static AssociationEngine associationEngineFromCanonicalXML(java.lang.String xmlString)
          Converts an XML fragment to an AssociationEngine object.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.File file)
          Converts an XML document from an File to an array of AssociationEngine objects.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(org.xml.sax.InputSource inputSource)
          Converts an XML document from an InputSource to an array of AssociationEngine objects.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.InputStream inputStream)
          Converts an XML document from an InputStream to an array of AssociationEngine objects.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.lang.String xmlDocString)
          Converts an XML document to an array of AssociationEngine objects.
static CommonBaseEvent eventFromCanonicalXML(java.lang.String xmlString)
          Converts an XML fragment to an CommonBaseEvent object.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.File file)
          Converts an XML document from an File to an array of CommonBaseEvent objects.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(org.xml.sax.InputSource inputSource)
          Converts an XML document from an InputSource to an array of CommonBaseEvent objects.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.InputStream inputStream)
          Converts an XML document from an InputStream to an array of CommonBaseEvent objects.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.lang.String xmlDocString)
          Converts an XML document to an array of CommonBaseEvent objects.
static void fromCanonicalXMLDocString(AssociationEngine associationEngine, java.lang.String xmlDocString)
          Deprecated. Use associationEnginesFromCanonicalXMLDoc(String).
static void fromCanonicalXMLDocString(CommonBaseEvent commonBaseEvent, java.lang.String xmlDocString)
          Deprecated. Use eventsFromCanonicalXMLDoc(String).
static void fromCanonicalXMLString(AssociationEngine associationEngine, java.lang.String xmlString)
          Deprecated. Use associationEngineFromCanonicalXML(String).
static void fromCanonicalXMLString(CommonBaseEvent commonBaseEvent, java.lang.String xmlString)
          Deprecated. Use eventFromCanonicalXML(String).
static java.lang.String toCanonicalXMLDocString(AssociationEngine associationEngine)
          Converts an AssociationEngine object into a formatted serialized XML document.
static java.lang.String toCanonicalXMLDocString(AssociationEngine associationEngine, boolean format)
          Converts an AssociationEngine object into a serialized XML document.
static java.lang.String toCanonicalXMLDocString(CommonBaseEvent commonBaseEvent)
          Converts an CommonBaseEvent object into a formatted serialized XML document.
static java.lang.String toCanonicalXMLDocString(CommonBaseEvent commonBaseEvent, boolean format)
          Converts an CommonBaseEvent object into a serialized XML document.
static java.lang.String toCanonicalXMLString(AssociationEngine associationEngine)
          Converts an AssociationEngine object into a serialized XML fragment.
static java.lang.String toCanonicalXMLString(CommonBaseEvent commonBaseEvent)
          Converts an CommonBaseEvent object into a formatted serialized XML fragment.
static java.lang.String toCanonicalXMLString(CommonBaseEvent commonBaseEvent, boolean format)
          Converts an CommonBaseEvent object into a serialized XML fragment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventFormatter

public EventFormatter()
Method Detail

toCanonicalXMLDocString

public static java.lang.String toCanonicalXMLDocString(AssociationEngine associationEngine)
Converts an AssociationEngine object into a formatted serialized XML document.

Parameters:
associationEngine - The AssociationEngine to serialize.
Returns:
An XML document String representing the parameter AssociationEngine object.
Since:
1.0

toCanonicalXMLDocString

public static java.lang.String toCanonicalXMLDocString(AssociationEngine associationEngine,
                                                       boolean format)
Converts an AssociationEngine object into a serialized XML document. Formatting is based on the format parameter.

Parameters:
associationEngine - The AssociationEngine to serialize.
format - If the serialized XML document is formatted with platform-dependent new line(s) and tab(s).
Returns:
An XML document String representing the parameter AssociationEngine object.
Since:
1.0

toCanonicalXMLString

public static java.lang.String toCanonicalXMLString(AssociationEngine associationEngine)
Converts an AssociationEngine object into a serialized XML fragment.

Parameters:
associationEngine - The AssociationEngine to serialize.
Returns:
An XML fragment String representing the parameter AssociationEngine object.
Since:
1.0

fromCanonicalXMLDocString

public static void fromCanonicalXMLDocString(AssociationEngine associationEngine,
                                             java.lang.String xmlDocString)
Deprecated. Use associationEnginesFromCanonicalXMLDoc(String).

Internalizes a passed XML document String into a passed AssociationEngine object.

Parameters:
associationEngine - The AssociationEngine object to populate.
xmlDocString - The XML document containing the information used to populate the AssociationEngine object.
Since:
1.0

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.lang.String xmlDocString)
                                                                 throws FormattingException
Converts an XML document to an array of AssociationEngine objects.

Parameters:
xmlDocString - The XML document to populate the AssociationEngine object.
Returns:
The AssociationEngines array to be populated by the XML document.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(org.xml.sax.InputSource inputSource)
                                                                 throws FormattingException
Converts an XML document from an InputSource to an array of AssociationEngine objects.

Returns:
The AssociationEngines array to be populated by the XML document.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.InputStream inputStream)
                                                                 throws FormattingException
Converts an XML document from an InputStream to an array of AssociationEngine objects.

Returns:
The AssociationEngines array to be populated by the XML document.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.File file)
                                                                 throws FormattingException
Converts an XML document from an File to an array of AssociationEngine objects.

Returns:
The AssociationEngines array to be populated by the XML document.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

fromCanonicalXMLString

public static void fromCanonicalXMLString(AssociationEngine associationEngine,
                                          java.lang.String xmlString)
Deprecated. Use associationEngineFromCanonicalXML(String).

Internalizes a passed XML fragment String into a passed AssociationEngine object.

Parameters:
associationEngine - The AssociationEngine object to populate.
xmlString - The XML fragment containing the information used to populate the AssociationEngine object.
Since:
1.0

associationEngineFromCanonicalXML

public static AssociationEngine associationEngineFromCanonicalXML(java.lang.String xmlString)
                                                           throws FormattingException
Converts an XML fragment to an AssociationEngine object.

Parameters:
xmlString - The XML fragment to populate the AssociationEngine object.
Returns:
The AssociationEngine to be populated by the XML fragment.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0

toCanonicalXMLDocString

public static java.lang.String toCanonicalXMLDocString(CommonBaseEvent commonBaseEvent)
Converts an CommonBaseEvent object into a formatted serialized XML document.

Parameters:
commonBaseEvent - The CommonBaseEvent to serialize.
Returns:
An XML fragment String representing the parameter CommonBaseEvent object.
Since:
1.0

toCanonicalXMLDocString

public static java.lang.String toCanonicalXMLDocString(CommonBaseEvent commonBaseEvent,
                                                       boolean format)
Converts an CommonBaseEvent object into a serialized XML document. Formatting is based on the format parameter.

Parameters:
commonBaseEvent - The CommonBaseEvent to serialize.
format - If the serialized XML document is formatted with platform-dependent new line(s) and tab(s).
Returns:
An XML fragment String representing the parameter CommonBaseEvent object.
Since:
1.0

toCanonicalXMLString

public static java.lang.String toCanonicalXMLString(CommonBaseEvent commonBaseEvent)
Converts an CommonBaseEvent object into a formatted serialized XML fragment.

Parameters:
commonBaseEvent - The CommonBaseEvent to serialize.
Returns:
An XML fragment String representing the parameter CommonBaseEvent object.
Since:
1.0

toCanonicalXMLString

public static java.lang.String toCanonicalXMLString(CommonBaseEvent commonBaseEvent,
                                                    boolean format)
Converts an CommonBaseEvent object into a serialized XML fragment. Formatting is based on the format parameter.

Parameters:
commonBaseEvent - The CommonBaseEvent to serialize.
format - If the serialized XML fragment is formatted with platform-dependent new line(s) and tab(s).
Returns:
An XML fragment String representing the parameter CommonBaseEvent object.
Since:
1.0

fromCanonicalXMLDocString

public static void fromCanonicalXMLDocString(CommonBaseEvent commonBaseEvent,
                                             java.lang.String xmlDocString)
Deprecated. Use eventsFromCanonicalXMLDoc(String).

Converts an XML document to an CommonBaseEvent object.

If the XML document contains more than one CommonBaseEvent element, the first CommonBaseEvent element if used.

Parameters:
commonBaseEvent - The CommonBaseEvent to be populated by the XML document.
xmlDocString - The XML document to populate the CommonBaseEvent object.
Since:
1.0

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.lang.String xmlDocString)
                                                   throws FormattingException
Converts an XML document to an array of CommonBaseEvent objects.

Parameters:
xmlDocString - The XML document to populate the CommonBaseEvent object.
Returns:
The CommonBaseEvents array to be populated by the XML document.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(org.xml.sax.InputSource inputSource)
                                                   throws FormattingException
Converts an XML document from an InputSource to an array of CommonBaseEvent objects.

Returns:
The CommonBaseEvents array to be populated by the XML document.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.InputStream inputStream)
                                                   throws FormattingException
Converts an XML document from an InputStream to an array of CommonBaseEvent objects.

Returns:
The CommonBaseEvents array to be populated by the XML document.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.File file)
                                                   throws FormattingException
Converts an XML document from an File to an array of CommonBaseEvent objects.

Returns:
The CommonBaseEvents array to be populated by the XML document.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

fromCanonicalXMLString

public static void fromCanonicalXMLString(CommonBaseEvent commonBaseEvent,
                                          java.lang.String xmlString)
Deprecated. Use eventFromCanonicalXML(String).

Converts an XML fragment to an CommonBaseEvent object.

Parameters:
commonBaseEvent - The CommonBaseEvent to be populated by the XML fragment.
xmlString - The XML fragment to populate the CommonBaseEvent object.
Since:
1.0

eventFromCanonicalXML

public static CommonBaseEvent eventFromCanonicalXML(java.lang.String xmlString)
                                             throws FormattingException
Converts an XML fragment to an CommonBaseEvent object.

Parameters:
xmlString - The XML fragment to populate the CommonBaseEvent object.
Returns:
The CommonBaseEvent to be populated by the XML fragment.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0