org.chromattic.metamodel.mapping.jcr
Class PropertyMetaType<V>

java.lang.Object
  extended by org.chromattic.metamodel.mapping.jcr.PropertyMetaType<V>
Type Parameters:
V - the java type modeling the type

public abstract class PropertyMetaType<V>
extends java.lang.Object

A property meta type is a representation of the JCR property types defined by PropertyType.

Version:
$Revision$
Author:
Julien Viet

Field Summary
static PropertyMetaType<java.io.InputStream> BINARY
          .
static PropertyMetaType<java.lang.Boolean> BOOLEAN
          .
static PropertyMetaType<java.util.Calendar> DATE
          .
static PropertyMetaType<java.lang.Double> DOUBLE
          .
static PropertyMetaType<java.lang.Long> LONG
          .
static PropertyMetaType<java.lang.String> NAME
          .
static PropertyMetaType<java.lang.String> PATH
          .
static PropertyMetaType<java.lang.String> STRING
          .
 
Method Summary
static PropertyMetaType<?> get(int code)
           
 int getCode()
          Returns the JCR property type as defined by PropertyType
 java.lang.Class<V> getJavaValueType()
          Returns the Java value type modelling the property type.
abstract  V getValue(javax.jcr.Value value)
          Converts the Value to the java value.
abstract  javax.jcr.Value getValue(javax.jcr.ValueFactory factory, V v)
          Converts the Java value to the Value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING

public static final PropertyMetaType<java.lang.String> STRING
.


PATH

public static final PropertyMetaType<java.lang.String> PATH
.


NAME

public static final PropertyMetaType<java.lang.String> NAME
.


LONG

public static final PropertyMetaType<java.lang.Long> LONG
.


DOUBLE

public static final PropertyMetaType<java.lang.Double> DOUBLE
.


BOOLEAN

public static final PropertyMetaType<java.lang.Boolean> BOOLEAN
.


BINARY

public static final PropertyMetaType<java.io.InputStream> BINARY
.


DATE

public static final PropertyMetaType<java.util.Calendar> DATE
.

Method Detail

get

public static PropertyMetaType<?> get(int code)

getValue

public abstract javax.jcr.Value getValue(javax.jcr.ValueFactory factory,
                                         V v)
                                  throws javax.jcr.ValueFormatException
Converts the Java value to the Value.

Parameters:
factory - the JCR value factory required to create the value
v - the Java value
Returns:
the JCR value
Throws:
javax.jcr.ValueFormatException - thrown by the factory

getValue

public abstract V getValue(javax.jcr.Value value)
                    throws javax.jcr.RepositoryException
Converts the Value to the java value.

Parameters:
value - the JCR value
Returns:
the Java value
Throws:
javax.jcr.RepositoryException - thrown by the conversion

getJavaValueType

public java.lang.Class<V> getJavaValueType()
Returns the Java value type modelling the property type.

Returns:
the Java value type modelling the property type

getCode

public int getCode()
Returns the JCR property type as defined by PropertyType

Returns:
the JCR property type


Copyright © 2014 eXo Platform SAS. All Rights Reserved.