Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.hyades.logging.events.cbe.impl
Class TemplateContentHandlerImpl

    java.lang.Object
      |
      +--org.eclipse.hyades.logging.events.cbe.impl.TemplateContentHandlerImpl

All Implemented Interfaces:
  ContentHandler, TemplateContentHandler

public class TemplateContentHandlerImpl
extends java.lang.Object
implements TemplateContentHandler

Concrete implementation of the `TemplateContentHandler` interface for specifying a template event.

The template event is used to store event configuration properties that are merged into the parameter event in the implementation of the `completeEvent(CommonBaseEvent event)` API.

This implementation preserves the precedence rules for merging event properties in the `completeEvent(CommonBaseEvent event)` API. The precedence rules for merging event properties are as follows:

1) The 'template event' contains the event properties to be merged into the 'base event'. 2) String and primitive property values in the 'base event' are considered 'golden' when the same property is set in the 'template event'. 3) List property values in the 'template event' are concatenated to the associated list property in the 'base event'. 4) Complex (e.g. objects excluding strings) property values in the 'base event' are internally compared to the associated 'template event' property using the above rules.

For security reasons, once a non-null template event has been set on `TemplateContentHandler` instance, no other template event can be set for the life cycle of the `TemplateContentHandler` instance.

Synchronization is the responsibility of the caller based on their specific run-time environment.

Since:
  1.0.1
Version:
  1.0.1
Author:
  Paul E Slauenwhite
See Also:
  `TemplateContentHandler`

Constructor Summary
`TemplateContentHandlerImpl()`

Method Summary
`void` | `completeEvent(CommonBaseEvent event)` Allows the content handler to modify or complete the contents of the event passed as a parameter.
`CommonBaseEvent` | `getTemplateEvent()` Gets the template event associated with this content handler instance.
`void` | `setTemplateEvent(CommonBaseEvent templateEvent)` Sets a new template event on this content handler instance.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TemplateContentHandlerImpl

    public TemplateContentHandlerImpl()

Method Detail

### completeEvent

    public void completeEvent(CommonBaseEvent event)
                       throws CompletionException

  Description copied from interface: `ContentHandler`

  Allows the content handler to modify or complete the contents of the event passed as a parameter.

  Specified by:
    `completeEvent` in interface `ContentHandler`
  Parameters:
    `event` - event to modified or completed.
  Throws:
    `CompletionException` - if the event cannot be completed for whatever reason.
  See Also:
    `ContentHandler.completeEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent)`

### getTemplateEvent

    public CommonBaseEvent getTemplateEvent()

  Deprecated. As of Hyades M10, `TemplateContentHandler` implementations should not return references their template event. This API always returns null.

  Description copied from interface: `TemplateContentHandler`
  Gets the template event associated with this content handler instance.

  The template event is used to store event configuration properties that are merged into the parameter event in the implementation of the `completeEvent(CommonBaseEvent event)` API.

  Specified by:
    `getTemplateEvent` in interface `TemplateContentHandler`
  Returns:
    The template event associated with this content handler instance, otherwise null.
  See Also:
    `TemplateContentHandler.getTemplateEvent()`

### setTemplateEvent

    public void setTemplateEvent(CommonBaseEvent templateEvent)

  Description copied from interface: `TemplateContentHandler`
  Sets a new template event on this content handler instance.

  The template event is used to store event configuration properties that are merged into the parameter event in the implementation of the `completeEvent(CommonBaseEvent event)` API.

  For security reasons, once a non-null template event has been set on `TemplateContentHandler` instance, no other template event can be set for the life cycle of the `TemplateContentHandler` instance.

  Specified by:
    `setTemplateEvent` in interface `TemplateContentHandler`
  Parameters:
    `templateEvent` - The new template event associated with this content handler instance.
  See Also:
    `TemplateContentHandler.setTemplateEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent)`

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD