org.hibernate.search.bridge.builtin
Class MapBridge

java.lang.Object
  extended by org.hibernate.search.bridge.builtin.MapBridge
All Implemented Interfaces:
FieldBridge
Direct Known Subclasses:
BuiltinMapBridge

public class MapBridge
extends Object
implements FieldBridge

Each entry (null included) of the values in a Map is indexed using the specified FieldBridge.
A null array is not indexed.

Author:
Davide D'Alto

Constructor Summary
MapBridge(FieldBridge bridge)
           
 
Method Summary
protected  void indexEntry(String fieldName, Object entry, org.apache.lucene.document.Document document, LuceneOptions luceneOptions)
           
protected  void indexNotNullMap(String name, Object value, org.apache.lucene.document.Document document, LuceneOptions luceneOptions)
           
 void set(String fieldName, Object value, org.apache.lucene.document.Document document, LuceneOptions luceneOptions)
          Manipulate the document to index the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapBridge

public MapBridge(FieldBridge bridge)
Parameters:
bridge - the FieldBridge used for each entry of a Map object.
Method Detail

set

public void set(String fieldName,
                Object value,
                org.apache.lucene.document.Document document,
                LuceneOptions luceneOptions)
Description copied from interface: FieldBridge
Manipulate the document to index the given value.

A common implementation is to add a Field with the given name to document following the parameters luceneOptions if the value is not null. {code} String fieldValue = convertToString(value); luceneOptions.addFieldToDocument(name, fieldValue, document); {code}

Specified by:
set in interface FieldBridge
Parameters:
fieldName - The field to add to the Lucene document
value - The actual value to index
document - The Lucene document into which we want to index the value.
luceneOptions - Contains the parameters used for adding value to the Lucene document.

indexNotNullMap

protected void indexNotNullMap(String name,
                               Object value,
                               org.apache.lucene.document.Document document,
                               LuceneOptions luceneOptions)

indexEntry

protected void indexEntry(String fieldName,
                          Object entry,
                          org.apache.lucene.document.Document document,
                          LuceneOptions luceneOptions)


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved