org.omwg.mediation.mappingstore.query
Class MappingRestriction

java.lang.Object
  extended byorg.omwg.mediation.mappingstore.query.MappingRestriction
All Implemented Interfaces:
CompositeRestriction

public class MappingRestriction
extends java.lang.Object
implements CompositeRestriction

Mapping restriction allows to create restrictions to query the Mapping store. Restrictions could be applied to the fields of the Mapping object(name, version, description, etc.)


Field Summary
static int DESCRIPTION_RESTRICTION
           
static int NAME_RESTRICTION
           
static int SOURCE_ONTOLOGY_RESTRICTION
           
static int TARGET_ONTOLOGY_RESTRICTION
           
static int VERSION_RESTRICTION
           
 
Constructor Summary
MappingRestriction()
           
 
Method Summary
 void addRestriction(int typeOfRestriction, Restriction r)
          This method is specified by CompositeRestriction Interface.
 boolean admit(java.lang.Object o)
          This method is specified by Restriction Interface.
 java.lang.String reduceToLuceneQuery()
           
 java.lang.String toLuceneQuery(java.lang.String field)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_RESTRICTION

public static final int NAME_RESTRICTION
See Also:
Constant Field Values

VERSION_RESTRICTION

public static final int VERSION_RESTRICTION
See Also:
Constant Field Values

DESCRIPTION_RESTRICTION

public static final int DESCRIPTION_RESTRICTION
See Also:
Constant Field Values

SOURCE_ONTOLOGY_RESTRICTION

public static final int SOURCE_ONTOLOGY_RESTRICTION
See Also:
Constant Field Values

TARGET_ONTOLOGY_RESTRICTION

public static final int TARGET_ONTOLOGY_RESTRICTION
See Also:
Constant Field Values
Constructor Detail

MappingRestriction

public MappingRestriction()
Method Detail

addRestriction

public void addRestriction(int typeOfRestriction,
                           Restriction r)
This method is specified by CompositeRestriction Interface. The range of the first argument is set of values of class variables referring to the class attributes.

Specified by:
addRestriction in interface CompositeRestriction
Parameters:
typeOfRestriction - given restriction type
r - given restriction

admit

public boolean admit(java.lang.Object o)
This method is specified by Restriction Interface. It checks if given mapping complies with all those restrictions which have been included through addRestriction method or it doesn’t.

Specified by:
admit in interface CompositeRestriction
Parameters:
o - given object of type Mapping
Returns:
- True if the Mapping complys with the restrictions, otherwise returns False.

toLuceneQuery

public java.lang.String toLuceneQuery(java.lang.String field)

reduceToLuceneQuery

public java.lang.String reduceToLuceneQuery()
Specified by:
reduceToLuceneQuery in interface CompositeRestriction