20 lines
654 B
Java
20 lines
654 B
Java
package com.github.dtschust.zork.parser;
|
|
|
|
import com.github.dtschust.zork.ZorkTrigger;
|
|
|
|
import java.util.function.Function;
|
|
|
|
public interface TriggerPropertyParseStrategy {
|
|
ZorkTrigger parseTrigger(final Property source, final Property parent);
|
|
|
|
/**
|
|
* Partial function application for the parseTrigger method able to define the parent element first
|
|
*
|
|
* @param parent the parent element
|
|
* @return a lambda mapping a source, a child element of `parent`, to ZorkTrigger objects
|
|
*/
|
|
default Function<Property, ZorkTrigger> parse(final Property parent) {
|
|
return source -> this.parseTrigger(source, parent);
|
|
}
|
|
}
|