|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.graph.MetaObjectRegexPredicate
org.progeeks.graph.MetaObjectSubstringPredicate
public class MetaObjectSubstringPredicate
A predicate that will perform a substring search on a MetaClass field value. It is actually based on the MetaObjectRegexPredicate, but allows for simpler programming by the user, and concievably easier predicate transforms into thing like SQL "like" expressions.
metaClass and metaClassName are mutually exclusive. If a field is not provided, all fields will be searched. Alternatively, a wildcard (*) could be provided. To narrow the scope, the name of the object's field should be supplied. The valoes of substring, startsWith and endsWith are converted into a regex expression and handled by the super
Field Summary |
---|
Fields inherited from class org.progeeks.graph.MetaObjectRegexPredicate |
---|
WILDCARD |
Constructor Summary | |
---|---|
MetaObjectSubstringPredicate()
|
|
MetaObjectSubstringPredicate(MetaClass metaClass,
java.lang.String field,
java.lang.String substring)
Constructor to create a MetaObjectSubstringPredicate from a MetaClass, field and substring. |
|
MetaObjectSubstringPredicate(MetaClass metaClass,
java.lang.String field,
java.lang.String substring,
boolean startsWith,
boolean endsWith)
Constructor to create a MetaObjectSubstringPredicate from a MetaClass, field and substring. |
|
MetaObjectSubstringPredicate(MetaClass metaClass,
java.lang.String metaClassName,
java.lang.String field,
java.lang.String substring,
boolean start,
boolean end)
|
|
MetaObjectSubstringPredicate(java.lang.String metaClassName,
java.lang.String field,
java.lang.String substring)
Constructor to create a MetaObjectSubstringPredicate from a meta class name, field and substring. |
|
MetaObjectSubstringPredicate(java.lang.String metaClassName,
java.lang.String field,
java.lang.String substring,
boolean startsWith,
boolean endsWith)
|
Method Summary | |
---|---|
protected java.lang.String |
createRegex(java.lang.String value,
boolean start,
boolean end)
|
boolean |
equals(java.lang.Object obj)
|
boolean |
evaluate(java.lang.Object object)
Returns true if the specified node is a meta-object and it's field value is matched with the search expression provided. |
java.lang.String |
getSubstring()
|
int |
hashCode()
|
boolean |
isEndsWith()
Returns whether we're need the endings of our substring and the predicated value to match from the beginning |
boolean |
isStartsWith()
Returns whether we're need the beginnings of our substring and the predicated value to match from the beginning |
protected void |
processSettings()
|
void |
setEndsWith(boolean endsWith)
Controls whether we're need the endings of our substring and the predicated value to match from the beginning |
void |
setStartsWith(boolean startsWith)
Controls whether we're need the beginnings of our substring and the predicated value to match from the beginning |
void |
setSubstring(java.lang.String substring)
|
Methods inherited from class org.progeeks.graph.MetaObjectRegexPredicate |
---|
getExpression, getField, getFieldExpression, getMetaClass, getMetaClassName, setExpression, setField, setFieldExpression, setMetaClass, setMetaClassName, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MetaObjectSubstringPredicate()
public MetaObjectSubstringPredicate(java.lang.String metaClassName, java.lang.String field, java.lang.String substring)
public MetaObjectSubstringPredicate(MetaClass metaClass, java.lang.String field, java.lang.String substring)
public MetaObjectSubstringPredicate(java.lang.String metaClassName, java.lang.String field, java.lang.String substring, boolean startsWith, boolean endsWith)
public MetaObjectSubstringPredicate(MetaClass metaClass, java.lang.String field, java.lang.String substring, boolean startsWith, boolean endsWith)
public MetaObjectSubstringPredicate(MetaClass metaClass, java.lang.String metaClassName, java.lang.String field, java.lang.String substring, boolean start, boolean end)
Method Detail |
---|
public java.lang.String getSubstring()
public void setSubstring(java.lang.String substring)
public boolean isStartsWith()
public void setStartsWith(boolean startsWith)
public boolean isEndsWith()
public void setEndsWith(boolean endsWith)
protected java.lang.String createRegex(java.lang.String value, boolean start, boolean end)
protected void processSettings()
public int hashCode()
hashCode
in class MetaObjectRegexPredicate
public boolean equals(java.lang.Object obj)
equals
in class MetaObjectRegexPredicate
public boolean evaluate(java.lang.Object object)
MetaObjectRegexPredicate
metaClass
:
If this is set, the object will
be evaluated on the basis that it is
an instance of the metaClass
type.
metaClassName
:
If this is set, the object will
be evaluated on the basis that it is
an instance of the meta class as looked up
through the object's class registry.
metaClass
and metaClassName
are mutually exclusive.
expression
:
Any null or empty expressions will return false
field
:
In order to search for an expression, a field should be provided
in order to match against it's contents. If field
has not been provided, matching will performed against all fields.
evaluate
in interface org.apache.commons.collections.Predicate
evaluate
in class MetaObjectRegexPredicate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |