net.sf.sapjcosupport
Class SearchCriterion

java.lang.Object
  extended bynet.sf.sapjcosupport.SearchCriterion

public class SearchCriterion
extends Object

Class that encapsulates the concept of a search criterion.
It allows you to specify the search criteria for the SAP Search Help.

Remark: If multiple search criteria are defined for a search, the criteria that operate on the same SAP field are considered OR-conditions. Criteria that operate on different SAP fields are considered AND-conditions.

Since:
Mar 21, 2006 - 12:45:38 PM
Author:
Jo Vandermeeren

Field Summary
static String BETWEEN
          Option: field value is between value of lower and higher limit
static String CONTAINS_NOT_PATTERN
          Option: field value does not contain the pattern in lower limit value
static String CONTAINS_PATTERN
          Option: field value contains the pattern in lower limit value
static String EQUAL
          Option: field value equals value of lower limit
static String GREATER
          Option: field value is greater than value of lower limit
static String GREATER_OR_EQUAL
          Option: field value is greater or equal to value of lower limit
static String LESS
          Option: field value is less than value of lower limit
static String LESS_OR_EQUAL
          Option: field value is less or equal to value of lower limit
static String NOT_BETWEEN
          Option: field value is not between value of lower and higher limit
static String NOT_EQUAL
          Option: field valie is not equal to value of lower limit
 
Constructor Summary
SearchCriterion()
           
 
Method Summary
 String getField()
          Gets the SAP field to which this search criterion applies.
 String getHighLimit()
          Gets the higher limit associated with this search criterion's option.
 String getLowLimit()
          Gets the lower limit associated with this search criterion's option.
 String getOption()
          Gets the option that is associated with this search criterion.
 boolean isIncluded()
          Returns true if items that match this criterion should be included in the results.
 void setField(String field)
          Sets the SAP field to which this search criterion applies
 void setHighLimit(String highLimit)
          Sets the higher limit for the option that is associated with this search helper.
 void setIncluded(boolean include)
          Sets the sign of this search criterion.
 void setLowLimit(String lowLimit)
          Sets the lower limit for the option that is associated with this search helper.
 void setOption(String option)
          Sets the option of the search criterion.
 Map toMap()
          Helper method to convert a SearchCriterion object to a Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUAL

public static final String EQUAL
Option: field value equals value of lower limit

See Also:
Constant Field Values

CONTAINS_PATTERN

public static final String CONTAINS_PATTERN
Option: field value contains the pattern in lower limit value

See Also:
Constant Field Values

BETWEEN

public static final String BETWEEN
Option: field value is between value of lower and higher limit

See Also:
Constant Field Values

NOT_BETWEEN

public static final String NOT_BETWEEN
Option: field value is not between value of lower and higher limit

See Also:
Constant Field Values

NOT_EQUAL

public static final String NOT_EQUAL
Option: field valie is not equal to value of lower limit

See Also:
Constant Field Values

CONTAINS_NOT_PATTERN

public static final String CONTAINS_NOT_PATTERN
Option: field value does not contain the pattern in lower limit value

See Also:
Constant Field Values

GREATER

public static final String GREATER
Option: field value is greater than value of lower limit

See Also:
Constant Field Values

LESS

public static final String LESS
Option: field value is less than value of lower limit

See Also:
Constant Field Values

GREATER_OR_EQUAL

public static final String GREATER_OR_EQUAL
Option: field value is greater or equal to value of lower limit

See Also:
Constant Field Values

LESS_OR_EQUAL

public static final String LESS_OR_EQUAL
Option: field value is less or equal to value of lower limit

See Also:
Constant Field Values
Constructor Detail

SearchCriterion

public SearchCriterion()
Method Detail

getOption

public String getOption()
Gets the option that is associated with this search criterion.

Returns:
option for this search criterion

setOption

public void setOption(String option)
Sets the option of the search criterion.

Please use the constants defined in this class to assign an option. Some options require 2 parameters to operate correctly, e.g. BETWEEN. You can assign those parameters by calling the setHighLimit(java.lang.String) and setLowLimit(java.lang.String) methods. If only 1 parameter is required, assign it to as the lower limit and leave the high limit blank.

Possible options are:

Parameters:
option - option for this search criterion (please use the constants defined in this class)

getField

public String getField()
Gets the SAP field to which this search criterion applies.

Returns:
SAP field name

setField

public void setField(String field)
Sets the SAP field to which this search criterion applies

Parameters:
field - SAP field name

setIncluded

public void setIncluded(boolean include)
Sets the sign of this search criterion.

The sign of a search criterion defines if the items that match this criterion should be excluded or included from the results. This allows more complex queries, e.g. Select all materials beginning with "ES", but exclude those ending with "MF".

Parameters:
include - true if you want to include results that match this criterion

isIncluded

public boolean isIncluded()
Returns true if items that match this criterion should be included in the results.

Returns:
true if matches of this criterion will be included in the results

getLowLimit

public String getLowLimit()
Gets the lower limit associated with this search criterion's option.

If only one parameter is required for the specified option, this method returns that single limit.

Returns:
lower limit for specified option

setLowLimit

public void setLowLimit(String lowLimit)
Sets the lower limit for the option that is associated with this search helper.

If only one parameter is required for the specified option, please use this method to assign that single limit.

Parameters:
lowLimit - lower limit for specified option

getHighLimit

public String getHighLimit()
Gets the higher limit associated with this search criterion's option.

Returns:
higher limit for specified option

setHighLimit

public void setHighLimit(String highLimit)
Sets the higher limit for the option that is associated with this search helper.

Parameters:
highLimit - higher limit for specified option

toMap

public Map toMap()
Helper method to convert a SearchCriterion object to a Map.

Returns:
Map containing the criterion properties


Copyright © 2006 null. All Rights Reserved.