Class TriggerTypeIdResolver
- java.lang.Object
-
- com.funnelback.publicui.search.model.curator.config.TriggerTypeIdResolver
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsontype.TypeIdResolver
public class TriggerTypeIdResolver extends java.lang.Object implements com.fasterxml.jackson.databind.jsontype.TypeIdResolver
Jackson TypeIdResolver (works out which class to create for different JSON file IDs) which understands curator triggers. We use this to make the JSON config file look a bit nicer (remove common suffixes) and to load different classes depending on the context.
-
-
Field Summary
Fields Modifier and Type Field Description private com.fasterxml.jackson.databind.JavaType
baseType
A Jackson object we need to store from the init method to use later in typeFromId) - Not really sure what it's for.private static java.lang.String
CLASS_SUFFIX
Standard suffix (stripped in config files) for the Trigger class namesprivate static java.lang.String
TRIGGER_IMPLEMENTATION_PACKAGE
Triggers in pubilcui-web - To support triggers which require pulicui-web dependencies these are loaded in preference.private static java.lang.String
TRIGGER_PACKAGE
Triggers in pubilcui-core - In some cases these cannot be run because they lack publicui-web dependencies
-
Constructor Summary
Constructors Constructor Description TriggerTypeIdResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescForKnownTypeIds()
com.fasterxml.jackson.annotation.JsonTypeInfo.Id
getMechanism()
java.lang.String
idFromBaseType()
java.lang.String
idFromValue(java.lang.Object value)
Tell Jackson what 'ID' to put in the file for a given objectjava.lang.String
idFromValueAndType(java.lang.Object value, java.lang.Class<?> suggestedType)
Tell Jackson what 'ID' to put in the file for a given object and it's typevoid
init(com.fasterxml.jackson.databind.JavaType baseType)
com.fasterxml.jackson.databind.JavaType
typeFromId(com.fasterxml.jackson.databind.DatabindContext context, java.lang.String id)
Tell Jackson what class to instantiate for a given ID form a JSON file
-
-
-
Field Detail
-
TRIGGER_PACKAGE
private static final java.lang.String TRIGGER_PACKAGE
Triggers in pubilcui-core - In some cases these cannot be run because they lack publicui-web dependencies- See Also:
- Constant Field Values
-
TRIGGER_IMPLEMENTATION_PACKAGE
private static final java.lang.String TRIGGER_IMPLEMENTATION_PACKAGE
Triggers in pubilcui-web - To support triggers which require pulicui-web dependencies these are loaded in preference.- See Also:
- Constant Field Values
-
CLASS_SUFFIX
private static final java.lang.String CLASS_SUFFIX
Standard suffix (stripped in config files) for the Trigger class names- See Also:
- Constant Field Values
-
baseType
private com.fasterxml.jackson.databind.JavaType baseType
A Jackson object we need to store from the init method to use later in typeFromId) - Not really sure what it's for.
-
-
Method Detail
-
init
public void init(com.fasterxml.jackson.databind.JavaType baseType)
- Specified by:
init
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
-
idFromValue
public java.lang.String idFromValue(java.lang.Object value)
Tell Jackson what 'ID' to put in the file for a given object- Specified by:
idFromValue
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
-
idFromValueAndType
public java.lang.String idFromValueAndType(java.lang.Object value, java.lang.Class<?> suggestedType)
Tell Jackson what 'ID' to put in the file for a given object and it's type- Specified by:
idFromValueAndType
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
-
typeFromId
public com.fasterxml.jackson.databind.JavaType typeFromId(com.fasterxml.jackson.databind.DatabindContext context, java.lang.String id)
Tell Jackson what class to instantiate for a given ID form a JSON file- Specified by:
typeFromId
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
-
getMechanism
public com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism()
- Specified by:
getMechanism
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
-
idFromBaseType
public java.lang.String idFromBaseType()
- Specified by:
idFromBaseType
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
-
getDescForKnownTypeIds
public java.lang.String getDescForKnownTypeIds()
- Specified by:
getDescForKnownTypeIds
in interfacecom.fasterxml.jackson.databind.jsontype.TypeIdResolver
-
-