Class CryptoFormatter<T>

java.lang.Object
com.bld.crypto.formatter.CryptoFormatter<T>
All Implemented Interfaces:
org.springframework.format.Formatter<T>, org.springframework.format.Parser<T>, org.springframework.format.Printer<T>
Direct Known Subclasses:
CryptoAesFormatter, CryptoJksFormatter, CryptoPubKeyFormatter

public abstract class CryptoFormatter<T> extends Object implements org.springframework.format.Formatter<T>
  • Constructor Details

    • CryptoFormatter

      public CryptoFormatter(com.fasterxml.jackson.databind.ObjectMapper objMapper, Class<T> fieldType)
  • Method Details

    • print

      public String print(T value, Locale locale)
      Specified by:
      print in interface org.springframework.format.Printer<T>
    • parse

      public T parse(String text, Locale locale) throws ParseException
      Specified by:
      parse in interface org.springframework.format.Parser<T>
      Throws:
      ParseException
    • encryptValue

      protected abstract String encryptValue(String word)
    • decrypt

      protected abstract String decrypt(String word)