org.springframework.binding.form.support
Class CachingFieldFaceSource

java.lang.Object
  extended by org.springframework.binding.form.support.CachingFieldFaceSource
All Implemented Interfaces:
FieldFaceSource
Direct Known Subclasses:
MessageSourceFieldFaceSource

public abstract class CachingFieldFaceSource
extends Object
implements FieldFaceSource

A convenience superclass for FieldFaceSource's that require caching to improve the performance of FieldFace lookup.

FieldFace retrieval is delegated to subclasses using the loadFieldFace(String, Object) method.

Author:
Oliver Hutchison, Mathias Broekelmann

Constructor Summary
protected CachingFieldFaceSource()
           
 
Method Summary
 FieldFace getFieldFace(String field)
          Return the FieldFace for the field.
 FieldFace getFieldFace(String field, Object context)
          Return the FieldFace for the given field name and a context.
protected abstract  FieldFace loadFieldFace(String field, Object context)
          Loads the FieldFace for the given field path and context id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingFieldFaceSource

protected CachingFieldFaceSource()
Method Detail

getFieldFace

public FieldFace getFieldFace(String field)
Description copied from interface: FieldFaceSource
Return the FieldFace for the field.

Specified by:
getFieldFace in interface FieldFaceSource
Parameters:
field - the form field
Returns:
the FieldFace for the given field (never null).

getFieldFace

public FieldFace getFieldFace(String field,
                              Object context)
Description copied from interface: FieldFaceSource
Return the FieldFace for the given field name and a context.

Specified by:
getFieldFace in interface FieldFaceSource
Parameters:
field - the field name
context - optional context for the field face
Returns:
the FieldFace for the given field (never null).

loadFieldFace

protected abstract FieldFace loadFieldFace(String field,
                                           Object context)
Loads the FieldFace for the given field path and context id. This value will be cached so performance need not be a concern of this method.

Parameters:
field - the form field path
context - optional context for which the FieldFace is being resolved
Returns:
the FieldFace for the given context id (never null).


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.