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

java.lang.Object
  extended by org.apache.cocoon.components.search.fieldmodel.FieldDefinition
Direct Known Subclasses:
DateFieldDefinition, StringFieldDefinition

public abstract class FieldDefinition
extends java.lang.Object

Field Definition class

Author:
Nicolas Maisonneuve

Field Summary
static int DATE
          Date type
protected  boolean index
           
static int KEYWORD
          Keyword type
protected  java.lang.String name
          Name of the field
protected  boolean store
          Lucene Field specification
static java.lang.String[] STRING_TYPE
           
static int TEXT
          Text type
protected  int type
          type of the field (text, keyword, date)
 
Constructor Summary
protected FieldDefinition(java.lang.String name, int type)
           
protected FieldDefinition(java.lang.String name, java.lang.String type)
           
 
Method Summary
static FieldDefinition create(java.lang.String name, int type)
           
abstract  org.apache.lucene.document.Field createLField(java.lang.String value)
          Create Lucene Field
 boolean equals(FieldDefinition fielddef)
           
 boolean equals(java.lang.Object object)
           
 boolean getStore()
           
 int getType()
           
 int hashCode()
           
 java.lang.String name()
           
 void setStore(boolean store)
           
static int stringTotype(java.lang.String typename)
          Convert String to type
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT

public static final int TEXT
Text type

See Also:
Constant Field Values

KEYWORD

public static final int KEYWORD
Keyword type

See Also:
Constant Field Values

DATE

public static final int DATE
Date type

See Also:
Constant Field Values

STRING_TYPE

public static final java.lang.String[] STRING_TYPE

name

protected java.lang.String name
Name of the field


type

protected int type
type of the field (text, keyword, date)


store

protected boolean store
Lucene Field specification


index

protected boolean index
Constructor Detail

FieldDefinition

protected FieldDefinition(java.lang.String name,
                          java.lang.String type)
                   throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

FieldDefinition

protected FieldDefinition(java.lang.String name,
                          int type)
                   throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException
Method Detail

create

public static FieldDefinition create(java.lang.String name,
                                     int type)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setStore

public void setStore(boolean store)

getStore

public boolean getStore()

equals

public boolean equals(FieldDefinition fielddef)

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

name

public java.lang.String name()

createLField

public abstract org.apache.lucene.document.Field createLField(java.lang.String value)
Create Lucene Field

Parameters:
value - String value to store in the lucene field
Returns:
Field

getType

public int getType()

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

stringTotype

public static final int stringTotype(java.lang.String typename)
                              throws java.lang.IllegalArgumentException
Convert String to type

Parameters:
typename - String
Returns:
int
Throws:
java.lang.IllegalArgumentException


Copyright $ Apache Software Foundation. All Rights Reserved.