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 -
Method Summary
Modifier and TypeMethodDescriptionstatic PlaceholderParser.Builderbuilder()Returns aPlaceholderParser.Builderthat allows for the creation of simplePlaceholderParsers.parse(PlaceholderContext placeholderContext) Creates aComponentbased on the providedPlaceholderContext.Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
Method Details
-
builder
Returns aPlaceholderParser.Builderthat allows for the creation of simplePlaceholderParsers.- Returns:
- The
PlaceholderParser.Builder
-
parse
Creates aComponentbased on the providedPlaceholderContext.This method should not throw an error, instead returning
Component.empty()if the suppliedPlaceholderContextis not valid.- Parameters:
placeholderContext- ThePlaceholderContext- Returns:
- The
Component
-