Daisy Open Source CMS

org.outerj.daisy.repository
Class FieldHelper

java.lang.Object
  extended by org.outerj.daisy.repository.FieldHelper

public final class FieldHelper
extends Object

Some helper methods that can be useful when working with Fields.


Nested Class Summary
static interface FieldHelper.XmlFieldValueGetter
           
static interface FieldHelper.XmlFieldValueSetter
           
 
Constructor Summary
FieldHelper()
           
 
Method Summary
static Object getFieldValueFromXml(ValueType valueType, boolean multiValue, boolean hierarchical, org.outerx.daisy.x10.FieldValuesType xml)
          Convenience method to get a value of a certain ValueType from a Field-as-XML.
static Object getFieldValueFromXml(ValueType valueType, boolean multiValue, org.outerx.daisy.x10.FieldValuesType xml)
           
static Object[] getFieldValuesFromXml(ValueType valueType, org.outerx.daisy.x10.FieldValuesType xml)
           
static String getFormattedValue(Object value, ValueType valueType, Locale locale, Repository repository)
          Convenience method to get a String representation of a value, taking into account the locale (thus nicer then calling toString() on the value).
static FieldHelper.XmlFieldValueGetter getXmlFieldValueGetter(ValueType valueType)
           
static FieldHelper.XmlFieldValueSetter getXmlFieldValueSetter(ValueType valueType)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldHelper

public FieldHelper()
Method Detail

getFormattedValue

public static String getFormattedValue(Object value,
                                       ValueType valueType,
                                       Locale locale,
                                       Repository repository)
Convenience method to get a String representation of a value, taking into account the locale (thus nicer then calling toString() on the value).


getFieldValueFromXml

public static Object getFieldValueFromXml(ValueType valueType,
                                          boolean multiValue,
                                          boolean hierarchical,
                                          org.outerx.daisy.x10.FieldValuesType xml)
Convenience method to get a value of a certain ValueType from a Field-as-XML. Useful if you're working with the XML representation of a field.


getFieldValueFromXml

public static Object getFieldValueFromXml(ValueType valueType,
                                          boolean multiValue,
                                          org.outerx.daisy.x10.FieldValuesType xml)

getFieldValuesFromXml

public static Object[] getFieldValuesFromXml(ValueType valueType,
                                             org.outerx.daisy.x10.FieldValuesType xml)

getXmlFieldValueSetter

public static FieldHelper.XmlFieldValueSetter getXmlFieldValueSetter(ValueType valueType)

getXmlFieldValueGetter

public static FieldHelper.XmlFieldValueGetter getXmlFieldValueGetter(ValueType valueType)

Daisy Open Source CMS