Package jadex.binary

Class NumberCodec

    • Field Detail

      • INSTANCE

        public static final NumberCodec INSTANCE
        Default Instance
      • TYPES

        protected static final java.util.Set<java.lang.Class<?>> TYPES
        The types this processor can handle.
    • Constructor Detail

      • NumberCodec

        public NumberCodec()
    • Method Detail

      • isApplicable

        public boolean isApplicable​(java.lang.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 java.lang.Object createObject​(java.lang.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.
      • canReference

        public boolean canReference​(java.lang.Object object,
                                    java.lang.Class<?> clazz,
                                    IEncodingContext ec)
        Prevent references for primitive-wrapped types.
        Overrides:
        canReference in class AbstractCodec
        Parameters:
        object - The current object.
        clazz - The class.
        ec - The encoding context.
        Returns:
        True, if a reference has been encoded, false otherwise.