资 源 简 介
Introduction
Object-traverser is a language to specify traversals of object graphs. This can be used for serialisation and deserialisation of object graphs as well as for comparison and cloning.
It tries to provide a more generic solution to the problem that is also addressed by jakarta commons" EqualsBuilder and ToStringBuilder. One of the limitations of these is that they worked recursively. So if you want to change the depth they operate down to, you will have to modify the classes that are being compared/ toStringed.
Object-traverser solves this by pulling the traversal order out of the traversed objects. Also it has a provides an abstraction over visiting and transforming object graphs.
There is an introductory presentation.
Example
The code for this example is available in 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报