Interface Parser<O>

    • Method Detail

      • getOptsType

        Class<O> getOptsType()
        The type of option object that this parser accepts.
        Returns:
        the type of option object that this parser accepts
        See Also:
        ParserSupport
      • parse

        @Nullable
        <T> T parse​(Context context,
                    TypedData requestBody,
                    Parse<T,​O> parse)
             throws Exception
        Deserializes the request body of the context into an object.
        Type Parameters:
        T - the type of object to construct from the request body
        Parameters:
        context - The context to deserialize
        requestBody - The request body to deserialize
        parse - The description of how to parse the request body
        Returns:
        The object representation of the request body, or null if this parser cannot parse to the requested type
        Throws:
        Exception - if an error occurs parsing the request