
com.dukescript.api.javafx.beans.FXBeanInfo Maven / Gradle / Ivy
package com.dukescript.api.javafx.beans;
/*-
* #%L
* DukeScript JavaFX Extensions - a library from the "DukeScript" project.
* %%
* Copyright (C) 2018 Dukehoff GmbH
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* #L%
*/
import com.dukescript.impl.javafx.beans.ConstantValue;
import com.dukescript.spi.javafx.beans.FXBeanInfoProvider;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.ServiceLoader;
import javafx.beans.property.ReadOnlyProperty;
import javafx.beans.value.ObservableValue;
import javafx.event.EventHandler;
/** Data with information about {@linkplain #getProperties() properties}
* and {@linkplain #getFunctions() actions} of a JavaFX bean. Beans supporting this
* protocol should implement {@link Provider} - use its {@link Provider#getFXBeanInfo()}
* method to obtain instance of the info for given bean.
*
* If you have a bean willing to provide the info, use {@link FXBeanInfo#create(java.lang.Object)}
* and {@link Builder} to create it. Then return it from your
* {@link Provider#getFXBeanInfo()} method.
*/
public final class FXBeanInfo {
private final Object bean;
private final Object extra;
private final Map> properties;
private final Map>> functions;
private FXBeanInfo(
Object bean,
Map> properties,
Map>> functions
) {
this.bean = bean;
this.properties = properties == null ? Collections.emptyMap() : Collections.unmodifiableMap(properties);
this.functions = functions == null ? Collections.emptyMap() : Collections.unmodifiableMap(functions);
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy