Class BaseTransformingDecoder

All Implemented Interfaces:
Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent
Direct Known Subclasses:
TransformingNameIDDecoder, TransformingNameIdentifierDecoder

public abstract class BaseTransformingDecoder
extends AbstractIdentifiableInitializableComponent
Regular expression, etc. transform of an identifier.
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • transforms

      @Nonnull @NonnullElements private List<Pair<Pattern,​String>> transforms
      Match patterns and replacement strings to apply.
    • uppercase

      private boolean uppercase
      Convert to uppercase prior to transforms?
    • lowercase

      private boolean lowercase
      Convert to lowercase prior to transforms?
  • Constructor Details

    • BaseTransformingDecoder

      public BaseTransformingDecoder()
      Constructor.
  • Method Details

    • setUppercase

      public void setUppercase​(boolean flag)
      Controls conversion to uppercase prior to applying any transforms.
      Parameters:
      flag - uppercase flag
      Since:
      4.1.0
    • setLowercase

      public void setLowercase​(boolean flag)
      Controls conversion to lowercase prior to applying any transforms.
      Parameters:
      flag - lowercase flag
      Since:
      4.1.0
    • setTransforms

      public void setTransforms​(@Nonnull @NonnullElements Collection<Pair<String,​String>> newTransforms)
      A collection of regular expression and replacement pairs.
      Parameters:
      newTransforms - collection of replacement transforms
    • decode

      @Nullable protected String decode​(@Nonnull @NotEmpty String id)
      Apply configured transforms to input identifier.
      Parameters:
      id - the identifier to transform
      Returns:
      transformed value