View Javadoc

1   /*
2    * $Id: ParseType.java,v 1.3 2005/03/29 15:07:42 jlerner Exp $
3    *
4    * Copyright (c) 1999-2004, BBN Technologies, LLC.
5    * All rights reserved.
6    * http://www.daml.org/legal/opensource/bbn_license.html
7    */
8   
9   package com.bbn.swede.core.dom.rdf;
10  
11  import java.util.Iterator;
12  
13  import com.bbn.swede.core.dom.AttributeNode;
14  import com.bbn.swede.core.dom.OASTNode;
15  import com.hp.hpl.jena.rdf.model.Model;
16  import com.hp.hpl.jena.rdf.model.RDFList;
17  
18  /***
19   * Custom attribute node implementation for rdf:parseType.
20   * @author jlerner
21   */
22  public class ParseType extends AttributeNode
23  {
24     private RDFList _list;
25     /***
26      * Creates a ParseType node.
27      * @param sValue The value of the attribute.
28      */
29     public ParseType(String sValue)
30     {
31        super(sValue);
32     }
33  
34     /* (non-Javadoc)
35      * @see com.bbn.swede.core.dom.OASTNode#getNodeType()
36      */
37     public int getNodeType()
38     {
39        return OASTNode.RDF_PARSETYPE;
40     }
41  
42     /***
43      * Creates and returns an RDFList resource representing a sequence of
44      * RDF nodes.
45      * @param model Model in which to create the list
46      * @param it An iterator into the sequence of nodes to place in the list
47      * @return A new RDF list containing the specified nodes, or
48      *         <code>null</code> if the list could not be created.
49      */
50     public RDFList createList(Model model, Iterator it)
51     {
52        if (!_sValue.equals("Collection"))
53        {
54           return null;
55        }
56        return model.createList(it);
57     }
58  
59  }