Module io.github.sugarcubes.cloner
Package io.github.sugarcubes.cloner.spi
package io.github.sugarcubes.cloner.spi
Low-level extension points of the cloner: how instances are created, how fields are read and written, how types are
modeled. The mechanisms of a
Toolset implement these interfaces; custom
implementations are added by ToolsetBuilder.
InstanceAllocatorFactoryandInstanceAllocatorcreate instances, without constructors unless an allocator is a constructor fallback;FieldAdapterFactoryandFieldAdapterread and write fields;Reflectionfinds members and makes them accessible, opening packages if the toolset does;FieldsModel,ValuesModelandContainerModeldescribe types copied by fields, created from values (records, immutable collections) and rebuilt from elements (collections, maps).
The models only describe types; what is copied is decided by the cloner and its policies.
-
ClassDescriptionLow-level model of a container: a collection or a map.Reads and writes one field of objects, created for the field by a
FieldAdapterFactory.Factory of field adapters.FieldsModel<T>Low-level model of a type whose instances are created without constructor and whose state is its fields.Factory for objects of the specific type.Instance allocator factory interface.Reflection used by the cloner to find members and make them accessible.ValuesModel<T>Low-level model of a type whose instances are created from the values of their components, e.g.