Package de.cxp.ocs.config
Class FieldConfiguration
- java.lang.Object
-
- de.cxp.ocs.config.FieldConfiguration
-
public class FieldConfiguration extends Object
-
-
Constructor Summary
Constructors Constructor Description FieldConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldConfigurationaddDynamicField(Field dynamicField)Add field definition, that is used as template for unknown fields.FieldConfigurationaddField(Field field)Add explicit field configuration.FieldgetField(String name)Gets a Field by it's name.booleanhasField(String name)Checks weather a field with the passed name exists or not.
-
-
-
Method Detail
-
addField
public FieldConfiguration addField(Field field)
Add explicit field configuration. Defines how data fields are indexed.- Parameters:
field-- Returns:
-
addDynamicField
public FieldConfiguration addDynamicField(Field dynamicField)
Add field definition, that is used as template for unknown fields.
For dynamic fields the properties 'name', 'sourceNames' and 'type' have a special meaning:
- name: is actually ignored, but if it is set to 'attribute', that dynamic field is only applied to attributes (hack)
- *sourceNames*: Each source name is used as a regular expressions for the unknown fields. If it's not specified, the field name is irrelevant and only the other criterion must match.
- type: can be 'string' or 'number' and that dynamic field will only be used, if the data field is of that particular type.
The order of dynamic fields matter. Unknown fields are checked against them in the defined order. Once a field configuration is derived from a dynamic field, the dynamic fields are not considered anymore for the same data field.
- Parameters:
dynamicField-- Returns:
-
getField
public Field getField(String name)
Gets a Field by it's name.- Parameters:
name- the name of the field.- Returns:
- the configured field or
nullif no field with that name exists in the configuration.
-
hasField
public boolean hasField(String name)
Checks weather a field with the passed name exists or not.- Parameters:
name- the name to check.- Returns:
trueif a field with that name exists,falseotherwise.
-
-