1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Nov 2017
4 */
5 /*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21 /*
22 * $Id: DTMNodeProxy.java,v
23 */
44 import org.w3c.dom.NamedNodeMap;
45 import org.w3c.dom.Node;
46 import org.w3c.dom.NodeList;
47 import org.w3c.dom.ProcessingInstruction;
48 import org.w3c.dom.Text;
49 import org.w3c.dom.TypeInfo;
50 import org.w3c.dom.UserDataHandler;
51
52 /**
53 * <code>DTMNodeProxy</code> presents a DOM Node API front-end to the DTM model.
54 * <p>
55 * It does _not_ attempt to address the "node identity" question; no effort
56 * is made to prevent the creation of multiple proxies referring to a single
57 * DTM node. Users can create a mechanism for managing this, or relinquish the
58 * use of "==" and use the .sameNodeAs() mechanism, which is under
59 * consideration for future versions of the DOM.
60 * <p>
61 * DTMNodeProxy may be subclassed further to present specific DOM node types.
62 *
63 * @see org.w3c.dom
64 */
65 public class DTMNodeProxy
66 implements Node, Document, Text, Element, Attr,
67 ProcessingInstruction, Comment, DocumentFragment
68 {
69
70 /** The DTM for this node. */
71 public DTM dtm;
72
73 /** The DTM node handle. */
74 int node;
75
76 /** The return value as Empty String. */
77 private static final String EMPTYSTRING = "";
78
79 /** The DOMImplementation object */
80 static final DOMImplementation implementation=new DTMNodeProxyImplementation();
81
82 /**
83 * Create a DTMNodeProxy Node representing a specific Node in a DTM
|
1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 */
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements. See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 /*
21 * $Id: DTMNodeProxy.java,v
22 */
43 import org.w3c.dom.NamedNodeMap;
44 import org.w3c.dom.Node;
45 import org.w3c.dom.NodeList;
46 import org.w3c.dom.ProcessingInstruction;
47 import org.w3c.dom.Text;
48 import org.w3c.dom.TypeInfo;
49 import org.w3c.dom.UserDataHandler;
50
51 /**
52 * <code>DTMNodeProxy</code> presents a DOM Node API front-end to the DTM model.
53 * <p>
54 * It does _not_ attempt to address the "node identity" question; no effort
55 * is made to prevent the creation of multiple proxies referring to a single
56 * DTM node. Users can create a mechanism for managing this, or relinquish the
57 * use of "==" and use the .sameNodeAs() mechanism, which is under
58 * consideration for future versions of the DOM.
59 * <p>
60 * DTMNodeProxy may be subclassed further to present specific DOM node types.
61 *
62 * @see org.w3c.dom
63 * @LastModified: Nov 2017
64 */
65 public class DTMNodeProxy
66 implements Node, Document, Text, Element, Attr,
67 ProcessingInstruction, Comment, DocumentFragment
68 {
69
70 /** The DTM for this node. */
71 public DTM dtm;
72
73 /** The DTM node handle. */
74 int node;
75
76 /** The return value as Empty String. */
77 private static final String EMPTYSTRING = "";
78
79 /** The DOMImplementation object */
80 static final DOMImplementation implementation=new DTMNodeProxyImplementation();
81
82 /**
83 * Create a DTMNodeProxy Node representing a specific Node in a DTM
|