be.objectify.led
Interface ObjectFactory<T>

All Known Implementing Classes:
AbstractNumberFactory, AbstractObjectFactory, BooleanFactory, ByteFactory, CharacterFactory, DoubleFactory, EnumFactory, FloatFactory, IntegerFactory, ListFactory, LongFactory, MapFactory, SetFactory, ShortFactory, StringFactory

public interface ObjectFactory<T>

Object factories are used to convert string property values into objects of an specific type.

Author:
Steve Chaloner

Method Summary
 T createObject(String propertyName, String propertyValue)
          Creates an object based on propertyValue.
 Class<T> getBoundClass()
          Gets the class type this factory produces objects for.
 void validate(String propertyName, String propertyValue, ValidationFunction... validationFunctions)
          Validations the value for the field.
 

Method Detail

createObject

T createObject(String propertyName,
               String propertyValue)
Creates an object based on propertyValue. If propertyValue is null or no object can be based on it, null should be returned.

Parameters:
propertyValue - the value of the property
Returns:
an object (probably) based on propertyValue, or null

getBoundClass

Class<T> getBoundClass()
Gets the class type this factory produces objects for.

Returns:
the class type

validate

void validate(String propertyName,
              String propertyValue,
              ValidationFunction... validationFunctions)
Validations the value for the field.

Parameters:
propertyName - the name of the property
propertyValue - the value from the @{link PropertyContext}
validationFunctions - functions to validate the property value
Throws:
ValidationException - if the property value isn't valid


Copyright © 2010 Objectify. All Rights Reserved.