org.chromattic.core.vt2
Class ValueDefinition<I,E>

java.lang.Object
  extended by org.chromattic.core.vt2.ValueDefinition<I,E>

public class ValueDefinition<I,E>
extends java.lang.Object

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
ValueDefinition(java.lang.Class realType, PropertyMetaType<I> propertyMetaType, SimpleTypeProvider<I,E> valueType, java.util.List<java.lang.String> defaultValue)
           
 
Method Summary
static ValueDefinition<?,?> get(int code)
           
static ValueDefinition<?,?> get(java.lang.Object o)
           
 E get(javax.jcr.Value value)
          Converts a JCR value to its external representation.
 javax.jcr.Value get(javax.jcr.ValueFactory factory, int expectedType, E value)
          Converts an external value to a JCR value.
 java.util.List<E> getDefaultValue()
           
 java.lang.Class<E> getObjectType()
           
 java.lang.Class<?> getRealType()
           
 boolean isPrimitive()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueDefinition

public ValueDefinition(java.lang.Class realType,
                       PropertyMetaType<I> propertyMetaType,
                       SimpleTypeProvider<I,E> valueType,
                       java.util.List<java.lang.String> defaultValue)
Method Detail

get

public static ValueDefinition<?,?> get(java.lang.Object o)

get

public static ValueDefinition<?,?> get(int code)

isPrimitive

public boolean isPrimitive()

getDefaultValue

public java.util.List<E> getDefaultValue()

get

public javax.jcr.Value get(javax.jcr.ValueFactory factory,
                           int expectedType,
                           E value)
                    throws javax.jcr.RepositoryException,
                           java.lang.ClassCastException
Converts an external value to a JCR value.

Parameters:
factory - the value factory
expectedType - the expected JCR type
value - the value to convert
Returns:
the converted value
Throws:
javax.jcr.RepositoryException - any repository exception
java.lang.ClassCastException - if the value does not meet the expected type

get

public E get(javax.jcr.Value value)
      throws javax.jcr.RepositoryException,
             java.lang.ClassCastException
Converts a JCR value to its external representation.

Parameters:
value - the value to convert
Returns:
the converted value
Throws:
javax.jcr.RepositoryException - any repository exception
java.lang.ClassCastException - if the value type is not the expected type

getRealType

public java.lang.Class<?> getRealType()

getObjectType

public java.lang.Class<E> getObjectType()


Copyright © 2011 eXo Platform SAS. All Rights Reserved.