org.datafx.controller.validation.ui.ViolationMapper Maven / Gradle / Ivy
package org.datafx.controller.validation.ui;
import javafx.beans.property.*;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javax.validation.ConstraintViolation;
import java.util.List;
public class ViolationMapper {
private ReadOnlyStringWrapper path;
private ObservableList> violations;
private ReadOnlyBooleanWrapper useSubPaths;
public ViolationMapper(String path, boolean useSubPaths) {
this.path = new ReadOnlyStringWrapper(path);
this.useSubPaths = new ReadOnlyBooleanWrapper(useSubPaths);
violations = FXCollections.observableArrayList();
}
public ObservableList> getViolations() {
return violations;
}
public String path() {
return pathProperty().get();
}
public ReadOnlyStringProperty pathProperty() {
return path.getReadOnlyProperty();
}
public boolean getUseSubPaths() {
return useSubPathsProperty().get();
}
public ReadOnlyBooleanProperty useSubPathsProperty() {
return useSubPaths.getReadOnlyProperty();
}
public void reset() {
violations.clear();
}
public void setViolations(List> matchingViolations) {
violations.setAll(matchingViolations);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy