Interface SerializableResolver
- All Known Subinterfaces:
SerializableResolver.Single
public interface SerializableResolver
A specific
TagResolver that can process serialization requests for a component.- Since:
- 4.10.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA subinterface for resolvers that only handle one single tag. -
Method Summary
Modifier and TypeMethodDescriptionstatic TagResolverclaimingComponent(String name, BiFunction<ArgumentQueue, Context, Tag> handler, Function<Component, @Nullable Emitable> componentClaim) Create a tag resolver that only responds to a single tag name, and whose value does not depend on that name.static TagResolverclaimingComponent(Set<String> names, BiFunction<ArgumentQueue, Context, Tag> handler, Function<Component, @Nullable Emitable> componentClaim) Create a tag resolver that only responds to certain tag names, and whose value does not depend on that name.static TagResolverclaimingStyle(String name, BiFunction<ArgumentQueue, Context, Tag> handler, StyleClaim<?> styleClaim) Create a tag resolver that only responds to a single tag name, and whose value does not depend on that name.static TagResolverclaimingStyle(Set<String> names, BiFunction<ArgumentQueue, Context, Tag> handler, StyleClaim<?> styleClaim) Create a tag resolver that only responds to certain tag names, and whose value does not depend on that name.voidhandle(Component serializable, ClaimConsumer consumer) Attempt to process a component for serialization.
-
Method Details
-
claimingComponent
static TagResolver claimingComponent(String name, BiFunction<ArgumentQueue, Context, Tag> handler, Function<Component, @Nullable Emitable> componentClaim) Create a tag resolver that only responds to a single tag name, and whose value does not depend on that name.- Parameters:
name- the name to respond tohandler- the tag handler, may throwParsingExceptionif provided arguments are in an invalid formatcomponentClaim- the claim to test components against- Returns:
- a resolver that creates tags using the provided handler
- Since:
- 4.10.0
-
claimingComponent
static TagResolver claimingComponent(Set<String> names, BiFunction<ArgumentQueue, Context, Tag> handler, Function<Component, @Nullable Emitable> componentClaim) Create a tag resolver that only responds to certain tag names, and whose value does not depend on that name.- Parameters:
names- the names to respond tohandler- the tag handler, may throwParsingExceptionif provided arguments are in an invalid formatcomponentClaim- the claim to test components against- Returns:
- a resolver that creates tags using the provided handler
- Since:
- 4.10.0
-
claimingStyle
static TagResolver claimingStyle(String name, BiFunction<ArgumentQueue, Context, Tag> handler, StyleClaim<?> styleClaim) Create a tag resolver that only responds to a single tag name, and whose value does not depend on that name.- Parameters:
name- the name to respond tohandler- the tag handler, may throwParsingExceptionif provided arguments are in an invalid formatstyleClaim- the extractor for style claims on components- Returns:
- a resolver that creates tags using the provided handler
- Since:
- 4.10.0
-
claimingStyle
static TagResolver claimingStyle(Set<String> names, BiFunction<ArgumentQueue, Context, Tag> handler, StyleClaim<?> styleClaim) Create a tag resolver that only responds to certain tag names, and whose value does not depend on that name.- Parameters:
names- the names to respond tohandler- the tag handler, may throwParsingExceptionif provided arguments are in an invalid formatstyleClaim- the extractor for style claims on components- Returns:
- a resolver that creates tags using the provided handler
- Since:
- 4.10.0
-
handle
Attempt to process a component for serialization.- Parameters:
serializable- the component to serializeconsumer- a consumer for component claims, must not be stored- Since:
- 4.10.0
-