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

org.bndtools.builder.BndFileModel Maven / Gradle / Ivy

package org.bndtools.builder;

import java.util.Collection;
import java.util.Set;
import java.util.regex.Matcher;

import org.eclipse.core.runtime.IPath;

import aQute.bnd.osgi.Instruction;

public class BndFileModel {

	private final IPath					path;
	private IPath						targetPath;
	private Set			includes;
	private Collection	classpath;

	public BndFileModel(IPath path) {
		this.path = path;
	}

	public IPath getTargetPath() {
		return targetPath;
	}

	public void setTargetPath(IPath targetPath) {
		this.targetPath = targetPath;
	}

	public IPath getPath() {
		return path;
	}

	public void setIncludes(Set includes) {
		this.includes = includes;
	}

	public boolean containsPackage(String packageName) {
		for (Instruction instruction : includes) {
			Matcher matcher = instruction.getMatcher(packageName);

			if (matcher.matches())
				return true;
		}
		return false;
	}

	public boolean containsAny(Collection affectedPackages) {
		for (Instruction instruction : includes) {
			for (String pkg : affectedPackages) {
				Matcher matcher = instruction.getMatcher(pkg);

				if (matcher.matches())
					return true;
			}
		}
		return false;
	}

	public Collection getClasspath() {
		return classpath;
	}

	public void setClasspath(Collection classpath) {
		this.classpath = classpath;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy