Interface ISerializer


  • public interface ISerializer
    Encode and decode an object from a byte representation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SERIALIZER_ID
      Constant for accessing the serializer id.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object decode​(byte[] bytes, java.lang.ClassLoader classloader, jadex.commons.transformation.traverser.ITraverseProcessor[] postprocs, jadex.commons.transformation.traverser.IErrorReporter rep, java.lang.Object usercontext)
      Decode data with the serializer.
      java.lang.Object decode​(java.io.InputStream is, java.lang.ClassLoader classloader, jadex.commons.transformation.traverser.ITraverseProcessor[] postprocs, jadex.commons.transformation.traverser.IErrorReporter rep, java.lang.Object usercontext)
      Decode an object.
      byte[] encode​(java.lang.Object val, java.lang.ClassLoader classloader, jadex.commons.transformation.traverser.ITraverseProcessor[] preprocs, java.lang.Object usercontext)
      Encode data with the serializer.
      int getSerializerId()
      Get the serializer id.
    • Field Detail

      • SERIALIZER_ID

        static final java.lang.String SERIALIZER_ID
        Constant for accessing the serializer id.
        See Also:
        Constant Field Values
    • Method Detail

      • getSerializerId

        int getSerializerId()
        Get the serializer id.
        Returns:
        The serializer id.
      • encode

        byte[] encode​(java.lang.Object val,
                      java.lang.ClassLoader classloader,
                      jadex.commons.transformation.traverser.ITraverseProcessor[] preprocs,
                      java.lang.Object usercontext)
        Encode data with the serializer.
        Parameters:
        val - The value.
        classloader - The classloader.
        preproc - The encoding preprocessors.
        Returns:
        The encoded object.
      • decode

        java.lang.Object decode​(byte[] bytes,
                                java.lang.ClassLoader classloader,
                                jadex.commons.transformation.traverser.ITraverseProcessor[] postprocs,
                                jadex.commons.transformation.traverser.IErrorReporter rep,
                                java.lang.Object usercontext)
        Decode data with the serializer.
        Parameters:
        bytes - The value bytes as byte array or input stream.
        Returns:
        The decoded object.
      • decode

        java.lang.Object decode​(java.io.InputStream is,
                                java.lang.ClassLoader classloader,
                                jadex.commons.transformation.traverser.ITraverseProcessor[] postprocs,
                                jadex.commons.transformation.traverser.IErrorReporter rep,
                                java.lang.Object usercontext)
        Decode an object.
        Returns:
        The decoded object.
        Throws:
        java.io.IOException