© 2003 BEA Systems, Inc.

com.bea.content.expression
Class Search

java.lang.Object
  |
  +--com.bea.content.expression.Search
All Implemented Interfaces:
Cloneable, Serializable

public class Search
extends Object
implements Cloneable, Serializable

This represents parameters for searching for Nodes.

There are reserved system properties that may be part of a search. They are:

See Also:
Serialized Form

Field Summary
protected  Map contextParams
          The context params.
protected  Expression expression
          The search expression.
protected  int maxReturn
          The maximum number of objects to return.
protected  List searchPaths
          The paths under which to search.
protected  SortCriteria[] sortCriteria
          The sorting criteria
 
Constructor Summary
Search()
          Empty constructor.
Search(Expression expr)
          Constructor.
Search(int maxReturn, Expression expr)
          Constructor.
Search(int maxReturn, SortCriteria[] sortCriteria, Expression expr)
          Constructor.
Search(int maxReturn, SortCriteria[] sortCriteria, String expr)
          Constructor.
Search(int maxReturn, String expr)
          Constructor.
Search(int maxReturn, String sort, Expression expr)
          Constructor.
Search(int maxReturn, String sort, String expr)
          Constructor.
Search(String expr)
          Constructor.
Search(String searchPath, int maxReturn, SortCriteria[] sortCriteria, Expression expr)
          Constructor.
Search(String searchPath, int maxReturn, SortCriteria[] sortCriteria, String expr)
          Constructor.
Search(String searchPath, int maxReturn, String sort, Expression expr)
          Constructor.
Search(String searchPath, int maxReturn, String sort, String expr)
          Constructor.
 
Method Summary
 void addSearchPath(String path)
          Add a search path.
 void clearSearchPaths()
          Clear the search paths.
 Object clone()
          Make a copy of this object
 boolean equals(Object o)
          Determine if another object is equals to this.
 Object getContextParam(Object key)
          Get the value of a context param.
 Map getContextParams()
          Get an unmodifiable copy of the context params.
 Expression getExpression()
          Get the search expression.
 int getMaxReturn()
          Get the maximum number of objects to return.
 int getNumSearchPaths()
          Get the number of search paths.
 String[] getSearchPaths()
          Get the search paths.
 Iterator getSearchPathsIterator()
          Get an iterator over the search paths.
 SortCriteria[] getSortCriteria()
          Get the sort criteria.
 int hashCode()
          Override hashcode to use our parts.
 void removeSearchPath(String path)
          Remove a search path.
 Object setContextParam(Object key, Object value)
          Set the value of a context param.
 void setContextParams(Map input)
          Set the context params based upon the objects in the input map.
 void setExpression(Expression expression)
          Set the search expression.
 void setMaxReturn(int maxReturn)
          Set the maximum number of objects to return.
 void setSearchPath(String searchPath)
          Set the search path to contain just this one.
 void setSearchPaths(String[] paths)
          Set the search paths.
 void setSortCriteria(SortCriteria[] sortCriteria)
          Set the sort criteria.
 void setSortCriteria(String sort)
          Set the sort criteria.
 String toString()
          Get a String representation of this.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

searchPaths

protected List searchPaths
The paths under which to search.

This should be empty to search under all paths (repositories in a federeated search.) This is an OR'ed list.

In a federated search, this can begin with "/*" (e.g."/*/some/path") to denote a search path under each repository. In non-federated search, this should not be construed to contain any special characters.


maxReturn

protected int maxReturn
The maximum number of objects to return.

Less than 0 signifies returning all matches.


sortCriteria

protected SortCriteria[] sortCriteria
The sorting criteria


expression

protected Expression expression
The search expression.


contextParams

protected Map contextParams
The context params.

Constructor Detail

Search

public Search(String searchPath,
              int maxReturn,
              SortCriteria[] sortCriteria,
              Expression expr)
Constructor.


Search

public Search(String searchPath,
              int maxReturn,
              SortCriteria[] sortCriteria,
              String expr)
       throws IllegalArgumentException
Constructor.


Search

public Search(String searchPath,
              int maxReturn,
              String sort,
              Expression expr)
       throws IllegalArgumentException
Constructor.


Search

public Search(String searchPath,
              int maxReturn,
              String sort,
              String expr)
       throws IllegalArgumentException
Constructor.


Search

public Search(int maxReturn,
              SortCriteria[] sortCriteria,
              Expression expr)
Constructor.


Search

public Search(int maxReturn,
              SortCriteria[] sortCriteria,
              String expr)
       throws IllegalArgumentException
Constructor.


Search

public Search(int maxReturn,
              String sort,
              Expression expr)
       throws IllegalArgumentException
Constructor.


Search

public Search(int maxReturn,
              String sort,
              String expr)
       throws IllegalArgumentException
Constructor.


Search

public Search(int maxReturn,
              Expression expr)
Constructor.


Search

public Search(int maxReturn,
              String expr)
       throws IllegalArgumentException
Constructor.


Search

public Search(Expression expr)
Constructor.


Search

public Search(String expr)
       throws IllegalArgumentException
Constructor.


Search

public Search()
Empty constructor.

Method Detail

getSearchPaths

public String[] getSearchPaths()
Get the search paths.

See searchPaths for details about what this can be.


getSearchPathsIterator

public Iterator getSearchPathsIterator()
Get an iterator over the search paths.

See searchPaths for details about what this can be.


getNumSearchPaths

public int getNumSearchPaths()
Get the number of search paths.


setSearchPath

public void setSearchPath(String searchPath)
Set the search path to contain just this one.

See searchPaths for details about what this can be.


setSearchPaths

public void setSearchPaths(String[] paths)
Set the search paths.


addSearchPath

public void addSearchPath(String path)
Add a search path.

See searchPaths for details about what this can be.


removeSearchPath

public void removeSearchPath(String path)
Remove a search path.


clearSearchPaths

public void clearSearchPaths()
Clear the search paths.


getMaxReturn

public int getMaxReturn()
Get the maximum number of objects to return.

Use less than 0 to signify returning all matches.


setMaxReturn

public void setMaxReturn(int maxReturn)
Set the maximum number of objects to return.

Use less than 0 to signify returning all matches.


getSortCriteria

public SortCriteria[] getSortCriteria()
Get the sort criteria.


setSortCriteria

public void setSortCriteria(SortCriteria[] sortCriteria)
Set the sort criteria.


setSortCriteria

public void setSortCriteria(String sort)
                     throws IllegalArgumentException
Set the sort criteria.

Throws:
IllegalArgumentException - if the str string isn't valid occurred to SortCriteria.getSortCriteria(java.lang.String).

getExpression

public Expression getExpression()
Get the search expression.


setExpression

public void setExpression(Expression expression)
Set the search expression.


getContextParams

public Map getContextParams()
Get an unmodifiable copy of the context params.


setContextParams

public void setContextParams(Map input)
Set the context params based upon the objects in the input map.


getContextParam

public Object getContextParam(Object key)
Get the value of a context param.


setContextParam

public Object setContextParam(Object key,
                              Object value)
Set the value of a context param.

The key and value must be Serializable.

Parameters:
key - the context param key.
value - the context param value.
Returns:
the old context param value or null if none.

clone

public Object clone()
Make a copy of this object

Overrides:
clone in class Object

hashCode

public int hashCode()
Override hashcode to use our parts.

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Determine if another object is equals to this.

Overrides:
equals in class Object

toString

public String toString()
Get a String representation of this.

Overrides:
toString in class Object

© 2003 BEA Systems, Inc.

Copyright © 2003 BEA Systems, Inc. All Rights Reserved