Class StringFieldFilter
java.lang.Object
org.biopax.paxtools.query.wrapperL3.Filter
org.biopax.paxtools.query.wrapperL3.StringFieldFilter
- Direct Known Subclasses:
DataSourceFilter,OrganismFilter
This is the base class for filters that are filtering based on values of specific fields of the
objects and their related objects.
- Author:
- Ozgun Babur
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanOption to accept objects if the field is empty or null. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStringFieldFilter(boolean emptyOK, String[] valid) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAccessor(PathAccessor acc, Class<? extends BioPAXElement> clazz) Adds the givenPathAccessorto the list of accessors to use to get field values of objects and their related objects.protected voidaddValidValue(String value) Adds the given valid value to the set of valid values.abstract voidThe child class should populate the list of PathAccessor object using theaddAccessormethod.booleanGets the option to accept empty fields.booleanChecks if the related values of the object are among valid values.voidsetEmptyOK(boolean emptyOK) Sets the parameter to accept empty field values.
-
Field Details
-
emptyOK
protected boolean emptyOKOption to accept objects if the field is empty or null.
-
-
Constructor Details
-
StringFieldFilter
Constructor.- Parameters:
emptyOK- whether to always accept empty field when traversing the graph or rejectvalid- filter values (strings' capitalization does not matter)
-
-
Method Details
-
isEmptyOK
public boolean isEmptyOK()Gets the option to accept empty fields.- Returns:
- true if empty is ok
-
setEmptyOK
public void setEmptyOK(boolean emptyOK) Sets the parameter to accept empty field values.- Parameters:
emptyOK- parameter to accept empty filed
-
createFieldAccessors
public abstract void createFieldAccessors()The child class should populate the list of PathAccessor object using theaddAccessormethod. -
addAccessor
Adds the givenPathAccessorto the list of accessors to use to get field values of objects and their related objects.- Parameters:
acc- accessorclazz- the type of element that the accessor is applied
-
addValidValue
Adds the given valid value to the set of valid values.- Parameters:
value- a valid value
-
okToTraverse
Checks if the related values of the object are among valid values. Returns true if none of the accessors is applicable to the given object.- Specified by:
okToTraversein classFilter- Parameters:
ele- level 3 element to check- Returns:
- true if ok to traverse
-