Interface DecoderService

  • All Known Implementing Classes:
    DecoderRegistry

    public interface DecoderService
    Contains all decoders and functionality interact and decode a node.
    • Method Detail

      • getDecoders

        java.util.List<Decoder<?>> getDecoders()
        Get a list of decoders supported.
        Returns:
        ist of decoders supported
      • setDecoders

        void setDecoders​(java.util.List<Decoder<?>> decoders)
        Set a list of decoders, replaces any existing decoders.
        Parameters:
        decoders - list of decoders
      • decodeNode

        <T> GResultOf<T> decodeNode​(java.lang.String path,
                                    Tags tags,
                                    java.lang.String configNode,
                                    TypeCapture<T> klass,
                                    DecoderContext decoderContext)
        Decode a node and return the GResultOf with the results.
        Type Parameters:
        T - The generic type of the node we are decoding.
        Parameters:
        path - Current path we are decoding, used for logging
        tags - the tags for the current request
        configNode - the current node we are decoding
        klass - the TypeCapture of the node we are decoding
        decoderContext - The context for the decoder
        Returns:
        GResultOf the code we are decoding.
      • decodeNode

        <T> GResultOf<T> decodeNode​(java.lang.String path,
                                    Tags tags,
                                    ConfigNode configNode,
                                    TypeCapture<T> klass,
                                    DecoderContext decoderContext)
        Decode a node and return the GResultOf with the results.
        Type Parameters:
        T - The generic type of the node we are decoding.
        Parameters:
        path - Current path we are decoding, used for logging
        tags - the tags for the current request
        configNode - the current node we are decoding
        klass - the TypeCapture of the node we are decoding
        decoderContext - The context for the decoder
        Returns:
        GResultOf the code we are decoding.
      • addDecoders

        void addDecoders​(java.util.List<Decoder<?>> decoder)
        Add decoders to the service.
        Parameters:
        decoder - list of decoders
      • getPathMappers

        java.util.List<PathMapper> getPathMappers()
        Get all path mappers the decoder service has registered.
        Returns:
        PathMapper
      • setPathMappers

        void setPathMappers​(java.util.List<PathMapper> pathMappers)
        Set all path mappers the decoder service can use.
        Parameters:
        pathMappers - path mappers to replace the current ones
      • getNextNode

        GResultOf<ConfigNode> getNextNode​(java.lang.String path,
                                          java.lang.String nextPath,
                                          ConfigNode configNode)
        Gets the next node from a config node, in a path for a string.
        Parameters:
        path - Current path we are decoding, used for logging
        nextPath - path of the next node
        configNode - current config node
        Returns:
        the next config node.
      • getNextNode

        GResultOf<ConfigNode> getNextNode​(java.lang.String path,
                                          int nextIndex,
                                          ConfigNode configNode)
        Gets the next node from a config node, in a path for a int index.
        Parameters:
        path - Current path we are decoding, used for logging
        nextIndex - path of the next node
        configNode - current config node
        Returns:
        the next config node.