Interface PlaceholderParser
-
- All Superinterfaces:
DefaultedRegistryValue
@CatalogedBy(PlaceholderParsers.class) public interface PlaceholderParser extends DefaultedRegistryValue
Provides the logic of how to parse a placeholder token.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
PlaceholderParser.Builder
A builder that createsPlaceholderParser
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static PlaceholderParser.Builder
builder()
Returns aPlaceholderParser.Builder
that allows for the creation of simplePlaceholderParser
s.Component
parse(PlaceholderContext placeholderContext)
Creates aComponent
based on the providedPlaceholderContext
.-
Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
-
-
-
Method Detail
-
builder
static PlaceholderParser.Builder builder()
Returns aPlaceholderParser.Builder
that allows for the creation of simplePlaceholderParser
s.- Returns:
- The
PlaceholderParser.Builder
-
parse
Component parse(PlaceholderContext placeholderContext)
Creates aComponent
based on the providedPlaceholderContext
.This method should not throw an error, instead returning
Component.empty()
if the suppliedPlaceholderContext
is not valid.- Parameters:
placeholderContext
- ThePlaceholderContext
- Returns:
- The
Component
-
-