public abstract class SearchType extends ServiceType implements Cloneable
ServiceType.Handle, ServiceType.Registry
Modifier and Type | Field and Description |
---|---|
protected static String |
PROP_OBJECT_CHANGED
Name of object changed property.
|
static String |
PROP_VALID
Name of valid property.
|
PROP_NAME
Constructor and Description |
---|
SearchType() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptSearchObject(Object searchObject)
Accepts search object to the search.
|
protected Node[] |
acceptSearchRootNodes(Node[] roots)
Accepts search root nodes.
|
Object |
clone()
Clones seach type.
|
protected abstract Class[] |
createSearchTypeClasses()
Actually creates array of class types of objects this search type can search.
|
abstract boolean |
enabled(Node[] nodes)
Checks that this search type is able to search the specified set
of nodes.
|
static Enumeration<? extends SearchType> |
enumerateSearchTypes()
Deprecated.
Please use
Lookup instead. |
Node[] |
getDetails(Node node)
Creates nodes representing matches found withing an object
represented by the specified node.
|
Node[] |
getDetails(Object resultObject)
Creates nodes representing matches found within the specified object.
|
Class[] |
getSearchTypeClasses()
Gets class types of objects this search type can search (test) on.
|
boolean |
isValid() |
protected void |
prepareSearchObject(Object searchObject)
Prepares search object.
|
void |
setValid(boolean state)
Now the custonized criterion changed validity state.
|
protected abstract boolean |
testObject(Object searchObject)
Checks whether an object matches the criteria defined in this search
type.
|
addPropertyChangeListener, createClone, displayName, firePropertyChange, getHelpCtx, getName, removePropertyChangeListener, setName
public static final String PROP_VALID
protected static final String PROP_OBJECT_CHANGED
public final Class[] getSearchTypeClasses()
SearchGroup
.
Note: the order of classes declares also priority.protected abstract Class[] createSearchTypeClasses()
protected Node[] acceptSearchRootNodes(Node[] roots)
protected boolean acceptSearchObject(Object searchObject)
true
protected void prepareSearchObject(Object searchObject)
protected abstract boolean testObject(Object searchObject)
searchObject
- object to be testedtrue
if the object matches the criteria,
false
it it does notpublic Node[] getDetails(Object resultObject)
This is a dummy implementation, subclasses should provide a real implementation.
resultObject
- object to create the nodes fornull
(subclasses should return the created nodes)public Node[] getDetails(Node node)
This is a dummy implementation, subclasses should provide a real
implementation. The typical implementation is that the node is validated,
an object is extracted from it and passed to method
SearchType.getDetails(Object)
.
node
- node representing object with matchesnull
(subclasses should return the created nodes)SearchType.getDetails(Object)
public abstract boolean enabled(Node[] nodes)
This method is usually implemented such that it returns true
if it is possible to search at least one of the nodes.
nodes
- nodes to be searchedtrue
if this search type is able to search
the nodes, false
otherwisepublic final void setValid(boolean state)
public final boolean isValid()
public Object clone()
clone
in class ServiceType
@Deprecated public static Enumeration<? extends SearchType> enumerateSearchTypes()
Lookup
instead.