Class NopStyleSource

java.lang.Object
org.jline.style.NopStyleSource
All Implemented Interfaces:
StyleSource

public class NopStyleSource extends Object implements StyleSource
A no-operation implementation of StyleSource that always returns null.

This class provides an implementation of StyleSource that does not store or retrieve any styles. All methods that modify styles are no-ops, and all methods that retrieve styles return empty results.

This class is useful as a default or fallback StyleSource when no styles are needed or available. It is used by default in Styler until a different StyleSource is set.

Example usage:

 // Create a StyleResolver with a NopStyleSource
 StyleResolver resolver = new StyleResolver(new NopStyleSource(), "group");

 // Named style references will always resolve to null
 AttributedStyle style = resolver.resolve(".error"); // Uses default style if provided
 
Since:
3.4
See Also: