org.apache.cocoon.bean.query
Class SimpleLuceneCriterionBean

java.lang.Object
  extended by org.apache.cocoon.bean.query.SimpleLuceneCriterionBean
All Implemented Interfaces:
Serializable, Cloneable, SimpleLuceneCriterion

public class SimpleLuceneCriterionBean
extends Object
implements SimpleLuceneCriterion, Cloneable, Serializable

The criterion bean.

This object defines a Bean for holding a query criterion.
The idea is to abstract the process of searching into a Bean to be manipulated by CForms.
This Bean is designed to be persistable.

See Also:
Serialized Form

Field Summary
protected  String field
          The Bean's index field to seach in.
protected  Long id
          The Bean's ID.
protected  String match
          The Bean's match value.
protected  String term
          The Bean's search term.
 
Fields inherited from interface org.apache.cocoon.bean.query.SimpleLuceneCriterion
ALL_MATCH, ANY_FIELD, ANY_MATCH, LIKE_MATCH, NOT_MATCH, PHRASE_MATCH
 
Constructor Summary
SimpleLuceneCriterionBean()
          Default constructor.
SimpleLuceneCriterionBean(String field, String match, String term)
          Utility constructor.
 
Method Summary
 Object clone()
           
 String getField()
          Gets the Bean's field
 Long getId()
          Gets the Bean's ID
 String getMatch()
          Gets the Bean's match
 org.apache.lucene.search.Query getQuery(org.apache.lucene.analysis.Analyzer analyzer)
          Gets the org.apache.lucene.search.Query from the Criterion The analyzer specifies which org.apache.lucene.analysis.Analyzer to use for this search.
 String getTerm()
          Gets the Bean's term
 boolean isProhibited()
          Gets the prohibited status from the Criterion
 void setField(String field)
          Sets the Bean's field.
 void setId(Long id)
          Sets the Bean's ID
 void setMatch(String match)
          Sets the Bean's match.
 void setTerm(String term)
          Sets the Bean's term.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected Long id
The Bean's ID.


field

protected String field
The Bean's index field to seach in.


match

protected String match
The Bean's match value.


term

protected String term
The Bean's search term.

Constructor Detail

SimpleLuceneCriterionBean

public SimpleLuceneCriterionBean()
Default constructor.


SimpleLuceneCriterionBean

public SimpleLuceneCriterionBean(String field,
                                 String match,
                                 String term)
Utility constructor.

Parameters:
match - the kind of match to use
field - the field to search
term - the terms to search for
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getQuery

public org.apache.lucene.search.Query getQuery(org.apache.lucene.analysis.Analyzer analyzer)
Gets the org.apache.lucene.search.Query from the Criterion

The analyzer specifies which org.apache.lucene.analysis.Analyzer to use for this search.

Specified by:
getQuery in interface SimpleLuceneCriterion
Parameters:
analyzer - The org.apache.lucene.analysis.Analyzer to use to extract the Terms from this Criterion

isProhibited

public boolean isProhibited()
Gets the prohibited status from the Criterion

Specified by:
isProhibited in interface SimpleLuceneCriterion

getId

public Long getId()
Gets the Bean's ID

Returns:
the Long ID of the Bean.

setId

public void setId(Long id)
Sets the Bean's ID

Parameters:
id - the Long ID of the Bean.

getField

public String getField()
Gets the Bean's field

Returns:
the String field of the Bean.

setField

public void setField(String field)
Sets the Bean's field.
ie. which field would you like this Criterion to search in.

Parameters:
field - the String field of the Bean.

getMatch

public String getMatch()
Gets the Bean's match

Returns:
the String match of the Bean.

setMatch

public void setMatch(String match)
Sets the Bean's match.
ie. what kind of match do you want performed by this Criterion.

Parameters:
match - the String match of the Bean.

getTerm

public String getTerm()
Gets the Bean's term

Returns:
the String term of the Bean.

setTerm

public void setTerm(String term)
Sets the Bean's term.
ie. the string of search terms for this Criterion.

Parameters:
term - the String term of the Bean.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.