View Javadoc

1   /*
2    wsmo4j - a WSMO API and Reference Implementation
3    Copyright (c) 2005, University of Innsbruck, Austria
4    This library is free software; you can redistribute it and/or modify it under
5    the terms of the GNU Lesser General Public License as published by the Free
6    Software Foundation; either version 2.1 of the License, or (at your option)
7    any later version.
8    This library is distributed in the hope that it will be useful, but WITHOUT
9    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11   details.
12   You should have received a copy of the GNU Lesser General Public License along
13   with this library; if not, write to the Free Software Foundation, Inc.,
14   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15   */
16  package org.deri.wsmo4j.io.parser.rdf;
17  
18  import java.util.*;
19  
20  import org.openrdf.rio.*;
21  
22  /**
23   * Implementation of an interface defining methods 
24   * for receiving namespace declarations from an RDF parser.
25   *
26   * <pre>
27   *  Created on May 02, 2006
28   *  Committed by $Author: morcen $
29   *  $Source$
30   * </pre>
31   *
32   * @author nathalie.steinmetz@deri.org
33   * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
34   */
35  public class RDFNamespaceListener implements NamespaceListener{
36  
37      private HashMap <String, String> namespaces = null;
38      
39      public RDFNamespaceListener(HashMap <String, String> namespaces) {
40          this.namespaces = namespaces;
41      }
42      
43      /**
44       * The namespace listener adds all the namespaces to a HashMap.
45       * The prefix is the entry's key, the uri is the value.
46       *
47       * @param prefix the namespace's prefix
48       * @param uri the namespace's uri
49       */
50      public void handleNamespace(String prefix, String uri) {
51          namespaces.put(prefix, uri);
52      }
53  
54  }
55  /*
56   * $Log$
57   * Revision 1.3  2007/04/02 12:13:23  morcen
58   * Generics support added to wsmo-api, wsmo4j and wsmo-test
59   *
60   * Revision 1.2  2006/05/15 07:58:12  holgerlausen
61   * corrected issues with namespaces and ontology ids
62   *
63   * Revision 1.1  2006/05/03 13:32:49  nathaliest
64   * adding RDF parser
65   *
66   * 
67   */