Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.common.xmap
Class XValueFactory

java.lang.Object
  extended by org.nuxeo.common.xmap.XValueFactory

public abstract class XValueFactory
extends Object

Value factories are used to decode values from XML strings.

To register a new factory for a given XMap instance use the method XMap.setValueFactory(Class, XValueFactory).

Author:
Bogdan Stefanescu

Field Summary
static XValueFactory BOOLEAN
           
static XValueFactory CLASS
           
static XValueFactory DATE
           
static XValueFactory DOUBLE
           
static XValueFactory FILE
           
static XValueFactory FLOAT
           
static XValueFactory INTEGER
           
static XValueFactory LONG
           
static XValueFactory RESOURCE
           
static XValueFactory STRING
           
static XValueFactory URL
           
 
Constructor Summary
XValueFactory()
           
 
Method Summary
static void addFactory(Class klass, XValueFactory factory)
           
abstract  Object deserialize(Context context, String value)
           
 Object getAttributeValue(Context context, Node element, String name)
           
 Object getElementValue(Context context, Node element, boolean trim)
           
static XValueFactory getFactory(Class type)
           
static Object getValue(Context context, Class klass, String value)
           
abstract  String serialize(Context context, Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING

public static final XValueFactory STRING

INTEGER

public static final XValueFactory INTEGER

LONG

public static final XValueFactory LONG

DOUBLE

public static final XValueFactory DOUBLE

FLOAT

public static final XValueFactory FLOAT

BOOLEAN

public static final XValueFactory BOOLEAN

DATE

public static final XValueFactory DATE

FILE

public static final XValueFactory FILE

URL

public static final XValueFactory URL

CLASS

public static final XValueFactory CLASS

RESOURCE

public static final XValueFactory RESOURCE
Constructor Detail

XValueFactory

public XValueFactory()
Method Detail

deserialize

public abstract Object deserialize(Context context,
                                   String value)

serialize

public abstract String serialize(Context context,
                                 Object value)

getElementValue

public final Object getElementValue(Context context,
                                    Node element,
                                    boolean trim)

getAttributeValue

public final Object getAttributeValue(Context context,
                                      Node element,
                                      String name)

addFactory

public static void addFactory(Class klass,
                              XValueFactory factory)

getFactory

public static XValueFactory getFactory(Class type)

getValue

public static Object getValue(Context context,
                              Class klass,
                              String value)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.