org.springframework.beans
Class TestBean

java.lang.Object
  extended by org.springframework.beans.TestBean
All Implemented Interfaces:
Comparable<Object>, BeanFactoryAware, BeanNameAware, IOther, ITestBean

public class TestBean
extends Object
implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable<Object>

Simple test bean used for testing bean factories, AOP framework etc.

Since:
15 April 2001
Author:
Rod Johnson

Constructor Summary
TestBean()
           
TestBean(ITestBean spouse)
           
TestBean(ITestBean spouse, Properties someProperties)
           
TestBean(String name)
           
TestBean(String name, int age)
           
 
Method Summary
 void absquatulate()
           
 int compareTo(Object other)
           
 void destroy()
           
 boolean equals(Object other)
           
 void exceptional(Throwable t)
          t null no error
 int getAge()
           
 BeanFactory getBeanFactory()
           
 String getBeanName()
           
 String getCountry()
           
 Date getDate()
           
 INestedTestBean getDoctor()
           
 Colour getFavouriteColour()
           
 Collection<?> getFriends()
           
 INestedTestBean getLawyer()
           
 Float getMyFloat()
           
 String getName()
           
 IndexedTestBean getNestedIndexedBean()
           
 List<?> getOtherColours()
           
 List<?> getPets()
           
 String getSex()
           
 Boolean getSomeBoolean()
           
 Integer[] getSomeIntegerArray()
           
 List<?> getSomeList()
           
 Map<?,?> getSomeMap()
           
 Number getSomeNumber()
           
 Properties getSomeProperties()
           
 Set<?> getSomeSet()
           
 ITestBean getSpouse()
           
 String[] getStringArray()
           
 String getTouchy()
           
 int hashCode()
           
 int haveBirthday()
          Increment the age by one
 boolean isJedi()
           
 boolean isPostProcessed()
           
 Object returnsThis()
           
 void setAge(int age)
           
 void setBeanFactory(BeanFactory beanFactory)
           
 void setBeanName(String beanName)
           
 void setCountry(String country)
           
 void setDate(Date date)
           
 void setDoctor(INestedTestBean bean)
           
 void setFavouriteColour(Colour favouriteColour)
           
 void setFriends(Collection<?> friends)
           
 void setJedi(boolean jedi)
           
 void setLawyer(INestedTestBean bean)
           
 void setMyFloat(Float myFloat)
           
 void setName(String name)
           
 void setNestedIndexedBean(IndexedTestBean nestedIndexedBean)
           
 void setOtherColours(List<?> otherColours)
           
 void setPets(List<?> pets)
           
 void setPostProcessed(boolean postProcessed)
           
 void setSex(String sex)
           
 void setSomeBoolean(Boolean someBoolean)
           
 void setSomeIntegerArray(Integer[] someIntegerArray)
           
 void setSomeList(List<?> someList)
           
 void setSomeMap(Map<?,?> someMap)
           
 void setSomeNumber(Number someNumber)
           
 void setSomeProperties(Properties someProperties)
           
 void setSomeSet(Set<?> someSet)
           
 void setSpouse(ITestBean spouse)
           
 void setStringArray(String[] stringArray)
           
 void setTouchy(String touchy)
           
 String toString()
           
 void unreliableFileOperation()
           
 boolean wasDestroyed()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestBean

public TestBean()

TestBean

public TestBean(String name)

TestBean

public TestBean(ITestBean spouse)

TestBean

public TestBean(String name,
                int age)

TestBean

public TestBean(ITestBean spouse,
                Properties someProperties)
Method Detail

setBeanName

public void setBeanName(String beanName)
Specified by:
setBeanName in interface BeanNameAware

getBeanName

public String getBeanName()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Specified by:
setBeanFactory in interface BeanFactoryAware

getBeanFactory

public BeanFactory getBeanFactory()

setPostProcessed

public void setPostProcessed(boolean postProcessed)

isPostProcessed

public boolean isPostProcessed()

getName

public String getName()
Specified by:
getName in interface ITestBean

setName

public void setName(String name)
Specified by:
setName in interface ITestBean

getSex

public String getSex()

setSex

public void setSex(String sex)

getAge

public int getAge()
Specified by:
getAge in interface ITestBean

setAge

public void setAge(int age)
Specified by:
setAge in interface ITestBean

isJedi

public boolean isJedi()

setJedi

public void setJedi(boolean jedi)

getSpouse

public ITestBean getSpouse()
Specified by:
getSpouse in interface ITestBean

setSpouse

public void setSpouse(ITestBean spouse)
Specified by:
setSpouse in interface ITestBean

getTouchy

public String getTouchy()

setTouchy

public void setTouchy(String touchy)
               throws Exception
Throws:
Exception

getCountry

public String getCountry()

setCountry

public void setCountry(String country)

getStringArray

public String[] getStringArray()

setStringArray

public void setStringArray(String[] stringArray)

getSomeIntegerArray

public Integer[] getSomeIntegerArray()

setSomeIntegerArray

public void setSomeIntegerArray(Integer[] someIntegerArray)

getDate

public Date getDate()

setDate

public void setDate(Date date)

getMyFloat

public Float getMyFloat()

setMyFloat

public void setMyFloat(Float myFloat)

getFriends

public Collection<?> getFriends()

setFriends

public void setFriends(Collection<?> friends)

getSomeSet

public Set<?> getSomeSet()

setSomeSet

public void setSomeSet(Set<?> someSet)

getSomeMap

public Map<?,?> getSomeMap()

setSomeMap

public void setSomeMap(Map<?,?> someMap)

getSomeList

public List<?> getSomeList()

setSomeList

public void setSomeList(List<?> someList)

getSomeProperties

public Properties getSomeProperties()

setSomeProperties

public void setSomeProperties(Properties someProperties)

getDoctor

public INestedTestBean getDoctor()
Specified by:
getDoctor in interface ITestBean

getLawyer

public INestedTestBean getLawyer()
Specified by:
getLawyer in interface ITestBean

setDoctor

public void setDoctor(INestedTestBean bean)

setLawyer

public void setLawyer(INestedTestBean bean)

getSomeNumber

public Number getSomeNumber()

setSomeNumber

public void setSomeNumber(Number someNumber)

getFavouriteColour

public Colour getFavouriteColour()

setFavouriteColour

public void setFavouriteColour(Colour favouriteColour)

getSomeBoolean

public Boolean getSomeBoolean()

setSomeBoolean

public void setSomeBoolean(Boolean someBoolean)

getNestedIndexedBean

public IndexedTestBean getNestedIndexedBean()
Specified by:
getNestedIndexedBean in interface ITestBean

setNestedIndexedBean

public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean)

getOtherColours

public List<?> getOtherColours()

setOtherColours

public void setOtherColours(List<?> otherColours)

getPets

public List<?> getPets()

setPets

public void setPets(List<?> pets)

exceptional

public void exceptional(Throwable t)
                 throws Throwable
Description copied from interface: ITestBean
t null no error

Specified by:
exceptional in interface ITestBean
Throws:
Throwable
See Also:
ITestBean.exceptional(Throwable)

unreliableFileOperation

public void unreliableFileOperation()
                             throws IOException
Specified by:
unreliableFileOperation in interface ITestBean
Throws:
IOException

returnsThis

public Object returnsThis()
Specified by:
returnsThis in interface ITestBean
See Also:
ITestBean.returnsThis()

absquatulate

public void absquatulate()
Specified by:
absquatulate in interface IOther
See Also:
IOther.absquatulate()

haveBirthday

public int haveBirthday()
Description copied from interface: ITestBean
Increment the age by one

Specified by:
haveBirthday in interface ITestBean
Returns:
the previous age

destroy

public void destroy()

wasDestroyed

public boolean wasDestroyed()

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object other)
Specified by:
compareTo in interface Comparable<Object>

toString

public String toString()
Overrides:
toString in class Object


Copyright ? 2005-2008 Spring Framework. All Rights Reserved.