|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.brains2b.data.DataHelper
DateHelper is a Library class which provides method(s) which provide support for working with data objects.
All methods are static and should have no interdependancy between methods.
See the javadoc for the individual methods for the uses of that function
Constructor Summary | |
DataHelper()
|
Method Summary | |
static void |
copyDataObject(java.lang.Object source,
java.lang.Object target)
copy the content of one data object to another. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataHelper()
Method Detail |
public static final void copyDataObject(java.lang.Object source, java.lang.Object target) throws CopyException
The objects do not have to be similar, but should be bean like in that they have getters and setters for the data they contain The data object data is copied by finding all the getters from the source and copy it to the setter of another object. This does mean datatypes should be equal.
There is no strictness is copying. All methods that follow these rules will be copied. If the source has more accessors than the target these members will be left empty. If the target has less or dissimilar methods the data will be left as it was found.
getters should start with get and have no parameters, setters should start with set and take one parameter.
source
- Object, where the data should be copied from, cannot be nulltarget
- Object, where the data should be copied to, cannot be null
CopyException
- thrown if the data cannot be copied between objects usually this happens
when accessors have the same name but use a different datatype.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |