org.onemind.commons.relabean
Class RelationalBeanModel

java.lang.Object
  extended byorg.onemind.commons.relabean.RelationalBeanModel

public class RelationalBeanModel
extends java.lang.Object

A RelationalBeanModel describe a set of inter-related beans in terms of their properties and relation to each others.

Version:
$Id: RelationalBeanModel.java,v 1.2 2004/08/26 16:28:58 thlee Exp $ $Name: $
Author:
TiongHiang Lee (thlee@onemindsoft.org)

Constructor Summary
RelationalBeanModel(RelationalBeanModelDescriptor desc)
          Constructor {@inheritDoc}
 
Method Summary
 void addBeanInfo(RelationalBeanInfo info)
          Add a bean info
 void dump(java.lang.String prefix, java.io.Writer writer)
          Dump the property
 RelationalBeanInfo getBeanInfo(java.lang.Class beanClass)
          Get a bean info
 java.util.Collection getBeanInfos()
          Get all the bean infos
 RelationalBeanModelDescriptor getDescriptor()
          The descriptor
 java.lang.Object readProperty(java.lang.Object obj, java.lang.String propName)
          Read the value of the property of bean
 void setDesc(RelationalBeanModelDescriptor descriptor)
          Set the descriptor
 java.lang.Object writeProperty(java.lang.Object obj, java.lang.String propName, java.lang.Object value)
          Write the property to the bean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationalBeanModel

public RelationalBeanModel(RelationalBeanModelDescriptor desc)
Constructor {@inheritDoc}

Method Detail

addBeanInfo

public void addBeanInfo(RelationalBeanInfo info)
Add a bean info

Parameters:
info - the relational bean info

getBeanInfo

public RelationalBeanInfo getBeanInfo(java.lang.Class beanClass)
Get a bean info

Parameters:
beanClass - the class
Returns:
the bean info for the class

getBeanInfos

public java.util.Collection getBeanInfos()
Get all the bean infos

Returns:
the bean infos

getDescriptor

public RelationalBeanModelDescriptor getDescriptor()
The descriptor

Returns:
the descriptor

setDesc

public void setDesc(RelationalBeanModelDescriptor descriptor)
Set the descriptor

Parameters:
descriptor - the descriptor

dump

public void dump(java.lang.String prefix,
                 java.io.Writer writer)
          throws java.io.IOException
Dump the property

Parameters:
prefix - the prefix
writer - the writer
Throws:
java.io.IOException - if there's IO problem

readProperty

public java.lang.Object readProperty(java.lang.Object obj,
                                     java.lang.String propName)
                              throws java.lang.IllegalAccessException,
                                     java.lang.reflect.InvocationTargetException
Read the value of the property of bean

Parameters:
obj - the bean
propName - the property
Returns:
the value
Throws:
java.lang.IllegalAccessException - if there's access problem
java.lang.reflect.InvocationTargetException - if there's exception invoking method

writeProperty

public java.lang.Object writeProperty(java.lang.Object obj,
                                      java.lang.String propName,
                                      java.lang.Object value)
                               throws java.lang.IllegalAccessException,
                                      java.lang.reflect.InvocationTargetException
Write the property to the bean

Parameters:
obj - the bean
propName - the property name
value - the bean value to set/write
Returns:
return the value set
Throws:
java.lang.IllegalAccessException - if there's access problem
java.lang.reflect.InvocationTargetException - if there's exception invoking method


Copyright © 2004-2005 . All Rights Reserved.