org.ocpsoft.rewrite.param.ParameterizedPatternResult Maven / Gradle / Ivy
package org.ocpsoft.rewrite.param;
import java.util.Map;
import org.ocpsoft.rewrite.context.EvaluationContext;
import org.ocpsoft.rewrite.event.Rewrite;
/**
* Stores the result of {@link ParameterizedPatternParser#matches(Rewrite, EvaluationContext, String)}. Provides methods
* for controlling parameter value submission.
*
* @author Lincoln Baxter, III
*/
public interface ParameterizedPatternResult
{
/**
* Returns true
if the {@link ParameterizedPattern} matched the input value, false
if not.
*/
boolean matches();
/**
* Validate all {@link Parameter} values defined within the original {@link ParameterizedPattern}. Return
* true
if all values matched configured {@link Constraint} instances, and matched an already submitted
* parameter value; otherwise, return false
.
*/
boolean isValid(Rewrite event, EvaluationContext context);
/**
* Submit all {@link Parameter} values to the {@link ParameterValueStore}, only if the values are match a prior value
* or have not yet had a value set. Returns true
if submission was successful, false
if
* not.
*/
boolean submit(Rewrite event, EvaluationContext context);
/**
* Get the {@link Map} of {@link Parameter} instances that were referenced in the {@link ParameterizedPattern}.
*/
Map, String> getParameters(EvaluationContext context);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy