com.groiss.reporting.data
Class Condition

java.lang.Object
  extended by com.groiss.reporting.data.Condition

public class Condition
extends java.lang.Object

A Condtion contains an attribute, an operator and a value (e.g: id = 3)

Author:
gerald

Field Summary
static java.util.ArrayList ARETH_OPERATORS
           
static java.util.ArrayList DATE_OPERATORS
           
static Pair EMPTY_OPERATOR
           
static java.util.ArrayList NULL_OPERATORS
           
static java.util.ArrayList SET_OPERATORS
           
static java.util.ArrayList STRING_OPERATORS
           
 
Constructor Summary
Condition(java.lang.String attribute, java.lang.String operator, java.lang.String value)
          the public constructor
 
Method Summary
 org.jdom.Element getAsDomElement()
          Returns this selection condition as a dom element
static java.lang.String getI18NOperator(java.lang.String operator)
           
 java.lang.StringBuffer getSelectionString(java.lang.String entityPrefix)
           
 void setAttribute(java.lang.String a)
          setting the attribute... check if quote is needed
 void setOperator(java.lang.String o)
          setting the operator... check if quote is needed
 void setValue(java.lang.String v)
          setting the value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_OPERATORS

public static java.util.ArrayList NULL_OPERATORS

DATE_OPERATORS

public static java.util.ArrayList DATE_OPERATORS

ARETH_OPERATORS

public static java.util.ArrayList ARETH_OPERATORS

SET_OPERATORS

public static java.util.ArrayList SET_OPERATORS

STRING_OPERATORS

public static java.util.ArrayList STRING_OPERATORS

EMPTY_OPERATOR

public static Pair EMPTY_OPERATOR
Constructor Detail

Condition

public Condition(java.lang.String attribute,
                 java.lang.String operator,
                 java.lang.String value)
the public constructor

Parameters:
attribute - the attribute name
operator - the operator
value - the value
Method Detail

setAttribute

public void setAttribute(java.lang.String a)
setting the attribute... check if quote is needed

Parameters:
a - the attribute name

setOperator

public void setOperator(java.lang.String o)
setting the operator... check if quote is needed

Parameters:
o - the operator string

setValue

public void setValue(java.lang.String v)
setting the value

Parameters:
v - - the value

getSelectionString

public java.lang.StringBuffer getSelectionString(java.lang.String entityPrefix)
Parameters:
entityPrefix - - the alias of the entity in the sql query
Returns:
a string containing the correct sql sytax for this condition

getAsDomElement

public org.jdom.Element getAsDomElement()
Returns this selection condition as a dom element

Returns:
the Dom Element representation

getI18NOperator

public static java.lang.String getI18NOperator(java.lang.String operator)


Copyright © 2001-2006 Groiss Informatics GmbH. All Rights Reserved.