org.omwg.mediation.mappingstore.query
Class StringRestriction
java.lang.Object
org.omwg.mediation.mappingstore.query.StringRestriction
- All Implemented Interfaces:
- Restriction
- public class StringRestriction
- extends java.lang.Object
- implements Restriction
String restriction could be applied to string fields, such as name,
description. It is applicable to both Mapping and Pattern stores.
Supported restrictions are (see the public constants defined in the class):
- startsWith
- endsWith
- matches - regular expression
- contains
- equals
Constructor Summary |
StringRestriction(int typeOfRestriction,
java.lang.String s)
Constructs basic restriction by string and type. |
Method Summary |
boolean |
admit(java.lang.Object o)
This method is speciifed by Restriction Interface |
java.lang.String |
reduceToLuceneQuery(java.lang.String field)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_RESTRICTION
public static final int NO_RESTRICTION
- See Also:
- Constant Field Values
STARTS_WITH
public static final int STARTS_WITH
- See Also:
- Constant Field Values
ENDS_WITH
public static final int ENDS_WITH
- See Also:
- Constant Field Values
MATCHES
public static final int MATCHES
- See Also:
- Constant Field Values
CONTAINS
public static final int CONTAINS
- See Also:
- Constant Field Values
EQUALS
public static final int EQUALS
- See Also:
- Constant Field Values
StringRestriction
public StringRestriction(int typeOfRestriction,
java.lang.String s)
- Constructs basic restriction by string and type. The range of the
first argument is set of values of class variables referring to the
type of the restriction.
- Parameters:
typeOfRestriction
- integer number coresponding to the
restriction types
- given string
admit
public boolean admit(java.lang.Object o)
- This method is speciifed by Restriction Interface
- Specified by:
admit
in interface Restriction
- Parameters:
o
- given object of type String
- Returns:
True
if the given String satisfies the
restrictions, otherwise returns False
.
reduceToLuceneQuery
public java.lang.String reduceToLuceneQuery(java.lang.String field)
- Specified by:
reduceToLuceneQuery
in interface Restriction