Interface EncoderFactory

All Known Implementing Classes:
DefaultEncoderFactory

public interface EncoderFactory
Factory interface for creating D-Bus encoders.

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

  • Method Details

    • createEncoder

      Encoder<DBusType,ByteBuffer> createEncoder(Type type, ByteOrder order) throws EncoderException
      Creates an encoder for the specified D-Bus type.
      Parameters:
      type - the D-Bus type to encode
      order - the byte order to use for encoding
      Returns:
      an encoder capable of encoding the specified type
      Throws:
      EncoderException - if no encoder is available for the type
    • canEncode

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