Object Parser

  • All Implemented Interfaces:

    
    public class Parser
    
                        

    Utility functions for parsing TBDex Messages and Resources

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static Parser INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Message parseMessage(String payload) Takes an existing Message in the form of a json string and parses it into a Message object.
      final JsonNode parseMessageToJsonNode(String payload) Takes an existing Message in the form of a json string and parses it into a JsonNode object.
      final Resource parseResource(String payload) Takes an existing Resource in the form of a json string and parses it into a Resource object.
      final JsonNode parseResourceToJsonNode(String payload) Takes an existing REsource in the form of a json string and parses it into a JsonNode object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • parseMessage

         final Message parseMessage(String payload)

        Takes an existing Message in the form of a json string and parses it into a Message object. Validates object structure and performs an integrity check using the message signature.

        Parameters:
        payload - The message as a json string.
        Returns:

        The json string parsed into a concrete Message implementation.

      • parseMessageToJsonNode

         final JsonNode parseMessageToJsonNode(String payload)

        Takes an existing Message in the form of a json string and parses it into a JsonNode object. Validates object structure.

        Parameters:
        payload - The message as a json string.
        Returns:

        The json string parsed into a JsonNode object.

      • parseResource

         final Resource parseResource(String payload)

        Takes an existing Resource in the form of a json string and parses it into a Resource object. Validates object structure and performs an integrity check using the resource signature.

        Parameters:
        payload - The resource as a json string.
        Returns:

        The json string parsed into a concrete Resource implementation.

      • parseResourceToJsonNode

         final JsonNode parseResourceToJsonNode(String payload)

        Takes an existing REsource in the form of a json string and parses it into a JsonNode object. Validates object structure.

        Parameters:
        payload - The resource as a json string.
        Returns:

        The json string parsed into a JsonNode object.