blob: 9a4146c31cb588ba229b747087d3c15a1a9828a0 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*/
package org.eclipse.osbp.ecview.core.common.validation;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.osbp.runtime.common.dispose.AbstractDisposable;
import org.eclipse.osbp.runtime.common.validation.IStatus;
public abstract class AbstractCollectingValidator extends AbstractDisposable
implements IValidator {
protected Set<IStatus> currentStatus = new HashSet<IStatus>();
@Override
public Set<IStatus> getCurrentStatus() {
return currentStatus;
}
protected void resetCurrentStatus() {
currentStatus.clear();
}
protected void addCurrentStatus(IStatus status) {
currentStatus.add(status);
}
protected void addCurrentStatus(Set<IStatus> status) {
currentStatus.addAll(status);
}
protected void internalDispose() {
currentStatus.clear();
currentStatus = null;
}
}