aQute.bnd.test.SimpleContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bndlib Show documentation
Show all versions of bndlib Show documentation
The bndlib project is a general library to be used with OSGi bundles. It contains
lots of cool functionality that calculates dependencies, etc.
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();
}
}