Java EE 5 SDK

com.sun.appserv.web.cache.mapping
Class ValueConstraint

java.lang.Object
  extended by com.sun.appserv.web.cache.mapping.ValueConstraint

public class ValueConstraint
extends Object

ValueConstraint class represents a field's value constraint; supports common matching expressions.


Constructor Summary
ValueConstraint(String value, String expr)
          create constraint: field value matches with the given string expression
 
Method Summary
 boolean matches(Object value)
          match with the given Object value.
 void setCacheOnMatch(boolean cacheOnMatch)
          set whether to cache if there was a match
 void setCacheOnMatchFailure(boolean cacheOnMatchFailure)
          set whether to cache if there was a failure to match
 void setMatchExpr(int expr)
          set field matching expression
 void setMaxValue(float value)
          set the maximum value
 void setMinValue(float value)
          set minimum value
 void setValue(String value)
          set value for this constraint
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueConstraint

public ValueConstraint(String value,
                       String expr)
                throws IllegalArgumentException
create constraint: field value matches with the given string expression

Parameters:
value - specific value to match
expr - match expression
Throws:
IllegalArgumentException
Method Detail

setValue

public void setValue(String value)
set value for this constraint

Parameters:
value - specific value to match

setMinValue

public void setMinValue(float value)
set minimum value

Parameters:
value - minimum value

setMaxValue

public void setMaxValue(float value)
set the maximum value

Parameters:
value - maximum value

setMatchExpr

public void setMatchExpr(int expr)
set field matching expression

Parameters:
expr - match expression

setCacheOnMatch

public void setCacheOnMatch(boolean cacheOnMatch)
set whether to cache if there was a match

Parameters:
cacheOnMatch - should the field value match, enable cache?

setCacheOnMatchFailure

public void setCacheOnMatchFailure(boolean cacheOnMatchFailure)
set whether to cache if there was a failure to match

Parameters:
cacheOnMatchFailure - should the field value doesn't match, enable cache?

matches

public boolean matches(Object value)
match with the given Object value.

Returns:
true if the value passes the constraint, false otherwise.

toString

public String toString()
Overrides:
toString in class Object
Returns:
a string representation of this value/expr element

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.