org.qi4j.library.struts2
Class EntityCompositeConverter

java.lang.Object
  extended by com.opensymphony.xwork2.conversion.impl.DefaultTypeConverter
      extended by org.apache.struts2.util.StrutsTypeConverter
          extended by org.qi4j.library.struts2.EntityCompositeConverter
All Implemented Interfaces:
com.opensymphony.xwork2.conversion.TypeConverter

public class EntityCompositeConverter
extends org.apache.struts2.util.StrutsTypeConverter

Converts Strings to entities and entities to strings.

To convert from a string to an entity the value passed in is expected to be an identity. The identity can be either a fully qualified identity, e.g org.qi4j.example.Person:368e27f0-ea39-497a-9069-ffb5f41bf174-0, or it can be just the uuid.

Conversion to a String is done using the EntityComposites identity and and returning just the uuid portion.


Field Summary
 
Fields inherited from interface com.opensymphony.xwork2.conversion.TypeConverter
NO_CONVERSION_POSSIBLE, TYPE_CONVERTER_CONTEXT_KEY
 
Constructor Summary
EntityCompositeConverter()
           
 
Method Summary
 Object convertFromString(Map context, String[] values, Class toClass)
           
 String convertToString(Map context, Object o)
           
 void setUnitOfWorkFactory(UnitOfWorkFactory uowf)
           
 
Methods inherited from class org.apache.struts2.util.StrutsTypeConverter
convertValue, performFallbackConversion
 
Methods inherited from class com.opensymphony.xwork2.conversion.impl.DefaultTypeConverter
bigDecValue, bigIntValue, booleanValue, convertValue, convertValue, doubleValue, enumValue, getTypeConverter, longValue, stringValue, stringValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityCompositeConverter

public EntityCompositeConverter()
Method Detail

setUnitOfWorkFactory

public void setUnitOfWorkFactory(UnitOfWorkFactory uowf)

convertFromString

public Object convertFromString(Map context,
                                String[] values,
                                Class toClass)
Specified by:
convertFromString in class org.apache.struts2.util.StrutsTypeConverter

convertToString

public String convertToString(Map context,
                              Object o)
Specified by:
convertToString in class org.apache.struts2.util.StrutsTypeConverter