All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.ui.declarative.ShouldWriteDataDelegate Maven / Gradle / Ivy

There is a newer version: 8.27.3
Show newest version
/*
 * Copyright (C) 2000-2024 Vaadin Ltd
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  for the full
 * license.
 */
package com.vaadin.ui.declarative;

import java.io.Serializable;

import com.vaadin.ui.Component;

/**
 * Delegate used by {@link DesignContext} to determine whether container data
 * should be written out for a component.
 *
 * @see DesignContext#shouldWriteData(Component)
 *
 * @since 7.5.0
 * @author Vaadin Ltd
 */
@FunctionalInterface
public interface ShouldWriteDataDelegate extends Serializable {

    /**
     * The default delegate implementation that assumes that all component data
     * is provided by a data provider connected to a back end system and that
     * the data should thus not be written.
     */
    public static final ShouldWriteDataDelegate DEFAULT = (
            Component component) -> false;

    /**
     * Determines whether the container data of a component should be written
     * out.
     *
     * @param component
     *            the component to check
     * @return true if container data should be written out for the
     *         provided component; otherwise false.
     */
    boolean shouldWriteData(Component component);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy