java.lang.Object
org.refcodes.runtime.DumpBuilderImpl
- All Implemented Interfaces:
org.refcodes.mixin.ObjectAccessor
,org.refcodes.mixin.ObjectAccessor.ObjectBuilder<DumpBuilder>
,org.refcodes.mixin.ObjectAccessor.ObjectMutator
,org.refcodes.mixin.ObjectAccessor.ObjectProperty
,DumpBuilder
public class DumpBuilderImpl extends Object implements DumpBuilder
Extend the
toDump(Object, Map)
wit a List
if visited objects
and a "nested"-counter and dig recursively into the object. Use the
Delimiter.PATH
("/") delimiter to conform with the
CanonicalMap
's Properties subclass (as of refcodes-properties
artifact).-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ObjectAccessor
org.refcodes.mixin.ObjectAccessor.ObjectBuilder<B extends org.refcodes.mixin.ObjectAccessor.ObjectBuilder<B>>, org.refcodes.mixin.ObjectAccessor.ObjectMutator, org.refcodes.mixin.ObjectAccessor.ObjectProperty
-
Constructor Summary
Constructors Constructor Description DumpBuilderImpl()
-
Method Summary
Modifier and Type Method Description Object
getObject()
void
setObject(Object aObject)
Map<String,String>
toDump(Object aObj)
Dumps the state of the provided object into aMap
which is returned as result.protected static Map<String,String>
toDump(Object aObj, Map<String,String> aDump)
Dumps the state of the implementing instance into the providedMap
which is returned as result.DumpBuilder
withObject(Object aObject)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.runtime.DumpBuilder
toDump
Methods inherited from interface org.refcodes.mixin.ObjectAccessor.ObjectProperty
letObject
-
Constructor Details
-
DumpBuilderImpl
public DumpBuilderImpl()
-
-
Method Details
-
getObject
- Specified by:
getObject
in interfaceorg.refcodes.mixin.ObjectAccessor
-
setObject
- Specified by:
setObject
in interfaceorg.refcodes.mixin.ObjectAccessor.ObjectMutator
-
withObject
- Specified by:
withObject
in interfaceorg.refcodes.mixin.ObjectAccessor.ObjectBuilder<DumpBuilder>
-
toDump
Dumps the state of the provided object into aMap
which is returned as result.- Specified by:
toDump
in interfaceDumpBuilder
- Parameters:
aObj
- The object for which to create the dump.- Returns:
- The
Map
with the dumped properties of the implementing instance.
-
toDump
Dumps the state of the implementing instance into the providedMap
which is returned as result. This default implementation uses reflection to create a basic dump.Map
properties are processed but not recursively digged into. Existing properties are overwritten in case shadowing super-class's properties.
-