public class ComponentUtils
extends java.lang.Object
Constructor and Description |
---|
ComponentUtils() |
Modifier and Type | Method and Description |
---|---|
static EventHandler<ErrorEvent> |
createOrGetErrorEventHandler(Component component,
ComponentContext parentContext,
ComponentContext scopedContext) |
static boolean |
hasEquivalentFields(java.lang.Object obj1,
java.lang.Object obj2)
Given two object instances of the same type, this method accesses all their internal fields, to
check if they are equivalent.
|
static boolean |
hasEquivalentState(StateContainer stateContainer1,
StateContainer stateContainer2) |
static boolean |
isEquivalent(Component current,
Component next)
Given two components this method accesses all their internal fields, excluding the fields of
StateContainer if the class type is a Component, to check if they are equivalent.
|
static boolean |
isSameComponentType(Component a,
Component b) |
static void |
raise(ComponentContext c,
java.lang.Exception e)
Reraise an error event up the hierarchy so it can be caught by another component, or reach the
root and cause the application to crash.
|
static LithoMetadataExceptionWrapper |
wrapWithMetadata(ComponentContext c,
java.lang.Exception e)
Uses the given ComponentContext to add metadata to a wrapper exception (if the wrapper doesn't
already exist) and return it.
|
static LithoMetadataExceptionWrapper |
wrapWithMetadata(ComponentTree c,
java.lang.Exception e)
Uses the given ComponentTree to add metadata to a wrapper exception (if the wrapper doesn't
already exist) and return it.
|
public static boolean isEquivalent(Component current, Component next)
current
- current Componentnext
- next Componenttrue
iff the component fields are equivalent.public static boolean hasEquivalentState(StateContainer stateContainer1, StateContainer stateContainer2)
public static boolean hasEquivalentFields(java.lang.Object obj1, java.lang.Object obj2)
obj1
- obj2
- public static void raise(ComponentContext c, java.lang.Exception e)
c
- The component context the error event was caught in.e
- The original exception.public static LithoMetadataExceptionWrapper wrapWithMetadata(ComponentContext c, java.lang.Exception e)
public static LithoMetadataExceptionWrapper wrapWithMetadata(ComponentTree c, java.lang.Exception e)
public static EventHandler<ErrorEvent> createOrGetErrorEventHandler(Component component, ComponentContext parentContext, ComponentContext scopedContext)