01: /*
02: * (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
03: * [See end of file]
04: */
05:
06: package com.hp.hpl.jena.rdf.arp.states.test;
07:
08: import org.xml.sax.Attributes;
09:
10: import com.hp.hpl.jena.rdf.arp.impl.Names;
11: import com.hp.hpl.jena.rdf.arp.states.FrameI;
12:
13: class AttrEvent extends Event {
14: final QName q;
15: final String value;
16:
17: public AttrEvent(QName qn) {
18: this (qn.localName.substring(0, 1), qn, "en");
19: }
20:
21: public AttrEvent(String oneChar, QName qn, String value) {
22: super (oneChar, qn.qName
23: + (value.equals("en") ? "" : "='" + value + "'"));
24: q = qn;
25: this .value = value;
26: }
27:
28: public boolean finalAttribute() {
29: return q.uri.equals(Names.rdfns);
30: }
31:
32: boolean isAttribute() {
33: return true;
34: }
35:
36: boolean isElement() {
37: return false;
38: }
39:
40: FrameI apply(FrameI from, Attributes att) {
41: throw new IllegalStateException("n/a");
42: }
43:
44: }
45:
46: /*
47: * (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
48: * All rights reserved.
49: *
50: * Redistribution and use in source and binary forms, with or without
51: * modification, are permitted provided that the following conditions
52: * are met:
53: * 1. Redistributions of source code must retain the above copyright
54: * notice, this list of conditions and the following disclaimer.
55: * 2. Redistributions in binary form must reproduce the above copyright
56: * notice, this list of conditions and the following disclaimer in the
57: * documentation and/or other materials provided with the distribution.
58: * 3. The name of the author may not be used to endorse or promote products
59: * derived from this software without specific prior written permission.
60: *
61: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
62: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
63: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
64: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
65: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
66: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
67: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
68: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
69: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
70: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
71: */
|