org.apache.cocoon.components.search.fieldmodel
Class DateFieldDefinition

java.lang.Object
  extended by org.apache.cocoon.components.search.fieldmodel.FieldDefinition
      extended by org.apache.cocoon.components.search.fieldmodel.DateFieldDefinition

public class DateFieldDefinition
extends FieldDefinition

Field Definition for Date type

Author:
Nicolas Maisonneuve

Field Summary
 
Fields inherited from class org.apache.cocoon.components.search.fieldmodel.FieldDefinition
DATE, index, KEYWORD, name, store, STRING_TYPE, TEXT, type
 
Constructor Summary
DateFieldDefinition(java.lang.String name)
           
 
Method Summary
 org.apache.lucene.document.Field createLField(java.util.Date date)
          Create Lucene Field
 org.apache.lucene.document.Field createLField(java.lang.String dateString)
          Create a Lucene Field
 java.text.SimpleDateFormat getDateFormat()
           
 void setDateFormat(java.text.SimpleDateFormat df)
          Set the date format to parse string date in the
 
Methods inherited from class org.apache.cocoon.components.search.fieldmodel.FieldDefinition
create, equals, equals, getStore, getType, hashCode, name, setStore, stringTotype, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateFieldDefinition

public DateFieldDefinition(java.lang.String name)
Parameters:
name - name of the field
Method Detail

setDateFormat

public void setDateFormat(java.text.SimpleDateFormat df)
Set the date format to parse string date in the

Parameters:
df -
See Also:
method

getDateFormat

public java.text.SimpleDateFormat getDateFormat()
Returns:
the dateformat

createLField

public final org.apache.lucene.document.Field createLField(java.lang.String dateString)
                                                    throws java.lang.IllegalArgumentException
Create a Lucene Field

Specified by:
createLField in class FieldDefinition
Parameters:
dateString - String date in string format
Returns:
A field.
Throws:
java.lang.IllegalArgumentException
See Also:
Field

createLField

public final org.apache.lucene.document.Field createLField(java.util.Date date)
Create Lucene Field

Parameters:
date - the date
Returns:
A field.
See Also:
Field


Copyright $ Apache Software Foundation. All Rights Reserved.