KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > xml > dom4j > o3impl > O3Namespace


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: O3Namespace.java,v 1.1 2003/11/02 18:10:03 per_nyfelt Exp $
8
package org.ozoneDB.xml.dom4j.o3impl;
9
10 import org.dom4j.DocumentFactory;
11 import org.dom4j.Element;
12 import org.dom4j.Namespace;
13 import org.ozoneDB.OzoneInterface;
14 import org.ozoneDB.OzoneRemoteException;
15
16 import java.io.Serializable JavaDoc;
17
18 /**
19  *
20  * @author Per Nyfelt
21  */

22 public class O3Namespace extends DefaultNamespace implements Serializable JavaDoc /*OzoneCompatible*/ {
23
24     final static long serialVersionUID = 1L;
25     //private static final String SEP = OPP.SIGNATURE_DELIMITER;
26

27     private transient OzoneInterface db;
28     //private OzoneObject ozoneObject;
29

30     private void init() {
31         //ozoneObject = new OzoneObject();
32
}
33
34     public O3Namespace(String JavaDoc prefix, String JavaDoc uri) {
35         super(prefix, uri);
36         init();
37     }
38
39     public static Namespace create(OzoneInterface db, String JavaDoc prefix, String JavaDoc uri) {
40 // System.out.println("[O3Namespace] Creating new object");
41
// final String signature = String.class.getName() + SEP + String.class.getName();
42
// return (OzoneNamespace) db.createObject(O3Namespace.class,
43
// signature,
44
// new Object[]{prefix, uri});
45
O3Namespace obj = new O3Namespace(prefix, uri);
46         obj.db = db;
47         return obj;
48     }
49
50     /** @param parent is the parent element
51      * @param prefix is the prefix for this namespace
52      * @param uri is the URI for this namespace
53      */

54     public O3Namespace(Element parent, String JavaDoc prefix, String JavaDoc uri) {
55         super(parent, prefix, uri);
56         init();
57     }
58
59     public static Namespace create(OzoneInterface db, Element parent, String JavaDoc prefix, String JavaDoc uri) {
60 // System.out.println("[O3Namespace] Creating new object");
61
// final String signature = Element.class.getName() + SEP
62
// + String.class.getName() + SEP
63
// + String.class.getName();
64
// return (OzoneNamespace) db.createObject(O3Namespace.class,
65
// signature,
66
// new Object[]{parent, prefix, uri});
67
O3Namespace obj = new O3Namespace(parent, prefix, uri);
68         obj.db = db;
69         return obj;
70     }
71
72     public DocumentFactory getDocumentFactory() {
73         throw new OzoneRemoteException("getDocumentFactory will not work in Ozone");
74     }
75
76 }
77
Popular Tags