Class TrimMetadataService

All Implemented Interfaces:
AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, MessageEventGenerator, Service, MetadataReformatter, StateManagedComponent

@ComponentProfile(summary="Trim leading/trailing spaces from metadata", tag="service,metadata") public class TrimMetadataService extends ReformatMetadata
Trim a metadata values of leading and trailing whitespace.

Each matching metadata key from ReformatMetadata.getMetadataKeyRegexp() will be trimmed.

In the adapter configuration file this class is aliased as trim-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.

  • Constructor Details

    • TrimMetadataService

      public TrimMetadataService()
    • TrimMetadataService

      public TrimMetadataService(String metadataRegexp)
  • Method Details

    • reformat

      public String reformat(String s, String msgCharset) throws Exception
      Description copied from interface: MetadataReformatter
      Reformat a metadata value
      Parameters:
      s - the string to reformat
      msgCharset - the charset of the message
      Returns:
      the replacment string.
      Throws:
      Exception