org.springframework.beandoc.util
Class LocalizedDateFactoryBean

java.lang.Object
  extended by org.springframework.beandoc.util.LocalizedDateFactoryBean
All Implemented Interfaces:
FactoryBean, InitializingBean

public class LocalizedDateFactoryBean
extends Object
implements FactoryBean, InitializingBean

Manages a DateFormat instance that can be customized with a given Locale. Each request of this factory returns a String containing the formatted Date/Time from the time of the request.

Since:
1.0
Author:
Darren Davison

Constructor Summary
LocalizedDateFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
          Setup the DateFormat managed object based on the supplied locale (or System default locale if none is supplied)
 Object getObject()
          Returns the formatted, current Date according to the supplied or system default Locale.
 Class getObjectType()
          Returns the String class.
 boolean isSingleton()
          A new instance of the managed object has the current date and time formatted according to the supplied Locale (or system default locale if none was specified).
 void setLocale(Locale locale)
          Set the Locale to use for the managed DateFormat, overriding the system default locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizedDateFactoryBean

public LocalizedDateFactoryBean()
Method Detail

getObject

public Object getObject()
                 throws Exception
Returns the formatted, current Date according to the supplied or system default Locale.

Specified by:
getObject in interface FactoryBean
Throws:
Exception
See Also:
FactoryBean.getObject()

getObjectType

public Class getObjectType()
Returns the String class.

Specified by:
getObjectType in interface FactoryBean
See Also:
FactoryBean.getObjectType()

isSingleton

public boolean isSingleton()
A new instance of the managed object has the current date and time formatted according to the supplied Locale (or system default locale if none was specified). Therefore each managed bean instance is different and a prototype. This method always returns false

Specified by:
isSingleton in interface FactoryBean
See Also:
FactoryBean.isSingleton()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Setup the DateFormat managed object based on the supplied locale (or System default locale if none is supplied)

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

setLocale

public void setLocale(Locale locale)
Set the Locale to use for the managed DateFormat, overriding the system default locale.

Parameters:
locale -


Copyright © 2004-2009 Spring BeanDoc. All Rights Reserved.