Package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors


package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors
Provides classes that expose a uniform interface for accessing structured data from diverse object types used within MessageBuilderLib.

Accessors serve as lightweight wrappers around non-conforming objects — such as Bukkit API types — allowing their properties to be read through a consistent contract without requiring the underlying classes to implement library-specific interfaces. Each Accessor adapts a specific type to a common data access interface, typically by delegating to existing getter methods or equivalent reflective accessors.

These classes were formerly known as “adapters,” as they implement the classic GoF Accessor pattern, but have been renamed to avoid confusion with “adapters” in the context of hexagonal (ports and adapters) architecture. The term accessor more accurately conveys their purpose as structured, read-only views over arbitrary object types.

Usage


 AccessorEngine engine = new AccessorEngine();
 Accessor<Location> accessor = new LocationAccessor(player.getLocation());
 Map<Section, Section> values = engine.extractValues(accessor);
 

The MacroFieldAccessor coordinates the Accessors and collects resolved values into the message context.

Related packages:

See Also: