org.mycore.services.fieldquery
Class MCRFieldType

java.lang.Object
  extended by org.mycore.services.fieldquery.MCRFieldType

public class MCRFieldType
extends Object

Reads configuration file fieldtypes.xml and provides methods to check the operators allowed for a given type, to get the default search operator for that type, and so on.

Author:
Frank Lützenkirchen

Constructor Summary
MCRFieldType()
           
 
Method Summary
static List<String> getAllowedOperatorsForType(String fieldType)
          Returns a list of search operators allowed for this type
static String getDefaultOperator(String fieldType)
          Returns the default search operator for this field type.
static boolean isValidOperatorForType(String fieldType, String operator)
          Checks if the given search operator can be used for this field type
static boolean isValidType(String fieldType)
          Checks if the given field type is valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRFieldType

public MCRFieldType()
Method Detail

isValidType

public static boolean isValidType(String fieldType)
Checks if the given field type is valid

Parameters:
fieldType - the field type, e.g. "identifier"
Returns:
true, if this field type is known, false otherwise

isValidOperatorForType

public static boolean isValidOperatorForType(String fieldType,
                                             String operator)
Checks if the given search operator can be used for this field type

Parameters:
fieldType - the field type, e.g. "identifier"
Returns:
true, if this search operator can be used, false otherwise

getDefaultOperator

public static String getDefaultOperator(String fieldType)
Returns the default search operator for this field type.

Parameters:
fieldType - the field type, e.g. "identifier"
Returns:
the default search operator recommended for this type

getAllowedOperatorsForType

public static List<String> getAllowedOperatorsForType(String fieldType)
Returns a list of search operators allowed for this type

Parameters:
fieldType - the field type, e.g. "identifier"
Returns:
a List of Strings containing the allowed search operators