001package org.dcm4che3.conf.api.extensions;
002
003import org.dcm4che3.net.DeviceExtension;
004
005/**
006 * This class shall be extended by vendors/contributors to store extra configuration for a device.
007 * @author Roman K
008 */
009public class CommonDeviceExtension extends DeviceExtension {
010
011    /**
012     * Iterates over all configurable fields and transfers the values using getter/setters from 'from' to this
013     * @param from The extension with new configuration
014     * @param clazz Class of the extension
015     */
016    public void reconfigureReflectively(DeviceExtension from, Class<? extends DeviceExtension> clazz) {
017        ReconfiguringIterator.reconfigure(from, this, clazz);
018    }
019
020    public void reconfigure(DeviceExtension from) {
021        // fallback to default reflective if the extension did not override the method
022        reconfigureReflectively(from,from.getClass());
023    }
024}