org.ujoframework.criterion
Class ValueCriterion<UJO extends Ujo>

java.lang.Object
  extended by org.ujoframework.criterion.Criterion<UJO>
      extended by org.ujoframework.criterion.ValueCriterion<UJO>

public class ValueCriterion<UJO extends Ujo>
extends Criterion<UJO>

The value criterion implementation.

Since:
0.90
Author:
Pavel Ponec

Field Summary
static Criterion<Ujo> FALSE
          False constant criterion
static Criterion<Ujo> TRUE
          True constant criterion
protected  java.lang.Object value
           
 
Constructor Summary
ValueCriterion(boolean value)
          Creante an Criterion constant
ValueCriterion(UjoProperty<UJO,? extends java.lang.Object> property, Operator operator, java.lang.Object value)
          An undefined operator (null) is replaced by EQ.
ValueCriterion(UjoProperty<UJO,? extends java.lang.Object> property, Operator operator, UjoProperty<UJO,java.lang.Object> value)
          An undefined operator (null) is replaced by EQ.
 
Method Summary
protected  int compare(java.lang.Comparable o1, java.lang.Comparable o2)
          Compare two object
 boolean evaluate(UJO ujo)
           
 UjoProperty getLeftNode()
          Returns the left node of the parrent
 Operator getOperator()
          Returns an operator
 java.lang.Object getRightNode()
          Returns the right node of the parrent
 boolean isConstant()
          Is the criterion result independent on the bean object?
 boolean isInsensitive()
          Is the operator insensitive.
protected  void makeArrayTest(java.lang.Object value)
          Test a value is an instance of Iterable.
protected  void makeCharSequenceTest(java.lang.Object value)
          Test a value is an instance of CharSequence or a type UjoProperty is type of CharSequence.
 java.lang.String toString()
           
 
Methods inherited from class org.ujoframework.criterion.Criterion
and, constant, isBinary, join, newInstance, newInstance, newInstance, newInstance, newInstance, newInstanceFalse, newInstanceTrue, not, or, where, where, where, where, where, whereIn, whereIn, whereNotIn, whereNotIn, whereNotNull, whereNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final Criterion<Ujo> TRUE
True constant criterion


FALSE

public static final Criterion<Ujo> FALSE
False constant criterion


value

protected final java.lang.Object value
Constructor Detail

ValueCriterion

public ValueCriterion(boolean value)
Creante an Criterion constant


ValueCriterion

public ValueCriterion(UjoProperty<UJO,? extends java.lang.Object> property,
                      Operator operator,
                      UjoProperty<UJO,java.lang.Object> value)
An undefined operator (null) is replaced by EQ.


ValueCriterion

public ValueCriterion(UjoProperty<UJO,? extends java.lang.Object> property,
                      Operator operator,
                      java.lang.Object value)
An undefined operator (null) is replaced by EQ.

Method Detail

getLeftNode

public final UjoProperty getLeftNode()
Returns the left node of the parrent

Specified by:
getLeftNode in class Criterion<UJO extends Ujo>

getRightNode

public final java.lang.Object getRightNode()
Returns the right node of the parrent

Specified by:
getRightNode in class Criterion<UJO extends Ujo>

getOperator

public final Operator getOperator()
Returns an operator

Specified by:
getOperator in class Criterion<UJO extends Ujo>

evaluate

public boolean evaluate(UJO ujo)
Specified by:
evaluate in class Criterion<UJO extends Ujo>

makeCharSequenceTest

protected void makeCharSequenceTest(java.lang.Object value)
                             throws java.lang.IllegalArgumentException
Test a value is an instance of CharSequence or a type UjoProperty is type of CharSequence. If parameter is not valid than method throws Exception.

Throws:
java.lang.IllegalArgumentException

makeArrayTest

protected void makeArrayTest(java.lang.Object value)
                      throws java.lang.IllegalArgumentException
Test a value is an instance of Iterable. If parameter is not valid than method throws Exception.

Throws:
java.lang.IllegalArgumentException

compare

protected int compare(java.lang.Comparable o1,
                      java.lang.Comparable o2)
Compare two object


isInsensitive

public boolean isInsensitive()
Is the operator insensitive.


isConstant

public final boolean isConstant()
Is the criterion result independent on the bean object?


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.