Interface DecoderFactory

All Known Implementing Classes:
DefaultDecoderFactory

public interface DecoderFactory
Factory interface for creating D-Bus decoders.

This factory provides a centralized way to create decoders for different D-Bus types, eliminating the need for switch statements and improving extensibility.

  • Method Details

    • createDecoder

      Decoder<ByteBuffer,DBusType> createDecoder(TypeCode typeCode) throws DecoderException
      Creates a decoder for the specified D-Bus type code.
      Parameters:
      typeCode - the D-Bus type code to decode
      Returns:
      a decoder capable of decoding the specified type
      Throws:
      DecoderException - if no decoder is available for the type
    • createDecoder

      Decoder<ByteBuffer,DBusType> createDecoder(Type type) throws DecoderException
      Creates a decoder for the specified D-Bus type.
      Parameters:
      type - the D-Bus type to decode
      Returns:
      a decoder capable of decoding the specified type
      Throws:
      DecoderException - if no decoder is available for the type
    • canDecode

      boolean canDecode(TypeCode typeCode)
      Checks if a decoder is available for the specified type code.
      Parameters:
      typeCode - the D-Bus type code to check
      Returns:
      true if a decoder is available, false otherwise
    • canDecode

      boolean canDecode(Type type)
      Checks if a decoder is available for the specified type.
      Parameters:
      type - the D-Bus type to check
      Returns:
      true if a decoder is available, false otherwise