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

net.sf.nakeduml.validation.AbstractValidator Maven / Gradle / Ivy

The newest version!
package net.sf.nakeduml.validation;

import java.util.Collection;

import net.sf.nakeduml.feature.NakedUmlConfig;
import net.sf.nakeduml.feature.TransformationStep;
import net.sf.nakeduml.feature.visit.VisitBefore;
import net.sf.nakeduml.feature.visit.VisitorAdapter;
import net.sf.nakeduml.metamodel.core.INakedElement;
import net.sf.nakeduml.metamodel.core.INakedPackage;
import net.sf.nakeduml.metamodel.models.INakedModel;
import net.sf.nakeduml.metamodel.validation.ErrorMap;
import net.sf.nakeduml.metamodel.workspace.INakedModelWorkspace;

public abstract class AbstractValidator extends VisitorAdapter implements TransformationStep {
	protected INakedModelWorkspace workspace;
	protected NakedUmlConfig config;

	@Override
	public Collection getChildren(INakedElement root) {
		return root.getOwnedElements();
	}

	public void initialize(INakedModelWorkspace workspace, NakedUmlConfig config) {
		this.workspace = workspace;
		this.config = config;
	}

	protected ErrorMap getErrorMap() {
		return workspace.getErrorMap();
	}

	@VisitBefore(matchSubclasses = true)
	public void remove(INakedModel e) {
		workspace.removeOwnedElement(e);
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy