Package jadex.binary

Class CollectionCodec

java.lang.Object
jadex.binary.AbstractCodec
jadex.binary.CollectionCodec
All Implemented Interfaces:
IDecoderHandler, jadex.common.transformation.traverser.ITraverseProcessor

public class CollectionCodec extends AbstractCodec
Codec for encoding and decoding collections.
  • Constructor Details

    • CollectionCodec

      public CollectionCodec()
  • Method Details

    • isApplicable

      public boolean isApplicable(Class<?> clazz)
      Tests if the decoder can decode the class.
      Specified by:
      isApplicable in interface IDecoderHandler
      Specified by:
      isApplicable in class AbstractCodec
      Parameters:
      clazz - The class.
      Returns:
      True, if the decoder can decode this class.
    • createObject

      public Object createObject(Class<?> clazz, IDecodingContext context)
      Creates the object during decoding.
      Specified by:
      createObject in class AbstractCodec
      Parameters:
      clazz - The class of the object.
      context - The decoding context.
      Returns:
      The created object.
    • decodeSubObjects

      public Object decodeSubObjects(Object object, Class<?> clazz, IDecodingContext context)
      Decodes and adds sub-objects during decoding.
      Overrides:
      decodeSubObjects in class AbstractCodec
      Parameters:
      object - The instantiated object.
      clazz - The class of the object.
      context - The decoding context.
      Returns:
      The finished object.
    • encode

      public Object encode(Object object, Class<?> clazz, List<jadex.common.transformation.traverser.ITraverseProcessor> preprocessors, List<jadex.common.transformation.traverser.ITraverseProcessor> processors, jadex.common.transformation.IStringConverter converter, jadex.common.transformation.traverser.Traverser.MODE mode, jadex.common.transformation.traverser.Traverser traverser, ClassLoader targetcl, IEncodingContext ec)
      Encode the object.
      Specified by:
      encode in class AbstractCodec