org.apache.jackrabbit.ocm.manager.enumconverter
Class EnumTypeConverter

java.lang.Object
  extended by org.apache.jackrabbit.ocm.manager.enumconverter.EnumTypeConverter
All Implemented Interfaces:
AtomicTypeConverter

public class EnumTypeConverter
extends Object
implements AtomicTypeConverter

SimpleEnumerationTypeConverter class. This converter can map type Enum (java.lang.Enum) to JCR properties and back.

Author:
Boni Gopalan

Constructor Summary
EnumTypeConverter()
           
 
Method Summary
 Object getObject(javax.jcr.Value value)
          Convert a jcr property value into an object
 javax.jcr.Value getValue(javax.jcr.ValueFactory valueFactory, Object object)
          Convert an object into a JCR value.
 String getXPathQueryValue(javax.jcr.ValueFactory valueFactory, Object object)
          Get the string converted value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumTypeConverter

public EnumTypeConverter()
Method Detail

getObject

public Object getObject(javax.jcr.Value value)
Description copied from interface: AtomicTypeConverter
Convert a jcr property value into an object

Specified by:
getObject in interface AtomicTypeConverter
Parameters:
value - The JCR property value
Returns:
the corresponding object

getValue

public javax.jcr.Value getValue(javax.jcr.ValueFactory valueFactory,
                                Object object)
Description copied from interface: AtomicTypeConverter
Convert an object into a JCR value.

Specified by:
getValue in interface AtomicTypeConverter
Parameters:
valueFactory - The JCR ValueFactory
object - The object to convert
Returns:
the corresponding JCR value

getXPathQueryValue

public String getXPathQueryValue(javax.jcr.ValueFactory valueFactory,
                                 Object object)
Description copied from interface: AtomicTypeConverter
Get the string converted value. This is mainly used to build xpath expressions

Specified by:
getXPathQueryValue in interface AtomicTypeConverter
Parameters:
valueFactory - The JCR ValueFactory
object - The object value
Returns:
The string converted value


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.