org.mmbase.storage.search.legacy
Class ConstraintParser

java.lang.Object
  extended byorg.mmbase.storage.search.legacy.ConstraintParser

public class ConstraintParser
extends java.lang.Object

Parser, tries to parse a SQL-search-condition for a query to a Constraint object.

This class is provided for the sole purpose of alignment of old code with the new SearchQuery framework, and should not be called by new code.

A SQL-search-condition can be one of these forms:

A simple-SQL-search-condition string can be of one of these forms: A field can be one of these forms: A value can be one of these forms: A string-search-condition can be of this form: searchterms can be of one of these forms: casesensitive can be of one on these forms: fuzziness must be a float value between 0.0 and 1.0, proximity must be a int value > 0

See StringSearchConstraint for more info on string-search constraints.

A search condition that is not of one of these forms will be converted to a LegacyConstraint, i.e. in that case the search condition string will not be interpreted, but instead be used "as-is". Each time this occurs is logged with priority service to category org.mmbase.storage.search.legacyConstraintParser.fallback.

Since:
MMBase-1.7
Version:
$Id: ConstraintParser.java,v 1.20.2.1 2004/07/09 14:03:47 michiel Exp $
Author:
Rob van Maris

Constructor Summary
ConstraintParser(SearchQuery query)
          Creates a new instance of ConstraintParser
 
Method Summary
static StepField getField(java.lang.String token, java.util.List steps)
          Creates StepField corresponding to field indicated by token, of one of the specified steps.
 Constraint toConstraint(java.lang.String sqlConstraint)
          Parses SQL-search-condition, and produces a corresponding Constraint object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintParser

public ConstraintParser(SearchQuery query)
Creates a new instance of ConstraintParser

Method Detail

getField

public static StepField getField(java.lang.String token,
                                 java.util.List steps)
Creates StepField corresponding to field indicated by token, of one of the specified steps.

A field can be one of these forms:

Parameters:
token - The token.
steps - The steps.
Returns:
The field.

toConstraint

public Constraint toConstraint(java.lang.String sqlConstraint)
Parses SQL-search-condition, and produces a corresponding Constraint object.

See above for the format of a SQL-search-condition.

Parameters:
sqlConstraint - The non-null SQL constraint string.
Returns:
The constraint.


MMBase build 1.7.4.20050922