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

pl.fhframework.binding.CompiledIndexedModelBinding Maven / Gradle / Ivy

package pl.fhframework.binding;

import com.fasterxml.jackson.annotation.JsonIgnoreType;
import lombok.Getter;
import pl.fhframework.core.forms.iterators.IIndexedBindingOwner;
import pl.fhframework.core.forms.iterators.IRepeatableIteratorInfo;
import pl.fhframework.core.util.StringUtils;
import pl.fhframework.BindingResult;
import pl.fhframework.model.forms.Component;
import pl.fhframework.model.forms.Form;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Compiled indexed model binding.
 */
@JsonIgnoreType
@Getter
public class CompiledIndexedModelBinding extends IndexedModelBinding {

    private Function getter;

    public CompiledIndexedModelBinding(String bindingExpression, Function getter) {
        super(bindingExpression);
        this.getter = getter;
    }

    @Override
    public T getValue(int[] indices) {
        return this.getter.apply(indices);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy