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

aQute.bnd.test.SimpleContext Maven / Gradle / Ivy

Go to download

The bndlib project is a general library to be used with OSGi bundles. It contains lots of cool functionality that calculates dependencies, etc.

There is a newer version: 2.4.0
Show newest version
package aQute.bnd.test;

import java.util.*;

import javax.xml.namespace.*;

public class SimpleContext implements NamespaceContext {
	final String	prefix;
	final String	ns;

	SimpleContext(String prefix, String ns) {
		this.prefix = prefix;
		this.ns = ns;
	}

	public String getNamespaceURI(String prefix) {
		if (prefix.equals(prefix))
			return ns;
		return null;
	}

	public String getPrefix(String namespaceURI) {
		if (namespaceURI.equals(ns))
			return prefix;
		return prefix;
	}

	public Iterator getPrefixes(String namespaceURI) {
		return Arrays.asList(prefix).iterator();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy