KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > rdf > model > impl > MakerCreator


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: MakerCreator.java,v 1.7 2005/04/10 12:45:49 chris-dollin Exp $
5 */

6
7 package com.hp.hpl.jena.rdf.model.impl;
8
9 import com.hp.hpl.jena.rdf.model.*;
10 import com.hp.hpl.jena.shared.ReificationStyle;
11 import com.hp.hpl.jena.vocabulary.JenaModelSpec;
12
13 /**
14     Convenience superclass for the standard ModelMakerCreator classes,
15     with the method for extracting the Reifier style from a description.
16     
17     @author hedgehog
18 */

19 class MakerCreator
20     {
21     /**
22         Answer the reification style possessed by <code>root</code> in
23         <code>desc</code> under the property <code>JenaModelSpec.reificationMode</code>.
24         If no such property exists, default to <code>Standard</code>.
25         
26         @param desc the model in which to search
27         @param root the entity which may have the property
28         @return the reification style given by the property, or Standard if none
29      */

30     public ReificationStyle style( Model desc, Resource root )
31         {
32         Statement st = desc.getProperty( root, JenaModelSpec.reificationMode );
33         return st == null ? ReificationStyle.Standard : JenaModelSpec.findStyle( st.getObject() );
34         }
35     }
36
37 /*
38     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
39     All rights reserved.
40
41     Redistribution and use in source and binary forms, with or without
42     modification, are permitted provided that the following conditions
43     are met:
44
45     1. Redistributions of source code must retain the above copyright
46        notice, this list of conditions and the following disclaimer.
47
48     2. Redistributions in binary form must reproduce the above copyright
49        notice, this list of conditions and the following disclaimer in the
50        documentation and/or other materials provided with the distribution.
51
52     3. The name of the author may not be used to endorse or promote products
53        derived from this software without specific prior written permission.
54
55     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
56     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
57     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
58     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
59     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
60     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
64     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 */
Popular Tags