Class AddFormattedMetadataService
java.lang.Object
com.adaptris.core.ServiceImp
com.adaptris.core.services.metadata.AddFormattedMetadataService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Add a formatted metadata item to a Message",
tag="service,metadata")
public class AddFormattedMetadataService
extends ServiceImp
Add a formatted metadata item to a Message.
Allows you to add a new metadata key using String.format()
as the syntax.
In the adapter configuration file this class is aliased as add-formatted-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
doService
(AdaptrisMessage msg) Apply the service to the message.Get the element formatter.protected void
void
prepare()
Prepare for initialisation.void
void
setElementFormatter
(ElementFormatter elementFormatter) Set the element formatter.void
setFormatString
(String formatString) Set the format string that complies withString.format(String, Object...)
.void
setMetadataKey
(String metadatakey) Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
Constructor Details
-
AddFormattedMetadataService
public AddFormattedMetadataService()
-
-
Method Details
-
doService
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
prepare
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
initService
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()- Specified by:
closeService
in classServiceImp
-
getFormatString
- Returns:
- the formatString
-
setFormatString
Set the format string that complies withString.format(String, Object...)
.- Parameters:
formatString
- the formatString to set
-
withFormatString
-
getArgumentMetadataKeys
- Returns:
- the argumentMetadataKeys
-
setArgumentMetadataKeys
- Parameters:
l
- the argumentMetadataKeys to set
-
withArgumentMetadataKeys
-
withArgumentMetadataKeys
-
getMetadataKey
- Returns:
- the metadatakey
-
setMetadataKey
- Parameters:
metadatakey
- the metadatakey to set
-
withMetadataKey
-
getElementFormatter
Get the element formatter.- Returns:
- The element formatter.
-
setElementFormatter
Set the element formatter.- Parameters:
elementFormatter
- The element formatter.
-