01: /*
02: (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
03: All rights reserved - see end of file.
04: $Id: NoImplementationException.java,v 1.6 2008/01/02 12:07:38 andy_seaborne Exp $
05: */
06:
07: package com.hp.hpl.jena.assembler.exceptions;
08:
09: import com.hp.hpl.jena.assembler.Assembler;
10: import com.hp.hpl.jena.rdf.model.Resource;
11:
12: public class NoImplementationException extends AssemblerException {
13: final Resource type;
14: final Assembler assembler;
15:
16: public NoImplementationException(Assembler assembler,
17: Resource root, Resource type) {
18: super (root, messageFor(assembler, root, type));
19: this .type = type;
20: this .assembler = assembler;
21: }
22:
23: private static String messageFor(Assembler a, Resource root,
24: Resource type) {
25: return "the (group) Assembler "
26: + a
27: + " cannot construct the object "
28: + nice(root)
29: + " because it does not have an implementation for the objects's most specific type "
30: + nice(type);
31: }
32:
33: public Resource getType() {
34: return type;
35: }
36:
37: public Assembler getAssembler() {
38: return assembler;
39: }
40: }
41:
42: /*
43: * (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
44: * All rights reserved.
45: *
46: * Redistribution and use in source and binary forms, with or without
47: * modification, are permitted provided that the following conditions
48: * are met:
49: * 1. Redistributions of source code must retain the above copyright
50: * notice, this list of conditions and the following disclaimer.
51: * 2. Redistributions in binary form must reproduce the above copyright
52: * notice, this list of conditions and the following disclaimer in the
53: * documentation and/or other materials provided with the distribution.
54: * 3. The name of the author may not be used to endorse or promote products
55: * derived from this software without specific prior written permission.
56: *
57: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
58: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
59: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
60: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
61: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
62: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
63: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
64: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
66: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67: */
|