com.ibm.etools.logging.util
Class Converter

java.lang.Object
  |
  +--com.ibm.etools.logging.util.Converter

Deprecated. As of May 25, 2004, logged primitives and complex objects are converted to Common Base Events and serialized to XML based on the Common Base Event v1.0.1 schema.

public final class Converter
extends java.lang.Object

Converter class to convert various record types to Common Base Events and Extended Data Element.

Since:
May 25, 2004
Version:
July 16, 2004
Author:
Paul E. Slauenwhite
See Also:
org.eclipse.hyades.logging.events.cbe.CommonBaseEvent, org.eclipse.hyades.logging.events.cbe.ExtendedDataElement

Constructor Summary
Converter()
          Deprecated.  
 
Method Summary
protected static CommonBaseEvent convertToCommonBaseEvent(java.lang.String xmlFragment)
          Deprecated. As of May 25, 2004, logged primitives and complex objects are converted to Common Base Events and serialized to XML based on the Common Base Event v1.0.1 schema.
protected static ExtendedDataElement convertToExtendedDataElement(java.lang.String xmlFragment)
          Deprecated. As of May 25, 2004, logged primitives and complex objects are converted to Common Base Events and serialized to XML based on the Common Base Event v1.0.1 schema.
protected static ExtendedDataElement[] convertToExtendedDataElements(java.lang.String xmlFragments)
          Deprecated. As of May 25, 2004, logged primitives and complex objects are converted to Common Base Events and serialized to XML based on the Common Base Event v1.0.1 schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Converter

public Converter()
Deprecated. 
Method Detail

convertToCommonBaseEvent

protected static CommonBaseEvent convertToCommonBaseEvent(java.lang.String xmlFragment)
Deprecated. As of May 25, 2004, logged primitives and complex objects are converted to Common Base Events and serialized to XML based on the Common Base Event v1.0.1 schema.

Creates an CommonBaseEvent for the parameter XML fragment using the following rules:

  1. The root tag's name is the 'ExtensionName' property of the CommonBaseEvent.
  2. The CommonBaseEvent 's creationTime property is set to the current time.
  3. All other required CommonBaseEvent properties are set to default values.
  4. Any PCDATA is an ExtendedDataElement of the CommonBaseEvent..
  5. All attributes are ExtendedDataElement (s) of the CommonBaseEvent.
  6. All nested elements are ExtendedDataElement (s) of the CommonBaseEvent.

Pre-Condition: The parameter XML fragment must be a valid and complete XML fragment and not null/empty, an invalid/partial XML fragment or PCDATA.

Parameters:
xmlFragment - The XML fragment to be deserialized to the CommonBaseEvent.
Returns:
The resultant CommonBaseEvent from deserializing the parameter XML fragment.

convertToExtendedDataElement

protected static ExtendedDataElement convertToExtendedDataElement(java.lang.String xmlFragment)
Deprecated. As of May 25, 2004, logged primitives and complex objects are converted to Common Base Events and serialized to XML based on the Common Base Event v1.0.1 schema.

Creates an ExtendedDataElement for the parameter XML fragment using the following rules:

  1. The root tag's name is the 'name' property of the ExtendedDataElement.
  2. Any PCDATA of the root tag (e.g. between open/close tags) is an child ExtendedDataElement with "PCDATA" as the name, "string" as the type and the PCDATA as the string value .
  3. All attributes are child ExtendedDataElement (s) of the ExtendedDataElement.
  4. All nested elements are child ExtendedDataElement (s) of the ExtendedDataElement.

NOTE: All duplicate child ExtendedDataElement names of the ExtendedDataElement will be made unique by appending '_ <counter>' (where <counter> is a zero-based counter of duplicate child ExtendedDataElement names) to the end of each duplicate child ExtendedDataElement name.

Pre-Condition: The parameter XML fragment must be a valid and complete XML fragment and not null/empty, an invalid/partial XML fragment or PCDATA.

Parameters:
xmlFragment - The XML fragment to be deserialized to the ExtendedDataElement.
Returns:
The resultant ExtendedDataElement from deserializing the parameter XML fragment.

convertToExtendedDataElements

protected static ExtendedDataElement[] convertToExtendedDataElements(java.lang.String xmlFragments)
Deprecated. As of May 25, 2004, logged primitives and complex objects are converted to Common Base Events and serialized to XML based on the Common Base Event v1.0.1 schema.

Creates an array of ExtendedDataElement s where an ExtendedDataElement is created for each the root level XML fragment in the parameter XML fragments using the following rules to create each ExtendedDataElement:

  1. The root tag's name is the 'name' property of the ExtendedDataElement.
  2. Any PCDATA of the root tag (e.g. between open/close tags) is an child ExtendedDataElement with "PCDATA" as the name, "string" as the type and the PCDATA as the string value .
  3. All attributes are child ExtendedDataElement (s) of the ExtendedDataElement.
  4. All nested elements are child ExtendedDataElement (s) of the ExtendedDataElement.

NOTE: All duplicate child ExtendedDataElement names of the ExtendedDataElement will be made unique by appending '_ <counter>' (where <counter> is a zero-based counter of duplicate child ExtendedDataElement names) to the end of each duplicate child ExtendedDataElement name.

Pre-Condition: The parameter XML fragments must be valid and complete XML fragments and not null, empty or illegal XML fragments.

Any PCDATA contained within the parameter XML fragments is added to an ExtendedDataElement with "PCDATA" as the name, "string" as the type and the PCDATA as the string value. This 'PCDATA' ExtendedDataElement is always the last ExtendedDataElement in the returned array of ExtendedDataElements.

Parameters:
xmlFragments - The root level XML fragments to be converted to ExtendedDataElements.
Returns:
The resultant array of ExtendedDataElements.