Class CodecWrappers


  • public final class CodecWrappers
    extends java.lang.Object
    This is just a helper class during transition when multiple codecs are supported. One day this should all go away when there is only 1 type of json and xml codecs each. For adding custom codecs to Discovery, prefer creating a custom EurekaJerseyClient to added to DiscoveryClient either completely independently or via EurekaJerseyClientImpl.EurekaJerseyClientBuilder#withDecoderWrapper(DecoderWrapper) and EurekaJerseyClientImpl.EurekaJerseyClientBuilder#withEncoderWrapper(EncoderWrapper)
    • Constructor Detail

      • CodecWrappers

        public CodecWrappers()
    • Method Detail

      • registerWrapper

        public static void registerWrapper​(CodecWrapper wrapper)
        For transition use: register a new codec wrapper.
      • getCodecName

        public static <T extends CodecWrapperBase> java.lang.String getCodecName​(java.lang.Class<T> clazz)
      • getCodec

        public static CodecWrapper getCodec​(java.lang.String name)
      • getEncoder

        public static EncoderWrapper getEncoder​(java.lang.String name)
      • resolveDecoder

        public static DecoderWrapper resolveDecoder​(java.lang.String name,
                                                    java.lang.String eurekaAccept)
        Resolve the decoder to use based on the specified decoder name, as well as the specified eurekaAccept. The eurekAccept trumps the decoder name if the decoder specified is one that is not valid for use for the specified eurekaAccept.
      • getDecoder

        public static DecoderWrapper getDecoder​(java.lang.String name)