Package org.ocpsoft.rewrite.param
Class DefaultParameterValueStore
java.lang.Object
org.ocpsoft.rewrite.param.DefaultParameterValueStore
- All Implemented Interfaces:
Iterable<Map.Entry<Parameter<?>,,String>> ParameterValueStore
public class DefaultParameterValueStore
extends Object
implements ParameterValueStore, Iterable<Map.Entry<Parameter<?>,String>>
Default implementation of
ParameterValueStore- Author:
- Lincoln Baxter, III
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new, emptyDefaultParameterValueStoreinstance.Create a newDefaultParameterValueStoreinstance, copying allParameterand value pairs from the given instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParameterValueStoregetInstance(EvaluationContext context) Retrieve the currentParameterValueStorefrom the givenEvaluationContextinstance.booleanisValid(Rewrite event, EvaluationContext context, Parameter<?> param, String value) Validate the givenParameterand value.iterator()Retrieve the currenet value for the givenParameter.booleansubmit(Rewrite event, EvaluationContext context, Parameter<?> param, String value) Submit the givenParameterand value.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultParameterValueStore
public DefaultParameterValueStore()Create a new, emptyDefaultParameterValueStoreinstance. -
DefaultParameterValueStore
Create a newDefaultParameterValueStoreinstance, copying allParameterand value pairs from the given instance.
-
-
Method Details
-
retrieve
Description copied from interface:ParameterValueStoreRetrieve the currenet value for the givenParameter. (May benullif no value has been set, or if the value isnull.)- Specified by:
retrievein interfaceParameterValueStore
-
submit
Description copied from interface:ParameterValueStoreSubmit the givenParameterand value. Returnfalseif the value does not match configuredConstraintinstances, or does not match an already submitted value; otherwise, returntrue..- Specified by:
submitin interfaceParameterValueStore
-
isValid
Description copied from interface:ParameterValueStoreValidate the givenParameterand value. Returnfalseif the value does not match configuredConstraintinstances, or does not match an already submitted value; otherwise, returntrue.- Specified by:
isValidin interfaceParameterValueStore
-
iterator
-
toString
-
getInstance
public static ParameterValueStore getInstance(EvaluationContext context) throws IllegalStateException Retrieve the currentParameterValueStorefrom the givenEvaluationContextinstance.- Throws:
IllegalStateException- If theParameterValueStorecould not be located.
-