corpus-services  1.0
SimpleNameSpaceContext.java
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 package de.uni_hamburg.corpora.utilities;
7 
8 import java.util.HashMap;
9 import java.util.Iterator;
10 import java.util.Map;
11 import javax.xml.namespace.NamespaceContext;
12 
13 public class SimpleNameSpaceContext implements NamespaceContext {
14 
15  private final Map<String, String> PREF_MAP = new HashMap<String, String>();
16 
17  public SimpleNameSpaceContext(final Map<String, String> prefMap) {
18  PREF_MAP.putAll(prefMap);
19  }
20 
21  public String getNamespaceURI(String prefix) {
22  return PREF_MAP.get(prefix);
23  }
24 
25  public String getPrefix(String uri) {
26  throw new UnsupportedOperationException();
27  }
28 
29  public Iterator getPrefixes(String uri) {
30  throw new UnsupportedOperationException();
31  }
32 
33 }