Package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors
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:
-
– For resolving macros or runtime objects to their corresponding values.
invalid reference
com.winterhavenmc.library.messagebuilder.adapters.pipeline.resolvers com.winterhavenmc.library.messagebuilder.adapters.pipeline.processors– For applying macro-processing logic to message strings.
- See Also:
-
ClassesClassDescriptionMaintains an ordered registry of all
Accessorinstances available to the macro resolution pipeline.Default implementation of theFieldAccessorinterface that delegates field extraction to the appropriate functional interface based on the adapter type.