@ComponentProfile(summary="Convert metadata values to a JSON object that will be set as the payload of the message") public class MetadataToJsonService extends ServiceImp
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
MetadataToJsonService() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg) |
java.lang.Boolean |
getAddTrailingNewline() |
java.lang.Boolean |
getConvertNumeric() |
MetadataFilter |
getMetadataFilter() |
protected void |
initService() |
void |
prepare() |
void |
setAddTrailingNewline(java.lang.Boolean b)
Add a trailing new line to the payload.
|
void |
setConvertNumeric(java.lang.Boolean convertNumeric)
Make an attempt to convert numerics into their number form rather than leaving as strings.
|
void |
setMetadataFilter(MetadataFilter metadataFilter)
Set the metadata filter to be used when generating keys for the JSON payload.
|
MetadataToJsonService |
withAddTrailingNewline(boolean b) |
MetadataToJsonService |
withConvertNumeric(boolean convertNumerics) |
MetadataToJsonService |
withMetadataFilter(MetadataFilter metadataFilter) |
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public void doService(AdaptrisMessage msg) throws ServiceException
ServiceException
public void prepare() throws CoreException
CoreException
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public void setConvertNumeric(java.lang.Boolean convertNumeric)
public java.lang.Boolean getConvertNumeric()
public MetadataToJsonService withConvertNumeric(boolean convertNumerics)
public MetadataFilter getMetadataFilter()
public void setMetadataFilter(MetadataFilter metadataFilter)
metadataFilter
- the filter, default is NoOpMetadataFilter
if not specified.public MetadataToJsonService withMetadataFilter(MetadataFilter metadataFilter)
public void setAddTrailingNewline(java.lang.Boolean b)
The JSON object is emitted without beautification; this allows you to add a new line to the end
of the JSON object if this is required. The newline will be platform dependent c.f.
System.lineSeparator()
.
b
- true to add a trailing new line, default is false
if not otherwise specified.public java.lang.Boolean getAddTrailingNewline()
public MetadataToJsonService withAddTrailingNewline(boolean b)