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

java.lang.Object
  |
  +--org.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:
CommonBaseEvent, AssociationEngine, SAXEventHandler, XmlUtility

Constructor Summary
EventFormatter()
           
 
Method Summary
static AssociationEngine associationEngineFromCanonicalXML(java.lang.String xmlFragmentString)
          Converts an XML fragment to an AssociationEngine object without validation.
static AssociationEngine associationEngineFromCanonicalXML(java.lang.String xmlFragmentString, boolean validation)
          Potentially validates and converts an XML fragment to an AssociationEngine object.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(org.w3c.dom.Document document)
          Converts a Document Object Model (DOM) to an array of AssociationEngine> objects without validation.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(org.w3c.dom.Document document, boolean validate)
          Potentially validates and converts a Document Object Model (DOM) to an array of AssociationEngine objects.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.File file)
          Converts an XML document from an File to an array of AssociationEngine objects without validation.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.File file, boolean validate)
          Potentially validates and 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 without validation.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(org.xml.sax.InputSource inputSource, boolean validate)
          Potentially validates and c onverts 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 without validation.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.InputStream inputStream, boolean validate)
          Potentially validates and converts an XML document from an InputStream to an array of AssociationEngine objects.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.lang.String xmlDocumentString)
          Converts an XML document to an array of AssociationEngine objects without validation.
static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.lang.String xmlDocumentString, boolean validate)
          Potentially validates and c onverts an XML document to an array of AssociationEngine objects.
static CommonBaseEvent eventFromCanonicalXML(java.lang.String xmlFragmentString)
          Converts an XML fragment to an CommonBaseEvent object without validation.
static CommonBaseEvent eventFromCanonicalXML(java.lang.String xmlFragmentString, boolean validate)
          Potentially validates and converts an XML fragment to an CommonBaseEvent object.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(org.w3c.dom.Document document)
          Converts a Document Object Model (DOM) to an array of CommonBaseEvent objects without validation.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(org.w3c.dom.Document document, boolean validate)
          Potentially validates and converts a Document Object Model (DOM) to an array of CommonBaseEvent objects.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.File file)
          Converts an XML document from an File to an array of CommonBaseEvent objects without validation.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.File file, boolean validate)
          Potentially validates and 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 without validation.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(org.xml.sax.InputSource inputSource, boolean validate)
          Potentially validates and 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 without validation.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.InputStream inputStream, boolean validate)
          Potentially validates and converts an XML document from an InputStream to an array of CommonBaseEvent objects.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.lang.String xmlDocumentString)
          Converts an XML document to an array of CommonBaseEvent objects without validation.
static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.lang.String xmlDocumentString, boolean validate)
          Potentially validates and converts an XML document to an array of CommonBaseEvent objects.
static void fromCanonicalXMLDocString(AssociationEngine associationEngine, java.lang.String xmlDocumentString)
          Deprecated. Use associationEnginesFromCanonicalXMLDoc(String).
static void fromCanonicalXMLDocString(CommonBaseEvent commonBaseEvent, java.lang.String xmlDocumentString)
          Deprecated. Use eventsFromCanonicalXMLDoc(String).
static void fromCanonicalXMLString(AssociationEngine associationEngine, java.lang.String xmlFragmentString)
          Deprecated. Use associationEngineFromCanonicalXML(String).
static void fromCanonicalXMLString(CommonBaseEvent commonBaseEvent, java.lang.String xmlFragmentString)
          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[] associationEngines)
          Converts an array of AssociationEngine objects into a formatted serialized XML document.
static java.lang.String toCanonicalXMLDocString(AssociationEngine[] associationEngines, boolean format)
          Converts an array of AssociationEngine objects into a 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[] commonBaseEvents)
          Converts an array of CommonBaseEvent objects into a formatted serialized XML document.
static java.lang.String toCanonicalXMLDocString(CommonBaseEvent[] commonBaseEvents, boolean format)
          Converts an array of CommonBaseEvent objects into a 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[] associationEngines)
Converts an array of AssociationEngine objects into a formatted serialized XML document.

Parameters:
associationEngines - The array of AssociationEngine objects to serialize.
Returns:
An XML document String representing the parameter array of AssociationEngine objects.
Since:
1.0.1

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

toCanonicalXMLDocString

public static java.lang.String toCanonicalXMLDocString(AssociationEngine[] associationEngines,
                                                       boolean format)
Converts an array of AssociationEngine objects into a serialized XML document. Formatting is based on the format parameter.

Parameters:
associationEngines - The array of AssociationEngine objects 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 array of AssociationEngine objects.
Since:
1.0.1

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 xmlDocumentString)
Deprecated. Use associationEnginesFromCanonicalXMLDoc(String).

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

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

associationEnginesFromCanonicalXMLDoc

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

This API will return null if no AssociationEngine fragments exist in the XML document.

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

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.lang.String xmlDocumentString,
                                                                        boolean validate)
                                                                 throws FormattingException
Potentially validates and c onverts an XML document to an array of AssociationEngine objects.

This API will return null if no AssociationEngine fragments exist in the XML document.

Parameters:
xmlDocumentString - The XML document to populate the AssociationEngines array.
validate - If the XML document is validated using the Common Base Event v1.0.1 schema.
Returns:
The AssociationEngines array to be populated by the XML document, or null.
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 without validation.

This API will return null if no AssociationEngine fragments exist in the XML document.

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

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(org.xml.sax.InputSource inputSource,
                                                                        boolean validate)
                                                                 throws FormattingException
Potentially validates and c onverts an XML document from an InputSource to an array of AssociationEngine objects.

This API will return null if no AssociationEngine fragments exist in the XML document.

Parameters:
validate - If the XML document is validated using the Common Base Event v1.0.1 schema.
Returns:
The AssociationEngines array to be populated by the XML document, or null.
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 without validation.

This API will return null if no AssociationEngine fragments exist in the XML document.

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

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.InputStream inputStream,
                                                                        boolean validate)
                                                                 throws FormattingException
Potentially validates and converts an XML document from an InputStream to an array of AssociationEngine objects.

This API will return null if no AssociationEngine fragments exist in the XML document.

Parameters:
validate - If the XML document is validated using the Common Base Event v1.0.1 schema.
Returns:
The AssociationEngines array to be populated by the XML document, or null.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(org.w3c.dom.Document document)
                                                                 throws FormattingException
Converts a Document Object Model (DOM) to an array of AssociationEngine> objects without validation.

This API will return null if no AssociationEngine elements exist in the Document Object Model (DOM).

Parameters:
document - The Document Object Model (DOM) to populate the AssociationEngines array.
Returns:
The AssociationEngines array to be populated by the Document Object Model (DOM), or null.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(org.w3c.dom.Document document,
                                                                        boolean validate)
                                                                 throws FormattingException
Potentially validates and converts a Document Object Model (DOM) to an array of AssociationEngine objects.

This API will return null if no AssociationEngine elements exist in the Document Object Model (DOM).

Parameters:
document - The Document Object Model (DOM) to populate the AssociationEngines array.
validate - If the Document Object Model (DOM) is validated using the Common Base Event v1.0.1 schema.
Returns:
The AssociationEngines array to be populated by the Document Object Model (DOM), or null.
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 without validation.

This API will return null if no AssociationEngine fragments exist in the XML document.

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

associationEnginesFromCanonicalXMLDoc

public static AssociationEngine[] associationEnginesFromCanonicalXMLDoc(java.io.File file,
                                                                        boolean validate)
                                                                 throws FormattingException
Potentially validates and converts an XML document from an File to an array of AssociationEngine objects.

This API will return null if no AssociationEngine fragments exist in the XML document.

Parameters:
validate - If the XML document is validated using the Common Base Event v1.0.1 schema.
Returns:
The AssociationEngines array to be populated by the XML document, or null.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

fromCanonicalXMLString

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

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

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

associationEngineFromCanonicalXML

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

This API will return null if no AssociationEngine fragment exists in the XML fragment.

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

associationEngineFromCanonicalXML

public static AssociationEngine associationEngineFromCanonicalXML(java.lang.String xmlFragmentString,
                                                                  boolean validation)
                                                           throws FormattingException
Potentially validates and converts an XML fragment to an AssociationEngine object.

This API will return null if no AssociationEngine fragment exists in the XML fragment.

Parameters:
xmlFragmentString - The XML fragment to populate the AssociationEngine object.
Returns:
The AssociationEngine to be populated by the XML fragment, or null.
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 document String representing the parameter CommonBaseEvent object.
Since:
1.0

toCanonicalXMLDocString

public static java.lang.String toCanonicalXMLDocString(CommonBaseEvent[] commonBaseEvents)
Converts an array of CommonBaseEvent objects into a formatted serialized XML document.

Parameters:
commonBaseEvents - The array of CommonBaseEvent objects to serialize.
Returns:
An XML document String representing the parameter array of CommonBaseEvent objects.
Since:
1.0.1

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 object 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 CommonBaseEvent object.
Since:
1.0

toCanonicalXMLDocString

public static java.lang.String toCanonicalXMLDocString(CommonBaseEvent[] commonBaseEvents,
                                                       boolean format)
Converts an array of CommonBaseEvent objects into a serialized XML document. Formatting is based on the format parameter.

Parameters:
commonBaseEvents - The array of CommonBaseEvent objects 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 array of CommonBaseEvent objects.
Since:
1.0.1

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 xmlDocumentString)
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.
xmlDocumentString - The XML document to populate the CommonBaseEvent object.
Since:
1.0

eventsFromCanonicalXMLDoc

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

This API will return null if no CommonBaseEvent fragments exist in the XML document.

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

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.lang.String xmlDocumentString,
                                                          boolean validate)
                                                   throws FormattingException
Potentially validates and converts an XML document to an array of CommonBaseEvent objects.

This API will return null if no CommonBaseEvent fragments exist in the XML document.

Parameters:
xmlDocumentString - The XML document to populate the CommonBaseEvents array.
validate - If the XML document is validated using the Common Base Event v1.0.1 schema.
Returns:
The CommonBaseEvents array to be populated by the XML document, or null.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(org.w3c.dom.Document document)
                                                   throws FormattingException
Converts a Document Object Model (DOM) to an array of CommonBaseEvent objects without validation.

This API will return null if no CommonBaseEvent elements exist in the Document Object Model (DOM).

Parameters:
document - The Document Object Model (DOM) to populate the CommonBaseEvents array.
Returns:
The CommonBaseEvents array to be populated by the Document Object Model (DOM), or null.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(org.w3c.dom.Document document,
                                                          boolean validate)
                                                   throws FormattingException
Potentially validates and converts a Document Object Model (DOM) to an array of CommonBaseEvent objects.

This API will return null if no CommonBaseEvent elements exist in the Document Object Model (DOM).

Parameters:
document - The Document Object Model (DOM) to populate the CommonBaseEvents array.
validate - If the Document Object Model (DOM) is validated using the Common Base Event v1.0.1 schema.
Returns:
The CommonBaseEvents array to be populated by the Document Object Model (DOM), or null.
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 without validation.

This API will return null if no CommonBaseEvent fragments exist in the XML document.

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

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(org.xml.sax.InputSource inputSource,
                                                          boolean validate)
                                                   throws FormattingException
Potentially validates and converts an XML document from an InputSource to an array of CommonBaseEvent objects.

This API will return null if no CommonBaseEvent fragments exist in the XML document.

Parameters:
validate - If the XML document is validated using the Common Base Event v1.0.1 schema.
Returns:
The CommonBaseEvents array to be populated by the XML document, or null.
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 without validation.

This API will return null if no CommonBaseEvent fragments exist in the XML document.

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

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.InputStream inputStream,
                                                          boolean validate)
                                                   throws FormattingException
Potentially validates and converts an XML document from an InputStream to an array of CommonBaseEvent objects.

This API will return null if no CommonBaseEvent fragments exist in the XML document.

Parameters:
validate - If the XML document is validated using the Common Base Event v1.0.1 schema.
Returns:
The CommonBaseEvents array to be populated by the XML document, or null.
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 without validation.

This API will return null if no CommonBaseEvent fragments exist in the XML document.

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

eventsFromCanonicalXMLDoc

public static CommonBaseEvent[] eventsFromCanonicalXMLDoc(java.io.File file,
                                                          boolean validate)
                                                   throws FormattingException
Potentially validates and converts an XML document from an File to an array of CommonBaseEvent objects.

This API will return null if no CommonBaseEvent fragments exist in the XML document.

Parameters:
validate - If the XML document is validated using the Common Base Event v1.0.1 schema.
Returns:
The CommonBaseEvents array to be populated by the XML document, or null.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0.1

fromCanonicalXMLString

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

Converts an XML fragment to an CommonBaseEvent object.

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

eventFromCanonicalXML

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

This API will return null if no CommonBaseEvent fragment exists in the XML fragment.

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

eventFromCanonicalXML

public static CommonBaseEvent eventFromCanonicalXML(java.lang.String xmlFragmentString,
                                                    boolean validate)
                                             throws FormattingException
Potentially validates and converts an XML fragment to an CommonBaseEvent object.

This API will return null if no CommonBaseEvent fragment exists in the XML fragment.

Parameters:
xmlFragmentString - The XML fragment to populate the CommonBaseEvent object.
validate - If the XML fragment is validated using the Common Base Event v1.0.1 schema.
Returns:
The CommonBaseEvent to be populated by the XML fragment, or null.
Throws:
FormattingException - A de-serialization error has occurred.
Since:
1.0