Class ProxyDecoder

  • All Implemented Interfaces:
    Decoder<java.lang.Object>

    public final class ProxyDecoder
    extends java.lang.Object
    implements Decoder<java.lang.Object>
    Allows a user to create an object from an interface and retrieve configuration values. Gestalt expects a standard java bean where the member value would be carModel then the method would be String getCarModel() If the interface has a default method and is missing a config, it will return the default value.
    • Constructor Detail

      • ProxyDecoder

        public ProxyDecoder()
    • Method Detail

      • applyConfig

        public void applyConfig​(GestaltConfig config)
        Description copied from interface: Decoder
        Apply the GestaltConfig to the Decoder. Needed when building via the ServiceLoader It is a default method as most Decoders don't need to apply configs.
        Specified by:
        applyConfig in interface Decoder<java.lang.Object>
        Parameters:
        config - GestaltConfig to update the ConfigLoader
      • priority

        public Priority priority()
        must have a higher priority than the object decoder.
        Specified by:
        priority in interface Decoder<java.lang.Object>
        Returns:
        VERY_LOW
      • name

        public java.lang.String name()
        Description copied from interface: Decoder
        Name of the encoder.
        Specified by:
        name in interface Decoder<java.lang.Object>
        Returns:
        encoder name
      • canDecode

        public boolean canDecode​(java.lang.String path,
                                 Tags tags,
                                 ConfigNode node,
                                 TypeCapture<?> type)
        Description copied from interface: Decoder
        true if this decoder matches the type capture.
        Specified by:
        canDecode in interface Decoder<java.lang.Object>
        Parameters:
        path - the current path
        tags - the tags for the current request
        node - the current node we are decoding.
        type - the type of object we are decoding.
        Returns:
        true if this decoder matches the type capture
      • decode

        public GResultOf<java.lang.Object> decode​(java.lang.String path,
                                                  Tags tags,
                                                  ConfigNode node,
                                                  TypeCapture<?> type,
                                                  DecoderContext decoderContext)
        Description copied from interface: Decoder
        Decode the current node. If the current node is a class or list we may need to decode sub nodes.
        Specified by:
        decode in interface Decoder<java.lang.Object>
        Parameters:
        path - the current path
        tags - the tags for the current request
        node - the current node we are decoding.
        type - the type of object we are decoding.
        decoderContext - The context of the current decoder.
        Returns:
        GResultOf the current node with details of either success or failures.