Package de.cxp.ocs.config
Class FieldConfiguration
java.lang.Object
de.cxp.ocs.config.FieldConfiguration
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDynamicField
(Field dynamicField) Add field definition, that is used as template for unknown fields.Add explicit field configuration.Gets a Field by it's name.boolean
Checks weather a field with the passed name exists or not.
-
Field Details
-
useDefaultConfig
public boolean useDefaultConfig
-
-
Constructor Details
-
FieldConfiguration
public FieldConfiguration()
-
-
Method Details
-
addField
Add explicit field configuration. Defines how data fields are indexed.- Parameters:
field
- field to add- Returns:
- changed configuration
-
addDynamicField
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
- field config as template- Returns:
- changed configuration
-
getField
Gets a Field by it's name.- Parameters:
name
- the name of the field.- Returns:
- the configured field or
null
if no field with that name exists in the configuration.
-
hasField
Checks weather a field with the passed name exists or not.- Parameters:
name
- the name to check.- Returns:
true
if a field with that name exists,false
otherwise.
-