jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java
author aefimov
Fri, 29 May 2015 12:28:40 +0300
changeset 30989 1f747213d6c9
parent 25868 686eef1e7a79
child 44797 8b3b3b911b8a
permissions -rw-r--r--
8081392: getNodeValue should return 'null' value for Element nodes Reviewed-by: joehw
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 1999-2004 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *     http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * $Id: DTMNodeProxy.java,v
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
package com.sun.org.apache.xml.internal.dtm.ref;
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
import java.util.Vector;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
import com.sun.org.apache.xml.internal.dtm.DTM;
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import com.sun.org.apache.xml.internal.dtm.DTMDOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
import com.sun.org.apache.xpath.internal.NodeSet;
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
    30
import java.util.Objects;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import org.w3c.dom.Attr;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import org.w3c.dom.CDATASection;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
import org.w3c.dom.Comment;
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
import org.w3c.dom.DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
import org.w3c.dom.DOMImplementation;
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
import org.w3c.dom.Document;
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
import org.w3c.dom.DocumentFragment;
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
import org.w3c.dom.DocumentType;
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
import org.w3c.dom.Element;
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
import org.w3c.dom.EntityReference;
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
import org.w3c.dom.NamedNodeMap;
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
import org.w3c.dom.Node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
import org.w3c.dom.NodeList;
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
import org.w3c.dom.ProcessingInstruction;
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
import org.w3c.dom.Text;
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
import org.w3c.dom.UserDataHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
import org.w3c.dom.DOMConfiguration;
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
import org.w3c.dom.TypeInfo;
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * <code>DTMNodeProxy</code> presents a DOM Node API front-end to the DTM model.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * It does _not_ attempt to address the "node identity" question; no effort
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * is made to prevent the creation of multiple proxies referring to a single
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * DTM node. Users can create a mechanism for managing this, or relinquish the
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 * use of "==" and use the .sameNodeAs() mechanism, which is under
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 * consideration for future versions of the DOM.
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 * DTMNodeProxy may be subclassed further to present specific DOM node types.
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 * @see org.w3c.dom
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
public class DTMNodeProxy
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
  implements Node, Document, Text, Element, Attr,
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
                   ProcessingInstruction, Comment, DocumentFragment
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
  /** The DTM for this node. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
  public DTM dtm;
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
  /** The DTM node handle. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
  int node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
  /** The return value as Empty String. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
  private static final String EMPTYSTRING = "";
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
  /** The DOMImplementation object */
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
  static final DOMImplementation implementation=new DTMNodeProxyImplementation();
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
   * Create a DTMNodeProxy Node representing a specific Node in a DTM
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
   * @param dtm The DTM Reference, must be non-null.
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
   * @param node The DTM node handle.
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
  public DTMNodeProxy(DTM dtm, int node)
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
    this.dtm = dtm;
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
    this.node = node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
   * NON-DOM: Return the DTM model
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
   * @return The DTM that this proxy is a representative for.
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
  public final DTM getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
    return dtm;
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
   * NON-DOM: Return the DTM node number
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
   * @return The DTM node handle.
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
  public final int getDTMNodeNumber()
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
    return node;
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
   * Test for equality based on node number.
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
   * @param node A DTM node proxy reference.
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
   * @return true if the given node has the same handle as this node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
  public final boolean equals(Node node)
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
    try
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
      DTMNodeProxy dtmp = (DTMNodeProxy) node;
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
      // return (dtmp.node == this.node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
      // Patch attributed to Gary L Peskin <garyp@firstech.com>
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
      return (dtmp.node == this.node) && (dtmp.dtm == this.dtm);
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
    catch (ClassCastException cce)
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
      return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
   * Test for equality based on node number.
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
   * @param node A DTM node proxy reference.
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
   * @return true if the given node has the same handle as this node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   145
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
  public final boolean equals(Object node)
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
      // DTMNodeProxy dtmp = (DTMNodeProxy)node;
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
      // return (dtmp.node == this.node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
      // Patch attributed to Gary L Peskin <garyp@firstech.com>
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   151
      return node instanceof Node && equals((Node) node);
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   152
  }
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   153
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   154
  @Override
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   155
  public int hashCode() {
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   156
      int hash = 7;
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   157
      hash = 29 * hash + Objects.hashCode(this.dtm);
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   158
      hash = 29 * hash + this.node;
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   159
      return hash;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
   * FUTURE DOM: Test node identity, in lieu of Node==Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
   * @param other
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
   * @return true if the given node has the same handle as this node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
  public final boolean sameNodeAs(Node other)
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
    if (!(other instanceof DTMNodeProxy))
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
      return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
    DTMNodeProxy that = (DTMNodeProxy) other;
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
    return this.dtm == that.dtm && this.node == that.node;
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   185
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
  public final String getNodeName()
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
    return dtm.getNodeName(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
   * A PI's "target" states what processor channel the PI's data
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
   * should be directed to. It is defined differently in HTML and XML.
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
   * In XML, a PI's "target" is the first (whitespace-delimited) token
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
   * following the "<?" token that begins the PI.
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
   * In HTML, target is always null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
   * Note that getNodeName is aliased to getTarget.
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   204
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
  public final String getTarget()
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
    return dtm.getNodeName(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
  }  // getTarget():String
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
   * @see org.w3c.dom.Node as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   215
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
  public final String getLocalName()
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
    return dtm.getLocalName(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
   * @return The prefix for this node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
   * @see org.w3c.dom.Node as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   225
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
  public final String getPrefix()
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
    return dtm.getPrefix(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
   * @param prefix
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
   * @see org.w3c.dom.Node as of DOM Level 2 -- DTMNodeProxy is read-only
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   238
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
  public final void setPrefix(String prefix) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
   * @see org.w3c.dom.Node as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   249
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
  public final String getNamespaceURI()
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
    return dtm.getNamespaceURI(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
  /** Ask whether we support a given DOM feature.
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
   * In fact, we do not _fully_ support any DOM feature -- we're a
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
   * read-only subset -- so arguably we should always return false.
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
   * Or we could say that we support DOM Core Level 2 but all nodes
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
   * are read-only. Unclear which answer is least misleading.
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
   * NON-DOM method. This was present in early drafts of DOM Level 2,
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
   * but was renamed isSupported. It's present here only because it's
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
   * cheap, harmless, and might help some poor fool who is still trying
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
   * to use an early Working Draft of the DOM.
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
   * @param feature
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
   * @param version
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
   * @return false
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
  public final boolean supports(String feature, String version)
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
    return implementation.hasFeature(feature,version);
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
    //throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
  /** Ask whether we support a given DOM feature.
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
   * In fact, we do not _fully_ support any DOM feature -- we're a
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
   * read-only subset -- so arguably we should always return false.
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
   * @param feature
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
   * @param version
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
   * @return false
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
   * @see org.w3c.dom.Node as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   287
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
  public final boolean isSupported(String feature, String version)
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
    return implementation.hasFeature(feature,version);
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
    // throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   301
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
  public final String getNodeValue() throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
    return dtm.getNodeValue(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
   * @return The string value of the node
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
  public final String getStringValue() throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
        return dtm.getStringValue(node).toString();
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
   * @param nodeValue
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   324
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
  public final void setNodeValue(String nodeValue) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   335
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
  public final short getNodeType()
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
    return (short) dtm.getNodeType(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   346
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
  public final Node getParentNode()
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
    if (getNodeType() == Node.ATTRIBUTE_NODE)
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
    int newnode = dtm.getParent(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
    return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
  public final Node getOwnerNode()
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
    int newnode = dtm.getParent(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
    return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   376
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
  public final NodeList getChildNodes()
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
    // Annoyingly, AxisIterators do not currently implement DTMIterator, so
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
    // we can't just wap DTMNodeList around an Axis.CHILD iterator.
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
    // Instead, we've created a special-case operating mode for that object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
    return new DTMChildIterNodeList(dtm,node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
    // throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   393
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
  public final Node getFirstChild()
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
    int newnode = dtm.getFirstChild(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
    return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   407
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
  public final Node getLastChild()
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
    int newnode = dtm.getLastChild(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
    return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   421
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
  public final Node getPreviousSibling()
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
    int newnode = dtm.getPreviousSibling(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
    return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   435
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
  public final Node getNextSibling()
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
    // Attr's Next is defined at DTM level, but not at DOM level.
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
    if (dtm.getNodeType(node) == Node.ATTRIBUTE_NODE)
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
    int newnode = dtm.getNextSibling(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   444
7f561c08de6b Initial load
duke
parents:
diff changeset
   445
    return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   446
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   447
7f561c08de6b Initial load
duke
parents:
diff changeset
   448
  // DTMNamedNodeMap m_attrs;
7f561c08de6b Initial load
duke
parents:
diff changeset
   449
7f561c08de6b Initial load
duke
parents:
diff changeset
   450
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   451
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   452
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   453
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   454
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   455
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   456
  public final NamedNodeMap getAttributes()
7f561c08de6b Initial load
duke
parents:
diff changeset
   457
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   458
7f561c08de6b Initial load
duke
parents:
diff changeset
   459
    return new DTMNamedNodeMap(dtm, node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   460
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   461
7f561c08de6b Initial load
duke
parents:
diff changeset
   462
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   463
   * Method hasAttribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   464
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   465
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   466
   * @param name
7f561c08de6b Initial load
duke
parents:
diff changeset
   467
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   468
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   469
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   470
  public boolean hasAttribute(String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
   471
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   472
    return DTM.NULL != dtm.getAttributeNode(node,null,name);
7f561c08de6b Initial load
duke
parents:
diff changeset
   473
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   474
7f561c08de6b Initial load
duke
parents:
diff changeset
   475
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   476
   * Method hasAttributeNS
7f561c08de6b Initial load
duke
parents:
diff changeset
   477
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   478
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   479
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
   480
   * @param localName
7f561c08de6b Initial load
duke
parents:
diff changeset
   481
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   482
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   483
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   484
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   485
  public boolean hasAttributeNS(String namespaceURI, String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   486
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   487
    return DTM.NULL != dtm.getAttributeNode(node,namespaceURI,localName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   488
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   489
7f561c08de6b Initial load
duke
parents:
diff changeset
   490
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   491
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   492
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   493
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   494
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   495
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   496
  public final Document getOwnerDocument()
7f561c08de6b Initial load
duke
parents:
diff changeset
   497
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   498
        // Note that this uses the DOM-compatable version of the call
7f561c08de6b Initial load
duke
parents:
diff changeset
   499
        return (Document)(dtm.getNode(dtm.getOwnerDocument(node)));
7f561c08de6b Initial load
duke
parents:
diff changeset
   500
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   501
7f561c08de6b Initial load
duke
parents:
diff changeset
   502
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   503
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   504
   * @param newChild
7f561c08de6b Initial load
duke
parents:
diff changeset
   505
   * @param refChild
7f561c08de6b Initial load
duke
parents:
diff changeset
   506
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   507
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   508
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   509
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   510
   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
7f561c08de6b Initial load
duke
parents:
diff changeset
   511
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   512
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   513
  public final Node insertBefore(Node newChild, Node refChild)
7f561c08de6b Initial load
duke
parents:
diff changeset
   514
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   515
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   516
    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   517
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   518
7f561c08de6b Initial load
duke
parents:
diff changeset
   519
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   520
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   521
   * @param newChild
7f561c08de6b Initial load
duke
parents:
diff changeset
   522
   * @param oldChild
7f561c08de6b Initial load
duke
parents:
diff changeset
   523
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   524
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   525
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   526
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   527
   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
7f561c08de6b Initial load
duke
parents:
diff changeset
   528
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   529
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   530
  public final Node replaceChild(Node newChild, Node oldChild)
7f561c08de6b Initial load
duke
parents:
diff changeset
   531
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   532
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   533
    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   534
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   535
7f561c08de6b Initial load
duke
parents:
diff changeset
   536
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   537
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   538
   * @param oldChild
7f561c08de6b Initial load
duke
parents:
diff changeset
   539
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   540
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   541
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   542
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   543
   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
7f561c08de6b Initial load
duke
parents:
diff changeset
   544
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   545
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   546
  public final Node removeChild(Node oldChild) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   547
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   548
    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   549
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   550
7f561c08de6b Initial load
duke
parents:
diff changeset
   551
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   552
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   553
   * @param newChild
7f561c08de6b Initial load
duke
parents:
diff changeset
   554
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   555
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   556
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   557
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   558
   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
7f561c08de6b Initial load
duke
parents:
diff changeset
   559
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   560
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   561
  public final Node appendChild(Node newChild) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   562
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   563
    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   564
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   565
7f561c08de6b Initial load
duke
parents:
diff changeset
   566
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   567
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   568
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   569
   * @see org.w3c.dom.Node
7f561c08de6b Initial load
duke
parents:
diff changeset
   570
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   571
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   572
  public final boolean hasChildNodes()
7f561c08de6b Initial load
duke
parents:
diff changeset
   573
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   574
    return (DTM.NULL != dtm.getFirstChild(node));
7f561c08de6b Initial load
duke
parents:
diff changeset
   575
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   576
7f561c08de6b Initial load
duke
parents:
diff changeset
   577
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   578
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   579
   * @param deep
7f561c08de6b Initial load
duke
parents:
diff changeset
   580
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   581
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   582
   * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
7f561c08de6b Initial load
duke
parents:
diff changeset
   583
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   584
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   585
  public final Node cloneNode(boolean deep)
7f561c08de6b Initial load
duke
parents:
diff changeset
   586
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   587
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   588
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   589
7f561c08de6b Initial load
duke
parents:
diff changeset
   590
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   591
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   592
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   593
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   594
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   595
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   596
  public final DocumentType getDoctype()
7f561c08de6b Initial load
duke
parents:
diff changeset
   597
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   598
    return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   599
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   600
7f561c08de6b Initial load
duke
parents:
diff changeset
   601
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   602
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   603
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   604
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   605
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   606
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   607
  public final DOMImplementation getImplementation()
7f561c08de6b Initial load
duke
parents:
diff changeset
   608
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   609
    return implementation;
7f561c08de6b Initial load
duke
parents:
diff changeset
   610
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   611
7f561c08de6b Initial load
duke
parents:
diff changeset
   612
  /** This is a bit of a problem in DTM, since a DTM may be a Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   613
   * Fragment and hence not have a clear-cut Document Element. We can
7f561c08de6b Initial load
duke
parents:
diff changeset
   614
   * make it work in the well-formed cases but would that be confusing for others?
7f561c08de6b Initial load
duke
parents:
diff changeset
   615
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   616
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   617
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   618
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   619
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   620
  public final Element getDocumentElement()
7f561c08de6b Initial load
duke
parents:
diff changeset
   621
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   622
                int dochandle=dtm.getDocument();
7f561c08de6b Initial load
duke
parents:
diff changeset
   623
                int elementhandle=DTM.NULL;
7f561c08de6b Initial load
duke
parents:
diff changeset
   624
                for(int kidhandle=dtm.getFirstChild(dochandle);
7f561c08de6b Initial load
duke
parents:
diff changeset
   625
                                kidhandle!=DTM.NULL;
7f561c08de6b Initial load
duke
parents:
diff changeset
   626
                                kidhandle=dtm.getNextSibling(kidhandle))
7f561c08de6b Initial load
duke
parents:
diff changeset
   627
                {
7f561c08de6b Initial load
duke
parents:
diff changeset
   628
                        switch(dtm.getNodeType(kidhandle))
7f561c08de6b Initial load
duke
parents:
diff changeset
   629
                        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   630
                        case Node.ELEMENT_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
   631
                                if(elementhandle!=DTM.NULL)
7f561c08de6b Initial load
duke
parents:
diff changeset
   632
                                {
7f561c08de6b Initial load
duke
parents:
diff changeset
   633
                                        elementhandle=DTM.NULL; // More than one; ill-formed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   634
                                        kidhandle=dtm.getLastChild(dochandle); // End loop
7f561c08de6b Initial load
duke
parents:
diff changeset
   635
                                }
7f561c08de6b Initial load
duke
parents:
diff changeset
   636
                                else
7f561c08de6b Initial load
duke
parents:
diff changeset
   637
                                        elementhandle=kidhandle;
7f561c08de6b Initial load
duke
parents:
diff changeset
   638
                                break;
7f561c08de6b Initial load
duke
parents:
diff changeset
   639
7f561c08de6b Initial load
duke
parents:
diff changeset
   640
                        // These are harmless; document is still wellformed
7f561c08de6b Initial load
duke
parents:
diff changeset
   641
                        case Node.COMMENT_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
   642
                        case Node.PROCESSING_INSTRUCTION_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
   643
                        case Node.DOCUMENT_TYPE_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
   644
                                break;
7f561c08de6b Initial load
duke
parents:
diff changeset
   645
7f561c08de6b Initial load
duke
parents:
diff changeset
   646
                        default:
7f561c08de6b Initial load
duke
parents:
diff changeset
   647
                                elementhandle=DTM.NULL; // ill-formed
7f561c08de6b Initial load
duke
parents:
diff changeset
   648
                                kidhandle=dtm.getLastChild(dochandle); // End loop
7f561c08de6b Initial load
duke
parents:
diff changeset
   649
                                break;
7f561c08de6b Initial load
duke
parents:
diff changeset
   650
                        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   651
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
   652
                if(elementhandle==DTM.NULL)
7f561c08de6b Initial load
duke
parents:
diff changeset
   653
                        throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   654
                else
7f561c08de6b Initial load
duke
parents:
diff changeset
   655
                        return (Element)(dtm.getNode(elementhandle));
7f561c08de6b Initial load
duke
parents:
diff changeset
   656
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   657
7f561c08de6b Initial load
duke
parents:
diff changeset
   658
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   659
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   660
   * @param tagName
7f561c08de6b Initial load
duke
parents:
diff changeset
   661
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   662
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   663
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   664
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   665
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   666
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   667
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   668
  public final Element createElement(String tagName) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   669
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   670
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   671
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   672
7f561c08de6b Initial load
duke
parents:
diff changeset
   673
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   674
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   675
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   676
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   677
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   678
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   679
  public final DocumentFragment createDocumentFragment()
7f561c08de6b Initial load
duke
parents:
diff changeset
   680
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   681
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   682
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   683
7f561c08de6b Initial load
duke
parents:
diff changeset
   684
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   685
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   686
   * @param data
7f561c08de6b Initial load
duke
parents:
diff changeset
   687
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   688
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   689
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   690
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   691
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   692
  public final Text createTextNode(String data)
7f561c08de6b Initial load
duke
parents:
diff changeset
   693
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   694
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   695
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   696
7f561c08de6b Initial load
duke
parents:
diff changeset
   697
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   698
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   699
   * @param data
7f561c08de6b Initial load
duke
parents:
diff changeset
   700
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   701
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   702
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   703
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   704
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   705
  public final Comment createComment(String data)
7f561c08de6b Initial load
duke
parents:
diff changeset
   706
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   707
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   708
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   709
7f561c08de6b Initial load
duke
parents:
diff changeset
   710
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   711
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   712
   * @param data
7f561c08de6b Initial load
duke
parents:
diff changeset
   713
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   714
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   715
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   716
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   717
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   718
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   719
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   720
  public final CDATASection createCDATASection(String data)
7f561c08de6b Initial load
duke
parents:
diff changeset
   721
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   722
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   723
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   724
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   725
7f561c08de6b Initial load
duke
parents:
diff changeset
   726
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   727
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   728
   * @param target
7f561c08de6b Initial load
duke
parents:
diff changeset
   729
   * @param data
7f561c08de6b Initial load
duke
parents:
diff changeset
   730
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   731
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   732
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   733
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   734
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   735
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   736
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   737
  public final ProcessingInstruction createProcessingInstruction(
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   738
                                String target, String data) throws DOMException
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   739
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   740
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   741
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   742
7f561c08de6b Initial load
duke
parents:
diff changeset
   743
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   744
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   745
   * @param name
7f561c08de6b Initial load
duke
parents:
diff changeset
   746
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   747
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   748
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   749
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   750
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   751
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   752
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   753
  public final Attr createAttribute(String name) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   754
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   755
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   756
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   757
7f561c08de6b Initial load
duke
parents:
diff changeset
   758
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   759
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   760
   * @param name
7f561c08de6b Initial load
duke
parents:
diff changeset
   761
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   762
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   763
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   764
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   765
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   766
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   767
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   768
  public final EntityReference createEntityReference(String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
   769
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   770
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   771
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   772
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   773
 /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   774
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   775
   * @param tagname
7f561c08de6b Initial load
duke
parents:
diff changeset
   776
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   777
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   778
   * @see org.w3c.dom.Document
7f561c08de6b Initial load
duke
parents:
diff changeset
   779
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   780
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   781
  public final NodeList getElementsByTagName(String tagname)
7f561c08de6b Initial load
duke
parents:
diff changeset
   782
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   783
       Vector listVector = new Vector();
7f561c08de6b Initial load
duke
parents:
diff changeset
   784
       Node retNode = dtm.getNode(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   785
       if (retNode != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   786
       {
7f561c08de6b Initial load
duke
parents:
diff changeset
   787
         boolean isTagNameWildCard = "*".equals(tagname);
7f561c08de6b Initial load
duke
parents:
diff changeset
   788
         if (DTM.ELEMENT_NODE == retNode.getNodeType())
7f561c08de6b Initial load
duke
parents:
diff changeset
   789
         {
7f561c08de6b Initial load
duke
parents:
diff changeset
   790
           NodeList nodeList = retNode.getChildNodes();
7f561c08de6b Initial load
duke
parents:
diff changeset
   791
           for (int i = 0; i < nodeList.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   792
           {
7f561c08de6b Initial load
duke
parents:
diff changeset
   793
             traverseChildren(listVector, nodeList.item(i), tagname,
7f561c08de6b Initial load
duke
parents:
diff changeset
   794
                              isTagNameWildCard);
7f561c08de6b Initial load
duke
parents:
diff changeset
   795
           }
7f561c08de6b Initial load
duke
parents:
diff changeset
   796
         } else if (DTM.DOCUMENT_NODE == retNode.getNodeType()) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   797
           traverseChildren(listVector, dtm.getNode(node), tagname,
7f561c08de6b Initial load
duke
parents:
diff changeset
   798
                            isTagNameWildCard);
7f561c08de6b Initial load
duke
parents:
diff changeset
   799
         }
7f561c08de6b Initial load
duke
parents:
diff changeset
   800
       }
7f561c08de6b Initial load
duke
parents:
diff changeset
   801
       int size = listVector.size();
7f561c08de6b Initial load
duke
parents:
diff changeset
   802
       NodeSet nodeSet = new NodeSet(size);
7f561c08de6b Initial load
duke
parents:
diff changeset
   803
       for (int i = 0; i < size; i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   804
       {
7f561c08de6b Initial load
duke
parents:
diff changeset
   805
         nodeSet.addNode((Node) listVector.elementAt(i));
7f561c08de6b Initial load
duke
parents:
diff changeset
   806
       }
7f561c08de6b Initial load
duke
parents:
diff changeset
   807
       return (NodeList) nodeSet;
7f561c08de6b Initial load
duke
parents:
diff changeset
   808
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   809
7f561c08de6b Initial load
duke
parents:
diff changeset
   810
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   811
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   812
   * @param listVector
7f561c08de6b Initial load
duke
parents:
diff changeset
   813
   * @param tempNode
7f561c08de6b Initial load
duke
parents:
diff changeset
   814
   * @param tagname
7f561c08de6b Initial load
duke
parents:
diff changeset
   815
   * @param isTagNameWildCard
7f561c08de6b Initial load
duke
parents:
diff changeset
   816
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   817
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   818
   * Private method to be used for recursive iterations to obtain elements by tag name.
7f561c08de6b Initial load
duke
parents:
diff changeset
   819
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   820
  private final void traverseChildren
7f561c08de6b Initial load
duke
parents:
diff changeset
   821
  (
7f561c08de6b Initial load
duke
parents:
diff changeset
   822
    Vector listVector,
7f561c08de6b Initial load
duke
parents:
diff changeset
   823
    Node tempNode,
7f561c08de6b Initial load
duke
parents:
diff changeset
   824
    String tagname,
7f561c08de6b Initial load
duke
parents:
diff changeset
   825
    boolean isTagNameWildCard) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   826
    if (tempNode == null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   827
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   828
      return;
7f561c08de6b Initial load
duke
parents:
diff changeset
   829
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   830
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   831
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   832
      if (tempNode.getNodeType() == DTM.ELEMENT_NODE
7f561c08de6b Initial load
duke
parents:
diff changeset
   833
            && (isTagNameWildCard || tempNode.getNodeName().equals(tagname)))
7f561c08de6b Initial load
duke
parents:
diff changeset
   834
      {
7f561c08de6b Initial load
duke
parents:
diff changeset
   835
        listVector.add(tempNode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   836
      }
7f561c08de6b Initial load
duke
parents:
diff changeset
   837
      if(tempNode.hasChildNodes())
7f561c08de6b Initial load
duke
parents:
diff changeset
   838
      {
7f561c08de6b Initial load
duke
parents:
diff changeset
   839
        NodeList nodeList = tempNode.getChildNodes();
7f561c08de6b Initial load
duke
parents:
diff changeset
   840
        for (int i = 0; i < nodeList.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   841
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   842
          traverseChildren(listVector, nodeList.item(i), tagname,
7f561c08de6b Initial load
duke
parents:
diff changeset
   843
                           isTagNameWildCard);
7f561c08de6b Initial load
duke
parents:
diff changeset
   844
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   845
      }
7f561c08de6b Initial load
duke
parents:
diff changeset
   846
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   847
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   848
7f561c08de6b Initial load
duke
parents:
diff changeset
   849
7f561c08de6b Initial load
duke
parents:
diff changeset
   850
7f561c08de6b Initial load
duke
parents:
diff changeset
   851
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   852
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   853
   * @param importedNode
7f561c08de6b Initial load
duke
parents:
diff changeset
   854
   * @param deep
7f561c08de6b Initial load
duke
parents:
diff changeset
   855
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   856
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   857
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   858
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   859
   * @see org.w3c.dom.Document as of DOM Level 2 -- DTMNodeProxy is read-only
7f561c08de6b Initial load
duke
parents:
diff changeset
   860
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   861
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   862
  public final Node importNode(Node importedNode, boolean deep)
7f561c08de6b Initial load
duke
parents:
diff changeset
   863
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   864
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   865
    throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   866
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   867
7f561c08de6b Initial load
duke
parents:
diff changeset
   868
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   869
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   870
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
   871
   * @param qualifiedName
7f561c08de6b Initial load
duke
parents:
diff changeset
   872
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   873
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   874
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   875
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   876
   * @see org.w3c.dom.Document as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
   877
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   878
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   879
  public final Element createElementNS(
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   880
                 String namespaceURI, String qualifiedName) throws DOMException
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   881
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   882
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   883
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   884
7f561c08de6b Initial load
duke
parents:
diff changeset
   885
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   886
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   887
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
   888
   * @param qualifiedName
7f561c08de6b Initial load
duke
parents:
diff changeset
   889
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   890
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   891
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   892
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   893
   * @see org.w3c.dom.Document as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
   894
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   895
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   896
  public final Attr createAttributeNS(
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   897
                  String namespaceURI, String qualifiedName) throws DOMException
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   898
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   899
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
   900
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   901
7f561c08de6b Initial load
duke
parents:
diff changeset
   902
   /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   903
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   904
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
   905
   * @param localName
7f561c08de6b Initial load
duke
parents:
diff changeset
   906
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   907
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   908
   * @see org.w3c.dom.Document as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
   909
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   910
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   911
  public final NodeList getElementsByTagNameNS(String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   912
                                               String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   913
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   914
    Vector listVector = new Vector();
7f561c08de6b Initial load
duke
parents:
diff changeset
   915
    Node retNode = dtm.getNode(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   916
    if (retNode != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   917
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   918
      boolean isNamespaceURIWildCard = "*".equals(namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
   919
      boolean isLocalNameWildCard    = "*".equals(localName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   920
      if (DTM.ELEMENT_NODE == retNode.getNodeType())
7f561c08de6b Initial load
duke
parents:
diff changeset
   921
      {
7f561c08de6b Initial load
duke
parents:
diff changeset
   922
        NodeList nodeList = retNode.getChildNodes();
7f561c08de6b Initial load
duke
parents:
diff changeset
   923
        for(int i = 0; i < nodeList.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   924
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   925
          traverseChildren(listVector, nodeList.item(i), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard);
7f561c08de6b Initial load
duke
parents:
diff changeset
   926
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   927
      }
7f561c08de6b Initial load
duke
parents:
diff changeset
   928
      else if(DTM.DOCUMENT_NODE == retNode.getNodeType())
7f561c08de6b Initial load
duke
parents:
diff changeset
   929
      {
7f561c08de6b Initial load
duke
parents:
diff changeset
   930
        traverseChildren(listVector, dtm.getNode(node), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard);
7f561c08de6b Initial load
duke
parents:
diff changeset
   931
      }
7f561c08de6b Initial load
duke
parents:
diff changeset
   932
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   933
    int size = listVector.size();
7f561c08de6b Initial load
duke
parents:
diff changeset
   934
    NodeSet nodeSet = new NodeSet(size);
7f561c08de6b Initial load
duke
parents:
diff changeset
   935
    for (int i = 0; i < size; i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   936
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   937
      nodeSet.addNode((Node)listVector.elementAt(i));
7f561c08de6b Initial load
duke
parents:
diff changeset
   938
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   939
    return (NodeList) nodeSet;
7f561c08de6b Initial load
duke
parents:
diff changeset
   940
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   941
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   942
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   943
   * @param listVector
7f561c08de6b Initial load
duke
parents:
diff changeset
   944
   * @param tempNode
7f561c08de6b Initial load
duke
parents:
diff changeset
   945
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
   946
   * @param localname
7f561c08de6b Initial load
duke
parents:
diff changeset
   947
   * @param isNamespaceURIWildCard
7f561c08de6b Initial load
duke
parents:
diff changeset
   948
   * @param isLocalNameWildCard
7f561c08de6b Initial load
duke
parents:
diff changeset
   949
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   950
   * Private method to be used for recursive iterations to obtain elements by tag name
7f561c08de6b Initial load
duke
parents:
diff changeset
   951
   * and namespaceURI.
7f561c08de6b Initial load
duke
parents:
diff changeset
   952
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   953
  private final void traverseChildren
7f561c08de6b Initial load
duke
parents:
diff changeset
   954
  (
7f561c08de6b Initial load
duke
parents:
diff changeset
   955
   Vector listVector,
7f561c08de6b Initial load
duke
parents:
diff changeset
   956
   Node tempNode,
7f561c08de6b Initial load
duke
parents:
diff changeset
   957
   String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   958
   String localname,
7f561c08de6b Initial load
duke
parents:
diff changeset
   959
   boolean isNamespaceURIWildCard,
7f561c08de6b Initial load
duke
parents:
diff changeset
   960
   boolean isLocalNameWildCard)
7f561c08de6b Initial load
duke
parents:
diff changeset
   961
   {
7f561c08de6b Initial load
duke
parents:
diff changeset
   962
    if (tempNode == null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   963
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   964
      return;
7f561c08de6b Initial load
duke
parents:
diff changeset
   965
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   966
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   967
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   968
      if (tempNode.getNodeType() == DTM.ELEMENT_NODE
7f561c08de6b Initial load
duke
parents:
diff changeset
   969
              && (isLocalNameWildCard
7f561c08de6b Initial load
duke
parents:
diff changeset
   970
                      || tempNode.getLocalName().equals(localname)))
7f561c08de6b Initial load
duke
parents:
diff changeset
   971
      {
7f561c08de6b Initial load
duke
parents:
diff changeset
   972
        String nsURI = tempNode.getNamespaceURI();
7f561c08de6b Initial load
duke
parents:
diff changeset
   973
        if ((namespaceURI == null && nsURI == null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   974
               || isNamespaceURIWildCard
7f561c08de6b Initial load
duke
parents:
diff changeset
   975
               || (namespaceURI != null && namespaceURI.equals(nsURI)))
7f561c08de6b Initial load
duke
parents:
diff changeset
   976
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   977
          listVector.add(tempNode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   978
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   979
      }
7f561c08de6b Initial load
duke
parents:
diff changeset
   980
      if(tempNode.hasChildNodes())
7f561c08de6b Initial load
duke
parents:
diff changeset
   981
      {
7f561c08de6b Initial load
duke
parents:
diff changeset
   982
        NodeList nl = tempNode.getChildNodes();
7f561c08de6b Initial load
duke
parents:
diff changeset
   983
        for(int i = 0; i < nl.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   984
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   985
          traverseChildren(listVector, nl.item(i), namespaceURI, localname,
7f561c08de6b Initial load
duke
parents:
diff changeset
   986
                           isNamespaceURIWildCard, isLocalNameWildCard);
7f561c08de6b Initial load
duke
parents:
diff changeset
   987
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   988
      }
7f561c08de6b Initial load
duke
parents:
diff changeset
   989
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   990
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   991
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   992
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   993
   * @param elementId
7f561c08de6b Initial load
duke
parents:
diff changeset
   994
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   995
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   996
   * @see org.w3c.dom.Document as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
   997
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
   998
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   999
  public final Element getElementById(String elementId)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1000
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1001
       return (Element) dtm.getNode(dtm.getElementById(elementId));
7f561c08de6b Initial load
duke
parents:
diff changeset
  1002
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1003
7f561c08de6b Initial load
duke
parents:
diff changeset
  1004
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1005
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1006
   * @param offset
7f561c08de6b Initial load
duke
parents:
diff changeset
  1007
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1008
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1009
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1010
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1011
   * @see org.w3c.dom.Text
7f561c08de6b Initial load
duke
parents:
diff changeset
  1012
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1013
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1014
  public final Text splitText(int offset) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1015
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1016
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1017
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1018
7f561c08de6b Initial load
duke
parents:
diff changeset
  1019
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1020
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1021
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1022
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1023
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1024
   * @see org.w3c.dom.CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
  1025
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1026
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1027
  public final String getData() throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1028
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1029
    return dtm.getNodeValue(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1030
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1031
7f561c08de6b Initial load
duke
parents:
diff changeset
  1032
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1033
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1034
   * @param data
7f561c08de6b Initial load
duke
parents:
diff changeset
  1035
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1036
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1037
   * @see org.w3c.dom.CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
  1038
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1039
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1040
  public final void setData(String data) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1041
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1042
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1043
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1044
7f561c08de6b Initial load
duke
parents:
diff changeset
  1045
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1046
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1047
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1048
   * @see org.w3c.dom.CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
  1049
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1050
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1051
  public final int getLength()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1052
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1053
    // %OPT% This should do something smarter?
7f561c08de6b Initial load
duke
parents:
diff changeset
  1054
    return dtm.getNodeValue(node).length();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1055
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1056
7f561c08de6b Initial load
duke
parents:
diff changeset
  1057
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1058
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1059
   * @param offset
7f561c08de6b Initial load
duke
parents:
diff changeset
  1060
   * @param count
7f561c08de6b Initial load
duke
parents:
diff changeset
  1061
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1062
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1063
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1064
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1065
   * @see org.w3c.dom.CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
  1066
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1067
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1068
  public final String substringData(int offset, int count) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1069
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1070
    return getData().substring(offset,offset+count);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1071
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1072
7f561c08de6b Initial load
duke
parents:
diff changeset
  1073
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1074
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1075
   * @param arg
7f561c08de6b Initial load
duke
parents:
diff changeset
  1076
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1077
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1078
   * @see org.w3c.dom.CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
  1079
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1080
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1081
  public final void appendData(String arg) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1082
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1083
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1084
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1085
7f561c08de6b Initial load
duke
parents:
diff changeset
  1086
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1087
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1088
   * @param offset
7f561c08de6b Initial load
duke
parents:
diff changeset
  1089
   * @param arg
7f561c08de6b Initial load
duke
parents:
diff changeset
  1090
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1091
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1092
   * @see org.w3c.dom.CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
  1093
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1094
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1095
  public final void insertData(int offset, String arg) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1096
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1097
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1098
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1099
7f561c08de6b Initial load
duke
parents:
diff changeset
  1100
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1101
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1102
   * @param offset
7f561c08de6b Initial load
duke
parents:
diff changeset
  1103
   * @param count
7f561c08de6b Initial load
duke
parents:
diff changeset
  1104
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1105
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1106
   * @see org.w3c.dom.CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
  1107
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1108
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1109
  public final void deleteData(int offset, int count) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1110
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1111
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1112
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1113
7f561c08de6b Initial load
duke
parents:
diff changeset
  1114
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1115
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1116
   * @param offset
7f561c08de6b Initial load
duke
parents:
diff changeset
  1117
   * @param count
7f561c08de6b Initial load
duke
parents:
diff changeset
  1118
   * @param arg
7f561c08de6b Initial load
duke
parents:
diff changeset
  1119
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1120
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1121
   * @see org.w3c.dom.CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
  1122
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1123
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1124
  public final void replaceData(int offset, int count, String arg)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1125
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1126
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1127
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1128
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1129
7f561c08de6b Initial load
duke
parents:
diff changeset
  1130
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1131
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1132
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1133
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1134
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1135
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1136
  public final String getTagName()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1137
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1138
    return dtm.getNodeName(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1139
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1140
7f561c08de6b Initial load
duke
parents:
diff changeset
  1141
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1142
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1143
   * @param name
7f561c08de6b Initial load
duke
parents:
diff changeset
  1144
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1145
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1146
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1147
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1148
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1149
  public final String getAttribute(String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1150
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1151
    DTMNamedNodeMap  map = new DTMNamedNodeMap(dtm, node);
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1152
    Node n = map.getNamedItem(name);
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1153
    return (null == n) ? EMPTYSTRING : n.getNodeValue();
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1154
  }
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1155
7f561c08de6b Initial load
duke
parents:
diff changeset
  1156
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1157
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1158
   * @param name
7f561c08de6b Initial load
duke
parents:
diff changeset
  1159
   * @param value
7f561c08de6b Initial load
duke
parents:
diff changeset
  1160
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1161
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1162
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1163
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1164
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1165
  public final void setAttribute(String name, String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1166
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1167
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1168
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1169
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1170
7f561c08de6b Initial load
duke
parents:
diff changeset
  1171
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1172
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1173
   * @param name
7f561c08de6b Initial load
duke
parents:
diff changeset
  1174
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1175
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1176
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1177
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1178
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1179
  public final void removeAttribute(String name) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1180
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1181
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1182
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1183
7f561c08de6b Initial load
duke
parents:
diff changeset
  1184
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1185
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1186
   * @param name
7f561c08de6b Initial load
duke
parents:
diff changeset
  1187
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1188
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1189
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1190
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1191
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1192
  public final Attr getAttributeNode(String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1193
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1194
    DTMNamedNodeMap  map = new DTMNamedNodeMap(dtm, node);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1195
    return (Attr)map.getNamedItem(name);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1196
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1197
7f561c08de6b Initial load
duke
parents:
diff changeset
  1198
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1199
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1200
   * @param newAttr
7f561c08de6b Initial load
duke
parents:
diff changeset
  1201
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1202
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1203
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1204
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1205
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1206
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1207
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1208
  public final Attr setAttributeNode(Attr newAttr) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1209
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1210
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1211
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1212
7f561c08de6b Initial load
duke
parents:
diff changeset
  1213
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1214
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1215
   * @param oldAttr
7f561c08de6b Initial load
duke
parents:
diff changeset
  1216
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1217
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1218
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1219
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1220
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1221
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1222
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1223
  public final Attr removeAttributeNode(Attr oldAttr) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1224
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1225
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1226
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1227
7f561c08de6b Initial load
duke
parents:
diff changeset
  1228
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1229
   * Introduced in DOM Level 2.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1230
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1231
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1232
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1233
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1234
  public boolean hasAttributes()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1235
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1236
    return DTM.NULL != dtm.getFirstAttribute(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1237
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1238
7f561c08de6b Initial load
duke
parents:
diff changeset
  1239
  /** @see org.w3c.dom.Element */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1240
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1241
  public final void normalize()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1242
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1243
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1244
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1245
7f561c08de6b Initial load
duke
parents:
diff changeset
  1246
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1247
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1248
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
  1249
   * @param localName
7f561c08de6b Initial load
duke
parents:
diff changeset
  1250
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1251
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1252
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1253
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1254
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1255
  public final String getAttributeNS(String namespaceURI, String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1256
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1257
    Node retNode = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1258
    int n = dtm.getAttributeNode(node,namespaceURI,localName);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1259
    if(n != DTM.NULL)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1260
            retNode = dtm.getNode(n);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1261
    return (null == retNode) ? EMPTYSTRING : retNode.getNodeValue();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1262
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1263
7f561c08de6b Initial load
duke
parents:
diff changeset
  1264
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1265
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1266
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
  1267
   * @param qualifiedName
7f561c08de6b Initial load
duke
parents:
diff changeset
  1268
   * @param value
7f561c08de6b Initial load
duke
parents:
diff changeset
  1269
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1270
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1271
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1272
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1273
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1274
  public final void setAttributeNS(
7f561c08de6b Initial load
duke
parents:
diff changeset
  1275
                                   String namespaceURI, String qualifiedName, String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1276
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1277
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1278
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1279
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1280
7f561c08de6b Initial load
duke
parents:
diff changeset
  1281
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1282
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1283
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
  1284
   * @param localName
7f561c08de6b Initial load
duke
parents:
diff changeset
  1285
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1286
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1287
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1288
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1289
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1290
  public final void removeAttributeNS(String namespaceURI, String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1291
    throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1292
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1293
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1294
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1295
7f561c08de6b Initial load
duke
parents:
diff changeset
  1296
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1297
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1298
   * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
  1299
   * @param localName
7f561c08de6b Initial load
duke
parents:
diff changeset
  1300
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1301
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1302
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1303
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1304
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1305
  public final Attr getAttributeNodeNS(String namespaceURI, String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1306
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1307
       Attr retAttr = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1308
       int n = dtm.getAttributeNode(node,namespaceURI,localName);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1309
       if(n != DTM.NULL)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1310
               retAttr = (Attr) dtm.getNode(n);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1311
       return retAttr;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1312
7f561c08de6b Initial load
duke
parents:
diff changeset
  1313
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1314
7f561c08de6b Initial load
duke
parents:
diff changeset
  1315
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1316
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1317
   * @param newAttr
7f561c08de6b Initial load
duke
parents:
diff changeset
  1318
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1319
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1320
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1321
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1322
   * @see org.w3c.dom.Element
7f561c08de6b Initial load
duke
parents:
diff changeset
  1323
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1324
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1325
  public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1326
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1327
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1328
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1329
7f561c08de6b Initial load
duke
parents:
diff changeset
  1330
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1331
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1332
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1333
   * @see org.w3c.dom.Attr
7f561c08de6b Initial load
duke
parents:
diff changeset
  1334
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1335
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1336
  public final String getName()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1337
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1338
    return dtm.getNodeName(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1339
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1340
7f561c08de6b Initial load
duke
parents:
diff changeset
  1341
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1342
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1343
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1344
   * @see org.w3c.dom.Attr
7f561c08de6b Initial load
duke
parents:
diff changeset
  1345
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1346
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1347
  public final boolean getSpecified()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1348
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1349
    // We really don't know which attributes might have come from the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1350
    // source document versus from the DTD. Treat them all as having
7f561c08de6b Initial load
duke
parents:
diff changeset
  1351
    // been provided by the user.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1352
    // %REVIEW% if/when we become aware of DTDs/schemae.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1353
    return true;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1354
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1355
7f561c08de6b Initial load
duke
parents:
diff changeset
  1356
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1357
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1358
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1359
   * @see org.w3c.dom.Attr
7f561c08de6b Initial load
duke
parents:
diff changeset
  1360
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1361
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1362
  public final String getValue()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1363
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1364
    return dtm.getNodeValue(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1365
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1366
7f561c08de6b Initial load
duke
parents:
diff changeset
  1367
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1368
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1369
   * @param value
7f561c08de6b Initial load
duke
parents:
diff changeset
  1370
   * @see org.w3c.dom.Attr
7f561c08de6b Initial load
duke
parents:
diff changeset
  1371
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1372
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1373
  public final void setValue(String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1374
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1375
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1376
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1377
7f561c08de6b Initial load
duke
parents:
diff changeset
  1378
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1379
   * Get the owner element of an attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1380
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1381
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1382
   * @see org.w3c.dom.Attr as of DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
  1383
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1384
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1385
  public final Element getOwnerElement()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1386
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1387
    if (getNodeType() != Node.ATTRIBUTE_NODE)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1388
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1389
    // In XPath and DTM data models, unlike DOM, an Attr's parent is its
7f561c08de6b Initial load
duke
parents:
diff changeset
  1390
    // owner element.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1391
    int newnode = dtm.getParent(node);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1392
    return (newnode == DTM.NULL) ? null : (Element)(dtm.getNode(newnode));
7f561c08de6b Initial load
duke
parents:
diff changeset
  1393
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1394
7f561c08de6b Initial load
duke
parents:
diff changeset
  1395
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1396
   * NEEDSDOC Method adoptNode
7f561c08de6b Initial load
duke
parents:
diff changeset
  1397
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1398
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1399
   * NEEDSDOC @param source
7f561c08de6b Initial load
duke
parents:
diff changeset
  1400
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1401
   * NEEDSDOC (adoptNode) @return
7f561c08de6b Initial load
duke
parents:
diff changeset
  1402
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1403
   * @throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1404
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1405
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1406
  public Node adoptNode(Node source) throws DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  1407
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1408
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1409
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1410
7f561c08de6b Initial load
duke
parents:
diff changeset
  1411
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1412
   * <p>EXPERIMENTAL! Based on the <a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1413
   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
7f561c08de6b Initial load
duke
parents:
diff changeset
  1414
   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1415
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1416
   * An attribute specifying, as part of the XML declaration, the encoding
7f561c08de6b Initial load
duke
parents:
diff changeset
  1417
   * of this document. This is <code>null</code> when unspecified.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1418
   * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1419
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1420
   * NEEDSDOC ($objectName$) @return
7f561c08de6b Initial load
duke
parents:
diff changeset
  1421
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1422
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1423
  public String getInputEncoding()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1424
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1425
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1426
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1427
7f561c08de6b Initial load
duke
parents:
diff changeset
  1428
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1429
   * <p>EXPERIMENTAL! Based on the <a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1430
   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
7f561c08de6b Initial load
duke
parents:
diff changeset
  1431
   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1432
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1433
   * An attribute specifying, as part of the XML declaration, the encoding
7f561c08de6b Initial load
duke
parents:
diff changeset
  1434
   * of this document. This is <code>null</code> when unspecified.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1435
   * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1436
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1437
   * NEEDSDOC @param encoding
7f561c08de6b Initial load
duke
parents:
diff changeset
  1438
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
  1439
  public void setEncoding(String encoding)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1440
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1441
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1442
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1443
7f561c08de6b Initial load
duke
parents:
diff changeset
  1444
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1445
   * <p>EXPERIMENTAL! Based on the <a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1446
   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
7f561c08de6b Initial load
duke
parents:
diff changeset
  1447
   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1448
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1449
   * An attribute specifying, as part of the XML declaration, whether this
7f561c08de6b Initial load
duke
parents:
diff changeset
  1450
   * document is standalone.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1451
   * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1452
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1453
   * NEEDSDOC ($objectName$) @return
7f561c08de6b Initial load
duke
parents:
diff changeset
  1454
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
  1455
  public boolean getStandalone()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1456
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1457
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1458
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1459
7f561c08de6b Initial load
duke
parents:
diff changeset
  1460
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1461
   * <p>EXPERIMENTAL! Based on the <a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1462
   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
7f561c08de6b Initial load
duke
parents:
diff changeset
  1463
   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1464
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1465
   * An attribute specifying, as part of the XML declaration, whether this
7f561c08de6b Initial load
duke
parents:
diff changeset
  1466
   * document is standalone.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1467
   * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1468
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1469
   * NEEDSDOC @param standalone
7f561c08de6b Initial load
duke
parents:
diff changeset
  1470
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
  1471
  public void setStandalone(boolean standalone)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1472
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1473
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1474
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1475
7f561c08de6b Initial load
duke
parents:
diff changeset
  1476
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1477
   * <p>EXPERIMENTAL! Based on the <a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1478
   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
7f561c08de6b Initial load
duke
parents:
diff changeset
  1479
   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1480
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1481
   * An attribute specifying whether errors checking is enforced or not.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1482
   * When set to <code>false</code>, the implementation is free to not
7f561c08de6b Initial load
duke
parents:
diff changeset
  1483
   * test every possible error case normally defined on DOM operations,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1484
   * and not raise any <code>DOMException</code>. In case of error, the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1485
   * behavior is undefined. This attribute is <code>true</code> by
7f561c08de6b Initial load
duke
parents:
diff changeset
  1486
   * defaults.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1487
   * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1488
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1489
   * NEEDSDOC ($objectName$) @return
7f561c08de6b Initial load
duke
parents:
diff changeset
  1490
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1491
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1492
  public boolean getStrictErrorChecking()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1493
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1494
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1495
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1496
7f561c08de6b Initial load
duke
parents:
diff changeset
  1497
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1498
   * <p>EXPERIMENTAL! Based on the <a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1499
   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
7f561c08de6b Initial load
duke
parents:
diff changeset
  1500
   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1501
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1502
   * An attribute specifying whether errors checking is enforced or not.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1503
   * When set to <code>false</code>, the implementation is free to not
7f561c08de6b Initial load
duke
parents:
diff changeset
  1504
   * test every possible error case normally defined on DOM operations,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1505
   * and not raise any <code>DOMException</code>. In case of error, the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1506
   * behavior is undefined. This attribute is <code>true</code> by
7f561c08de6b Initial load
duke
parents:
diff changeset
  1507
   * defaults.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1508
   * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1509
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1510
   * NEEDSDOC @param strictErrorChecking
7f561c08de6b Initial load
duke
parents:
diff changeset
  1511
   */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1512
  @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1513
  public void setStrictErrorChecking(boolean strictErrorChecking)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1514
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1515
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1516
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1517
7f561c08de6b Initial load
duke
parents:
diff changeset
  1518
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1519
   * <p>EXPERIMENTAL! Based on the <a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1520
   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
7f561c08de6b Initial load
duke
parents:
diff changeset
  1521
   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1522
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1523
   * An attribute specifying, as part of the XML declaration, the version
7f561c08de6b Initial load
duke
parents:
diff changeset
  1524
   * number of this document. This is <code>null</code> when unspecified.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1525
   * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1526
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1527
   * NEEDSDOC ($objectName$) @return
7f561c08de6b Initial load
duke
parents:
diff changeset
  1528
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
  1529
  public String getVersion()
7f561c08de6b Initial load
duke
parents:
diff changeset
  1530
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1531
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1532
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1533
7f561c08de6b Initial load
duke
parents:
diff changeset
  1534
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1535
   * <p>EXPERIMENTAL! Based on the <a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1536
   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
7f561c08de6b Initial load
duke
parents:
diff changeset
  1537
   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1538
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1539
   * An attribute specifying, as part of the XML declaration, the version
7f561c08de6b Initial load
duke
parents:
diff changeset
  1540
   * number of this document. This is <code>null</code> when unspecified.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1541
   * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1542
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1543
   * NEEDSDOC @param version
7f561c08de6b Initial load
duke
parents:
diff changeset
  1544
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
  1545
  public void setVersion(String version)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1546
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1547
    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1548
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1549
7f561c08de6b Initial load
duke
parents:
diff changeset
  1550
7f561c08de6b Initial load
duke
parents:
diff changeset
  1551
  /** Inner class to support getDOMImplementation.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1552
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
  1553
  static class DTMNodeProxyImplementation implements DOMImplementation
7f561c08de6b Initial load
duke
parents:
diff changeset
  1554
  {
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1555
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1556
    public DocumentType createDocumentType(String qualifiedName,String publicId, String systemId)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1557
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1558
      throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1559
    }
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1560
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1561
    public Document createDocument(String namespaceURI,String qualfiedName,DocumentType doctype)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1562
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1563
      // Could create a DTM... but why, when it'd have to be permanantly empty?
7f561c08de6b Initial load
duke
parents:
diff changeset
  1564
      throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1565
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1566
    /** Ask whether we support a given DOM feature.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1567
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1568
     * In fact, we do not _fully_ support any DOM feature -- we're a
7f561c08de6b Initial load
duke
parents:
diff changeset
  1569
     * read-only subset -- so arguably we should always return false.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1570
     * On the other hand, it may be more practically useful to return
7f561c08de6b Initial load
duke
parents:
diff changeset
  1571
     * true and simply treat the whole DOM as read-only, failing on the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1572
     * methods we can't support. I'm not sure which would be more useful
7f561c08de6b Initial load
duke
parents:
diff changeset
  1573
     * to the caller.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1574
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1575
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1576
    public boolean hasFeature(String feature,String version)
7f561c08de6b Initial load
duke
parents:
diff changeset
  1577
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1578
      if( ("CORE".equals(feature.toUpperCase()) || "XML".equals(feature.toUpperCase()))
7f561c08de6b Initial load
duke
parents:
diff changeset
  1579
                                        &&
7f561c08de6b Initial load
duke
parents:
diff changeset
  1580
          ("1.0".equals(version) || "2.0".equals(version)))
7f561c08de6b Initial load
duke
parents:
diff changeset
  1581
        return true;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1582
      return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1583
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1584
7f561c08de6b Initial load
duke
parents:
diff changeset
  1585
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1586
     *  This method returns a specialized object which implements the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1587
     * specialized APIs of the specified feature and version. The
7f561c08de6b Initial load
duke
parents:
diff changeset
  1588
     * specialized object may also be obtained by using binding-specific
7f561c08de6b Initial load
duke
parents:
diff changeset
  1589
     * casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations
7f561c08de6b Initial load
duke
parents:
diff changeset
  1590
.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1591
     * @param feature The name of the feature requested (case-insensitive).
7f561c08de6b Initial load
duke
parents:
diff changeset
  1592
     * @param version  This is the version number of the feature to test. If
7f561c08de6b Initial load
duke
parents:
diff changeset
  1593
     *   the version is <code>null</code> or the empty string, supporting
7f561c08de6b Initial load
duke
parents:
diff changeset
  1594
     *   any version of the feature will cause the method to return an
7f561c08de6b Initial load
duke
parents:
diff changeset
  1595
     *   object that supports at least one version of the feature.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1596
     * @return  Returns an object which implements the specialized APIs of
7f561c08de6b Initial load
duke
parents:
diff changeset
  1597
     *   the specified feature and version, if any, or <code>null</code> if
7f561c08de6b Initial load
duke
parents:
diff changeset
  1598
     *   there is no object which implements interfaces associated with that
7f561c08de6b Initial load
duke
parents:
diff changeset
  1599
     *   feature. If the <code>DOMObject</code> returned by this method
7f561c08de6b Initial load
duke
parents:
diff changeset
  1600
     *   implements the <code>Node</code> interface, it must delegate to the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1601
     *   primary core <code>Node</code> and not return results inconsistent
7f561c08de6b Initial load
duke
parents:
diff changeset
  1602
     *   with the primary core <code>Node</code> such as attributes,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1603
     *   childNodes, etc.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1604
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1605
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1606
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1607
    public Object getFeature(String feature, String version) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1608
        // we don't have any alternate node, either this node does the job
7f561c08de6b Initial load
duke
parents:
diff changeset
  1609
        // or we don't have anything that does
7f561c08de6b Initial load
duke
parents:
diff changeset
  1610
        //return hasFeature(feature, version) ? this : null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1611
        return null; //PENDING
7f561c08de6b Initial load
duke
parents:
diff changeset
  1612
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1613
7f561c08de6b Initial load
duke
parents:
diff changeset
  1614
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1615
7f561c08de6b Initial load
duke
parents:
diff changeset
  1616
7f561c08de6b Initial load
duke
parents:
diff changeset
  1617
//RAMESH : Pending proper implementation of DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1618
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1619
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1620
    public Object setUserData(String key,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1621
                              Object data,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1622
                              UserDataHandler handler) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1623
        return getOwnerDocument().setUserData( key, data, handler);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1624
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1625
7f561c08de6b Initial load
duke
parents:
diff changeset
  1626
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1627
     * Retrieves the object associated to a key on a this node. The object
7f561c08de6b Initial load
duke
parents:
diff changeset
  1628
     * must first have been set to this node by calling
7f561c08de6b Initial load
duke
parents:
diff changeset
  1629
     * <code>setUserData</code> with the same key.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1630
     * @param key The key the object is associated to.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1631
     * @return Returns the <code>DOMObject</code> associated to the given key
7f561c08de6b Initial load
duke
parents:
diff changeset
  1632
     *   on this node, or <code>null</code> if there was none.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1633
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1634
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1635
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1636
    public Object getUserData(String key) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1637
        return getOwnerDocument().getUserData( key);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1638
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1639
7f561c08de6b Initial load
duke
parents:
diff changeset
  1640
      /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1641
     *  This method returns a specialized object which implements the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1642
     * specialized APIs of the specified feature and version. The
7f561c08de6b Initial load
duke
parents:
diff changeset
  1643
     * specialized object may also be obtained by using binding-specific
7f561c08de6b Initial load
duke
parents:
diff changeset
  1644
     * casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1645
     * @param feature The name of the feature requested (case-insensitive).
7f561c08de6b Initial load
duke
parents:
diff changeset
  1646
     * @param version  This is the version number of the feature to test. If
7f561c08de6b Initial load
duke
parents:
diff changeset
  1647
     *   the version is <code>null</code> or the empty string, supporting
7f561c08de6b Initial load
duke
parents:
diff changeset
  1648
     *   any version of the feature will cause the method to return an
7f561c08de6b Initial load
duke
parents:
diff changeset
  1649
     *   object that supports at least one version of the feature.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1650
     * @return  Returns an object which implements the specialized APIs of
7f561c08de6b Initial load
duke
parents:
diff changeset
  1651
     *   the specified feature and version, if any, or <code>null</code> if
7f561c08de6b Initial load
duke
parents:
diff changeset
  1652
     *   there is no object which implements interfaces associated with that
7f561c08de6b Initial load
duke
parents:
diff changeset
  1653
     *   feature. If the <code>DOMObject</code> returned by this method
7f561c08de6b Initial load
duke
parents:
diff changeset
  1654
     *   implements the <code>Node</code> interface, it must delegate to the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1655
     *   primary core <code>Node</code> and not return results inconsistent
7f561c08de6b Initial load
duke
parents:
diff changeset
  1656
     *   with the primary core <code>Node</code> such as attributes,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1657
     *   childNodes, etc.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1658
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1659
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1660
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1661
    public Object getFeature(String feature, String version) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1662
        // we don't have any alternate node, either this node does the job
7f561c08de6b Initial load
duke
parents:
diff changeset
  1663
        // or we don't have anything that does
7f561c08de6b Initial load
duke
parents:
diff changeset
  1664
        return isSupported(feature, version) ? this : null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1665
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1666
7f561c08de6b Initial load
duke
parents:
diff changeset
  1667
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1668
     * Tests whether two nodes are equal.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1669
     * <br>This method tests for equality of nodes, not sameness (i.e.,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1670
     * whether the two nodes are references to the same object) which can be
7f561c08de6b Initial load
duke
parents:
diff changeset
  1671
     * tested with <code>Node.isSameNode</code>. All nodes that are the same
7f561c08de6b Initial load
duke
parents:
diff changeset
  1672
     * will also be equal, though the reverse may not be true.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1673
     * <br>Two nodes are equal if and only if the following conditions are
7f561c08de6b Initial load
duke
parents:
diff changeset
  1674
     * satisfied: The two nodes are of the same type.The following string
7f561c08de6b Initial load
duke
parents:
diff changeset
  1675
     * attributes are equal: <code>nodeName</code>, <code>localName</code>,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1676
     * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1677
     * , <code>baseURI</code>. This is: they are both <code>null</code>, or
7f561c08de6b Initial load
duke
parents:
diff changeset
  1678
     * they have the same length and are character for character identical.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1679
     * The <code>attributes</code> <code>NamedNodeMaps</code> are equal.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1680
     * This is: they are both <code>null</code>, or they have the same
7f561c08de6b Initial load
duke
parents:
diff changeset
  1681
     * length and for each node that exists in one map there is a node that
7f561c08de6b Initial load
duke
parents:
diff changeset
  1682
     * exists in the other map and is equal, although not necessarily at the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1683
     * same index.The <code>childNodes</code> <code>NodeLists</code> are
7f561c08de6b Initial load
duke
parents:
diff changeset
  1684
     * equal. This is: they are both <code>null</code>, or they have the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1685
     * same length and contain equal nodes at the same index. This is true
7f561c08de6b Initial load
duke
parents:
diff changeset
  1686
     * for <code>Attr</code> nodes as for any other type of node. Note that
7f561c08de6b Initial load
duke
parents:
diff changeset
  1687
     * normalization can affect equality; to avoid this, nodes should be
7f561c08de6b Initial load
duke
parents:
diff changeset
  1688
     * normalized before being compared.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1689
     * <br>For two <code>DocumentType</code> nodes to be equal, the following
7f561c08de6b Initial load
duke
parents:
diff changeset
  1690
     * conditions must also be satisfied: The following string attributes
7f561c08de6b Initial load
duke
parents:
diff changeset
  1691
     * are equal: <code>publicId</code>, <code>systemId</code>,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1692
     * <code>internalSubset</code>.The <code>entities</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1693
     * <code>NamedNodeMaps</code> are equal.The <code>notations</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1694
     * <code>NamedNodeMaps</code> are equal.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1695
     * <br>On the other hand, the following do not affect equality: the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1696
     * <code>ownerDocument</code> attribute, the <code>specified</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1697
     * attribute for <code>Attr</code> nodes, the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1698
     * <code>isWhitespaceInElementContent</code> attribute for
7f561c08de6b Initial load
duke
parents:
diff changeset
  1699
     * <code>Text</code> nodes, as well as any user data or event listeners
7f561c08de6b Initial load
duke
parents:
diff changeset
  1700
     * registered on the nodes.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1701
     * @param arg The node to compare equality with.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1702
     * @param deep If <code>true</code>, recursively compare the subtrees; if
7f561c08de6b Initial load
duke
parents:
diff changeset
  1703
     *   <code>false</code>, compare only the nodes themselves (and its
7f561c08de6b Initial load
duke
parents:
diff changeset
  1704
     *   attributes, if it is an <code>Element</code>).
7f561c08de6b Initial load
duke
parents:
diff changeset
  1705
     * @return If the nodes, and possibly subtrees are equal,
7f561c08de6b Initial load
duke
parents:
diff changeset
  1706
     *   <code>true</code> otherwise <code>false</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1707
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1708
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1709
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1710
    public boolean isEqualNode(Node arg) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1711
        if (arg == this) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1712
            return true;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1713
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1714
        if (arg.getNodeType() != getNodeType()) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1715
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1716
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1717
        // in theory nodeName can't be null but better be careful
7f561c08de6b Initial load
duke
parents:
diff changeset
  1718
        // who knows what other implementations may be doing?...
7f561c08de6b Initial load
duke
parents:
diff changeset
  1719
        if (getNodeName() == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1720
            if (arg.getNodeName() != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1721
                return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1722
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1723
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1724
        else if (!getNodeName().equals(arg.getNodeName())) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1725
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1726
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1727
7f561c08de6b Initial load
duke
parents:
diff changeset
  1728
        if (getLocalName() == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1729
            if (arg.getLocalName() != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1730
                return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1731
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1732
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1733
        else if (!getLocalName().equals(arg.getLocalName())) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1734
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1735
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1736
7f561c08de6b Initial load
duke
parents:
diff changeset
  1737
        if (getNamespaceURI() == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1738
            if (arg.getNamespaceURI() != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1739
                return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1740
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1741
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1742
        else if (!getNamespaceURI().equals(arg.getNamespaceURI())) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1743
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1744
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1745
7f561c08de6b Initial load
duke
parents:
diff changeset
  1746
        if (getPrefix() == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1747
            if (arg.getPrefix() != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1748
                return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1749
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1750
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1751
        else if (!getPrefix().equals(arg.getPrefix())) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1752
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1753
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1754
7f561c08de6b Initial load
duke
parents:
diff changeset
  1755
        if (getNodeValue() == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1756
            if (arg.getNodeValue() != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1757
                return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1758
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1759
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1760
        else if (!getNodeValue().equals(arg.getNodeValue())) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1761
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1762
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1763
    /*
7f561c08de6b Initial load
duke
parents:
diff changeset
  1764
        if (getBaseURI() == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1765
            if (((NodeImpl) arg).getBaseURI() != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1766
                return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1767
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1768
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1769
        else if (!getBaseURI().equals(((NodeImpl) arg).getBaseURI())) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1770
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1771
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1772
*/
7f561c08de6b Initial load
duke
parents:
diff changeset
  1773
7f561c08de6b Initial load
duke
parents:
diff changeset
  1774
             return true;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1775
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1776
7f561c08de6b Initial load
duke
parents:
diff changeset
  1777
      /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1778
     * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1779
     * Look up the namespace URI associated to the given prefix, starting from this node.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1780
     * Use lookupNamespaceURI(null) to lookup the default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  1781
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1782
     * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
  1783
     * @return th URI for the namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  1784
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1785
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1786
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1787
    public String lookupNamespaceURI(String specifiedPrefix) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1788
        short type = this.getNodeType();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1789
        switch (type) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1790
        case Node.ELEMENT_NODE : {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1791
7f561c08de6b Initial load
duke
parents:
diff changeset
  1792
                String namespace = this.getNamespaceURI();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1793
                String prefix = this.getPrefix();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1794
                if (namespace !=null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1795
                    // REVISIT: is it possible that prefix is empty string?
7f561c08de6b Initial load
duke
parents:
diff changeset
  1796
                    if (specifiedPrefix== null && prefix==specifiedPrefix) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1797
                        // looking for default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  1798
                        return namespace;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1799
                    } else if (prefix != null && prefix.equals(specifiedPrefix)) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1800
                        // non default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  1801
                        return namespace;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1802
                    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1803
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1804
                if (this.hasAttributes()) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1805
                    NamedNodeMap map = this.getAttributes();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1806
                    int length = map.getLength();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1807
                    for (int i=0;i<length;i++) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1808
                        Node attr = map.item(i);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1809
                        String attrPrefix = attr.getPrefix();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1810
                        String value = attr.getNodeValue();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1811
                        namespace = attr.getNamespaceURI();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1812
                        if (namespace !=null && namespace.equals("http://www.w3.org/2000/xmlns/")) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1813
                            // at this point we are dealing with DOM Level 2 nodes only
7f561c08de6b Initial load
duke
parents:
diff changeset
  1814
                            if (specifiedPrefix == null &&
7f561c08de6b Initial load
duke
parents:
diff changeset
  1815
                                attr.getNodeName().equals("xmlns")) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1816
                                // default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  1817
                                return value;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1818
                            } else if (attrPrefix !=null &&
7f561c08de6b Initial load
duke
parents:
diff changeset
  1819
                                       attrPrefix.equals("xmlns") &&
7f561c08de6b Initial load
duke
parents:
diff changeset
  1820
                                       attr.getLocalName().equals(specifiedPrefix)) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1821
                 // non default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  1822
                                return value;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1823
                            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1824
                        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1825
                    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1826
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1827
                /*
7f561c08de6b Initial load
duke
parents:
diff changeset
  1828
                NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1829
                if (ancestor != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1830
                    return ancestor.lookupNamespaceURI(specifiedPrefix);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1831
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1832
                */
7f561c08de6b Initial load
duke
parents:
diff changeset
  1833
7f561c08de6b Initial load
duke
parents:
diff changeset
  1834
                return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1835
7f561c08de6b Initial load
duke
parents:
diff changeset
  1836
7f561c08de6b Initial load
duke
parents:
diff changeset
  1837
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1838
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
  1839
        case Node.DOCUMENT_NODE : {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1840
                return((NodeImpl)((Document)this).getDocumentElement()).lookupNamespaceURI(specifiedPrefix) ;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1841
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1842
*/
7f561c08de6b Initial load
duke
parents:
diff changeset
  1843
        case Node.ENTITY_NODE :
7f561c08de6b Initial load
duke
parents:
diff changeset
  1844
        case Node.NOTATION_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1845
        case Node.DOCUMENT_FRAGMENT_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1846
        case Node.DOCUMENT_TYPE_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1847
            // type is unknown
7f561c08de6b Initial load
duke
parents:
diff changeset
  1848
            return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1849
        case Node.ATTRIBUTE_NODE:{
7f561c08de6b Initial load
duke
parents:
diff changeset
  1850
                if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1851
                    return getOwnerElement().lookupNamespaceURI(specifiedPrefix);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1852
7f561c08de6b Initial load
duke
parents:
diff changeset
  1853
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1854
                return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1855
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1856
        default:{
7f561c08de6b Initial load
duke
parents:
diff changeset
  1857
           /*
7f561c08de6b Initial load
duke
parents:
diff changeset
  1858
                NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1859
                if (ancestor != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1860
                    return ancestor.lookupNamespaceURI(specifiedPrefix);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1861
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1862
             */
7f561c08de6b Initial load
duke
parents:
diff changeset
  1863
                return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1864
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1865
7f561c08de6b Initial load
duke
parents:
diff changeset
  1866
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1867
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1868
7f561c08de6b Initial load
duke
parents:
diff changeset
  1869
7f561c08de6b Initial load
duke
parents:
diff changeset
  1870
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1871
     *  DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1872
     *  This method checks if the specified <code>namespaceURI</code> is the
7f561c08de6b Initial load
duke
parents:
diff changeset
  1873
     *  default namespace or not.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1874
     *  @param namespaceURI The namespace URI to look for.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1875
     *  @return  <code>true</code> if the specified <code>namespaceURI</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  1876
     *   is the default namespace, <code>false</code> otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1877
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1878
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1879
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1880
    public boolean isDefaultNamespace(String namespaceURI){
7f561c08de6b Initial load
duke
parents:
diff changeset
  1881
       /*
7f561c08de6b Initial load
duke
parents:
diff changeset
  1882
        // REVISIT: remove casts when DOM L3 becomes REC.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1883
        short type = this.getNodeType();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1884
        switch (type) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1885
        case Node.ELEMENT_NODE: {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1886
            String namespace = this.getNamespaceURI();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1887
            String prefix = this.getPrefix();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1888
7f561c08de6b Initial load
duke
parents:
diff changeset
  1889
            // REVISIT: is it possible that prefix is empty string?
7f561c08de6b Initial load
duke
parents:
diff changeset
  1890
            if (prefix == null || prefix.length() == 0) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1891
                if (namespaceURI == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1892
                    return (namespace == namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1893
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1894
                return namespaceURI.equals(namespace);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1895
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1896
            if (this.hasAttributes()) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1897
                ElementImpl elem = (ElementImpl)this;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1898
                NodeImpl attr = (NodeImpl)elem.getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "xmlns");
7f561c08de6b Initial load
duke
parents:
diff changeset
  1899
                if (attr != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1900
                    String value = attr.getNodeValue();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1901
                    if (namespaceURI == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1902
                        return (namespace == value);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1903
                    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1904
                    return namespaceURI.equals(value);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1905
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1906
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1907
7f561c08de6b Initial load
duke
parents:
diff changeset
  1908
            NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1909
            if (ancestor != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1910
                return ancestor.isDefaultNamespace(namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1911
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1912
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1913
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1914
        case Node.DOCUMENT_NODE:{
7f561c08de6b Initial load
duke
parents:
diff changeset
  1915
                return((NodeImpl)((Document)this).getDocumentElement()).isDefaultNamespace(namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1916
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1917
7f561c08de6b Initial load
duke
parents:
diff changeset
  1918
        case Node.ENTITY_NODE :
7f561c08de6b Initial load
duke
parents:
diff changeset
  1919
          case Node.NOTATION_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1920
        case Node.DOCUMENT_FRAGMENT_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1921
        case Node.DOCUMENT_TYPE_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1922
            // type is unknown
7f561c08de6b Initial load
duke
parents:
diff changeset
  1923
            return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1924
        case Node.ATTRIBUTE_NODE:{
7f561c08de6b Initial load
duke
parents:
diff changeset
  1925
                if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1926
                    return ownerNode.isDefaultNamespace(namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1927
7f561c08de6b Initial load
duke
parents:
diff changeset
  1928
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1929
                return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1930
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1931
        default:{
7f561c08de6b Initial load
duke
parents:
diff changeset
  1932
                NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1933
                if (ancestor != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1934
                    return ancestor.isDefaultNamespace(namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1935
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1936
                return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1937
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1938
7f561c08de6b Initial load
duke
parents:
diff changeset
  1939
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1940
*/
7f561c08de6b Initial load
duke
parents:
diff changeset
  1941
        return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1942
7f561c08de6b Initial load
duke
parents:
diff changeset
  1943
7f561c08de6b Initial load
duke
parents:
diff changeset
  1944
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1945
7f561c08de6b Initial load
duke
parents:
diff changeset
  1946
      /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  1947
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1948
     * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  1949
     * Look up the prefix associated to the given namespace URI, starting from this node.
7f561c08de6b Initial load
duke
parents:
diff changeset
  1950
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
  1951
     * @param namespaceURI
7f561c08de6b Initial load
duke
parents:
diff changeset
  1952
     * @return the prefix for the namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  1953
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  1954
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  1955
    public String lookupPrefix(String namespaceURI){
7f561c08de6b Initial load
duke
parents:
diff changeset
  1956
7f561c08de6b Initial load
duke
parents:
diff changeset
  1957
        // REVISIT: When Namespaces 1.1 comes out this may not be true
7f561c08de6b Initial load
duke
parents:
diff changeset
  1958
        // Prefix can't be bound to null namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  1959
        if (namespaceURI == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1960
            return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1961
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1962
7f561c08de6b Initial load
duke
parents:
diff changeset
  1963
        short type = this.getNodeType();
7f561c08de6b Initial load
duke
parents:
diff changeset
  1964
7f561c08de6b Initial load
duke
parents:
diff changeset
  1965
        switch (type) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1966
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
  1967
        case Node.ELEMENT_NODE: {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1968
7f561c08de6b Initial load
duke
parents:
diff changeset
  1969
                String namespace = this.getNamespaceURI(); // to flip out children
7f561c08de6b Initial load
duke
parents:
diff changeset
  1970
                return lookupNamespacePrefix(namespaceURI, (ElementImpl)this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1971
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1972
7f561c08de6b Initial load
duke
parents:
diff changeset
  1973
        case Node.DOCUMENT_NODE:{
7f561c08de6b Initial load
duke
parents:
diff changeset
  1974
                return((NodeImpl)((Document)this).getDocumentElement()).lookupPrefix(namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1975
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1976
*/
7f561c08de6b Initial load
duke
parents:
diff changeset
  1977
        case Node.ENTITY_NODE :
7f561c08de6b Initial load
duke
parents:
diff changeset
  1978
        case Node.NOTATION_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1979
        case Node.DOCUMENT_FRAGMENT_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1980
        case Node.DOCUMENT_TYPE_NODE:
7f561c08de6b Initial load
duke
parents:
diff changeset
  1981
            // type is unknown
7f561c08de6b Initial load
duke
parents:
diff changeset
  1982
            return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1983
        case Node.ATTRIBUTE_NODE:{
7f561c08de6b Initial load
duke
parents:
diff changeset
  1984
                if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1985
                    return getOwnerElement().lookupPrefix(namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1986
7f561c08de6b Initial load
duke
parents:
diff changeset
  1987
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1988
                return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1989
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1990
        default:{
7f561c08de6b Initial load
duke
parents:
diff changeset
  1991
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
  1992
                NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1993
                if (ancestor != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  1994
                    return ancestor.lookupPrefix(namespaceURI);
7f561c08de6b Initial load
duke
parents:
diff changeset
  1995
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1996
*/
7f561c08de6b Initial load
duke
parents:
diff changeset
  1997
                return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  1998
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  1999
         }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2000
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2001
7f561c08de6b Initial load
duke
parents:
diff changeset
  2002
     /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2003
     * Returns whether this node is the same node as the given one.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2004
     * <br>This method provides a way to determine whether two
7f561c08de6b Initial load
duke
parents:
diff changeset
  2005
     * <code>Node</code> references returned by the implementation reference
7f561c08de6b Initial load
duke
parents:
diff changeset
  2006
     * the same object. When two <code>Node</code> references are references
7f561c08de6b Initial load
duke
parents:
diff changeset
  2007
     * to the same object, even if through a proxy, the references may be
7f561c08de6b Initial load
duke
parents:
diff changeset
  2008
     * used completely interchangably, such that all attributes have the
7f561c08de6b Initial load
duke
parents:
diff changeset
  2009
     * same values and calling the same DOM method on either reference
7f561c08de6b Initial load
duke
parents:
diff changeset
  2010
     * always has exactly the same effect.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2011
     * @param other The node to test against.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2012
     * @return Returns <code>true</code> if the nodes are the same,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2013
     *   <code>false</code> otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2014
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2015
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2016
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2017
    public boolean isSameNode(Node other) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2018
        // we do not use any wrapper so the answer is obvious
7f561c08de6b Initial load
duke
parents:
diff changeset
  2019
        return this == other;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2020
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2021
7f561c08de6b Initial load
duke
parents:
diff changeset
  2022
      /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2023
     * This attribute returns the text content of this node and its
7f561c08de6b Initial load
duke
parents:
diff changeset
  2024
     * descendants. When it is defined to be null, setting it has no effect.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2025
     * When set, any possible children this node may have are removed and
7f561c08de6b Initial load
duke
parents:
diff changeset
  2026
     * replaced by a single <code>Text</code> node containing the string
7f561c08de6b Initial load
duke
parents:
diff changeset
  2027
     * this attribute is set to. On getting, no serialization is performed,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2028
     * the returned string does not contain any markup. No whitespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  2029
     * normalization is performed, the returned string does not contain the
7f561c08de6b Initial load
duke
parents:
diff changeset
  2030
     * element content whitespaces . Similarly, on setting, no parsing is
7f561c08de6b Initial load
duke
parents:
diff changeset
  2031
     * performed either, the input string is taken as pure textual content.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2032
     * <br>The string returned is made of the text content of this node
7f561c08de6b Initial load
duke
parents:
diff changeset
  2033
     * depending on its type, as defined below:
7f561c08de6b Initial load
duke
parents:
diff changeset
  2034
     * <table border='1'>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2035
     * <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2036
     * <th>Node type</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2037
     * <th>Content</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2038
     * </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2039
     * <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2040
     * <td valign='top' rowspan='1' colspan='1'>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2041
     * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2042
     * DOCUMENT_FRAGMENT_NODE</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2043
     * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2044
     * attribute value of every child node, excluding COMMENT_NODE and
7f561c08de6b Initial load
duke
parents:
diff changeset
  2045
     * PROCESSING_INSTRUCTION_NODE nodes</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2046
     * </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2047
     * <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2048
     * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2049
     * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2050
     * <td valign='top' rowspan='1' colspan='1'>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2051
     * <code>nodeValue</code></td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2052
     * </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2053
     * <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2054
     * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2055
     * <td valign='top' rowspan='1' colspan='1'>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2056
     * null</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2057
     * </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2058
     * </table>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2059
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  2060
     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2061
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  2062
     *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than
7f561c08de6b Initial load
duke
parents:
diff changeset
  2063
     *   fit in a <code>DOMString</code> variable on the implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
  2064
     *   platform.
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2065
     * @since DOM Level 3
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2066
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2067
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2068
    public void setTextContent(String textContent)
7f561c08de6b Initial load
duke
parents:
diff changeset
  2069
        throws DOMException {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2070
        setNodeValue(textContent);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2071
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2072
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2073
     * This attribute returns the text content of this node and its
7f561c08de6b Initial load
duke
parents:
diff changeset
  2074
     * descendants. When it is defined to be null, setting it has no effect.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2075
     * When set, any possible children this node may have are removed and
7f561c08de6b Initial load
duke
parents:
diff changeset
  2076
     * replaced by a single <code>Text</code> node containing the string
7f561c08de6b Initial load
duke
parents:
diff changeset
  2077
     * this attribute is set to. On getting, no serialization is performed,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2078
     * the returned string does not contain any markup. No whitespace
7f561c08de6b Initial load
duke
parents:
diff changeset
  2079
     * normalization is performed, the returned string does not contain the
7f561c08de6b Initial load
duke
parents:
diff changeset
  2080
     * element content whitespaces . Similarly, on setting, no parsing is
7f561c08de6b Initial load
duke
parents:
diff changeset
  2081
     * performed either, the input string is taken as pure textual content.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2082
     * <br>The string returned is made of the text content of this node
7f561c08de6b Initial load
duke
parents:
diff changeset
  2083
     * depending on its type, as defined below:
7f561c08de6b Initial load
duke
parents:
diff changeset
  2084
     * <table border='1'>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2085
     * <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2086
     * <th>Node type</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2087
     * <th>Content</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2088
     * </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2089
     * <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2090
     * <td valign='top' rowspan='1' colspan='1'>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2091
     * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2092
     * DOCUMENT_FRAGMENT_NODE</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2093
     * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2094
     * attribute value of every child node, excluding COMMENT_NODE and
7f561c08de6b Initial load
duke
parents:
diff changeset
  2095
     * PROCESSING_INSTRUCTION_NODE nodes</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2096
     * </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2097
     * <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2098
     * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2099
     * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2100
     * <td valign='top' rowspan='1' colspan='1'>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2101
     * <code>nodeValue</code></td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2102
     * </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2103
     * <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2104
     * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2105
     * <td valign='top' rowspan='1' colspan='1'>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2106
     * null</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2107
     * </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2108
     * </table>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2109
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  2110
     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2111
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
  2112
     *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than
7f561c08de6b Initial load
duke
parents:
diff changeset
  2113
     *   fit in a <code>DOMString</code> variable on the implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
  2114
     *   platform.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2115
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2116
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2117
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2118
    public String getTextContent() throws DOMException {
30989
1f747213d6c9 8081392: getNodeValue should return 'null' value for Element nodes
aefimov
parents: 25868
diff changeset
  2119
        return dtm.getStringValue(node).toString();
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2120
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2121
7f561c08de6b Initial load
duke
parents:
diff changeset
  2122
     /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2123
     * Compares a node with this node with regard to their position in the
7f561c08de6b Initial load
duke
parents:
diff changeset
  2124
     * document.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2125
     * @param other The node to compare against this node.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2126
     * @return Returns how the given node is positioned relatively to this
7f561c08de6b Initial load
duke
parents:
diff changeset
  2127
     *   node.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2128
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2129
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2130
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2131
    public short compareDocumentPosition(Node other) throws DOMException {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2132
        return 0;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2133
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2134
7f561c08de6b Initial load
duke
parents:
diff changeset
  2135
     /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2136
     * The absolute base URI of this node or <code>null</code> if undefined.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2137
     * This value is computed according to . However, when the
7f561c08de6b Initial load
duke
parents:
diff changeset
  2138
     * <code>Document</code> supports the feature "HTML" , the base URI is
7f561c08de6b Initial load
duke
parents:
diff changeset
  2139
     * computed using first the value of the href attribute of the HTML BASE
7f561c08de6b Initial load
duke
parents:
diff changeset
  2140
     * element if any, and the value of the <code>documentURI</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2141
     * attribute from the <code>Document</code> interface otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2142
     * <br> When the node is an <code>Element</code>, a <code>Document</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
  2143
     * or a a <code>ProcessingInstruction</code>, this attribute represents
7f561c08de6b Initial load
duke
parents:
diff changeset
  2144
     * the properties [base URI] defined in . When the node is a
7f561c08de6b Initial load
duke
parents:
diff changeset
  2145
     * <code>Notation</code>, an <code>Entity</code>, or an
7f561c08de6b Initial load
duke
parents:
diff changeset
  2146
     * <code>EntityReference</code>, this attribute represents the
7f561c08de6b Initial load
duke
parents:
diff changeset
  2147
     * properties [declaration base URI] in the . How will this be affected
7f561c08de6b Initial load
duke
parents:
diff changeset
  2148
     * by resolution of relative namespace URIs issue?It's not.Should this
7f561c08de6b Initial load
duke
parents:
diff changeset
  2149
     * only be on Document, Element, ProcessingInstruction, Entity, and
7f561c08de6b Initial load
duke
parents:
diff changeset
  2150
     * Notation nodes, according to the infoset? If not, what is it equal to
7f561c08de6b Initial load
duke
parents:
diff changeset
  2151
     * on other nodes? Null? An empty string? I think it should be the
7f561c08de6b Initial load
duke
parents:
diff changeset
  2152
     * parent's.No.Should this be read-only and computed or and actual
7f561c08de6b Initial load
duke
parents:
diff changeset
  2153
     * read-write attribute?Read-only and computed (F2F 19 Jun 2000 and
7f561c08de6b Initial load
duke
parents:
diff changeset
  2154
     * teleconference 30 May 2001).If the base HTML element is not yet
7f561c08de6b Initial load
duke
parents:
diff changeset
  2155
     * attached to a document, does the insert change the Document.baseURI?
7f561c08de6b Initial load
duke
parents:
diff changeset
  2156
     * Yes. (F2F 26 Sep 2001)
7f561c08de6b Initial load
duke
parents:
diff changeset
  2157
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2158
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2159
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2160
    public String getBaseURI() {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2161
        return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2162
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2163
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2164
    /**
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2165
     * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2166
     * Renaming node
7f561c08de6b Initial load
duke
parents:
diff changeset
  2167
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2168
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2169
    public Node renameNode(Node n,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2170
                           String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2171
                           String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
  2172
                           throws DOMException{
7f561c08de6b Initial load
duke
parents:
diff changeset
  2173
        return n;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2174
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2175
7f561c08de6b Initial load
duke
parents:
diff changeset
  2176
7f561c08de6b Initial load
duke
parents:
diff changeset
  2177
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2178
     *  DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2179
     *  Normalize document.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2180
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2181
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2182
    public void normalizeDocument(){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2183
7f561c08de6b Initial load
duke
parents:
diff changeset
  2184
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2185
    /**
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2186
     * The configuration used when <code>Document.normalizeDocument</code> is
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2187
     * invoked.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2188
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2189
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2190
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2191
    public DOMConfiguration getDomConfig(){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2192
       return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2193
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2194
7f561c08de6b Initial load
duke
parents:
diff changeset
  2195
7f561c08de6b Initial load
duke
parents:
diff changeset
  2196
    /** DOM Level 3 feature: documentURI */
7f561c08de6b Initial load
duke
parents:
diff changeset
  2197
    protected String fDocumentURI;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2198
7f561c08de6b Initial load
duke
parents:
diff changeset
  2199
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2200
     * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2201
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2202
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2203
    public void setDocumentURI(String documentURI){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2204
        fDocumentURI= documentURI;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2205
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2206
7f561c08de6b Initial load
duke
parents:
diff changeset
  2207
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2208
     * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2209
     * The location of the document or <code>null</code> if undefined.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2210
     * <br>Beware that when the <code>Document</code> supports the feature
7f561c08de6b Initial load
duke
parents:
diff changeset
  2211
     * "HTML" , the href attribute of the HTML BASE element takes precedence
7f561c08de6b Initial load
duke
parents:
diff changeset
  2212
     * over this attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2213
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2214
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2215
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2216
    public String getDocumentURI(){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2217
        return fDocumentURI;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2218
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2219
7f561c08de6b Initial load
duke
parents:
diff changeset
  2220
        /**DOM Level 3 feature: Document actualEncoding */
7f561c08de6b Initial load
duke
parents:
diff changeset
  2221
    protected String actualEncoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2222
7f561c08de6b Initial load
duke
parents:
diff changeset
  2223
     /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2224
     * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2225
     * An attribute specifying the actual encoding of this document. This is
7f561c08de6b Initial load
duke
parents:
diff changeset
  2226
     * <code>null</code> otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2227
     * <br> This attribute represents the property [character encoding scheme]
7f561c08de6b Initial load
duke
parents:
diff changeset
  2228
     * defined in .
7f561c08de6b Initial load
duke
parents:
diff changeset
  2229
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2230
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
  2231
    public String getActualEncoding() {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2232
        return actualEncoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2233
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2234
7f561c08de6b Initial load
duke
parents:
diff changeset
  2235
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2236
     * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2237
     * An attribute specifying the actual encoding of this document. This is
7f561c08de6b Initial load
duke
parents:
diff changeset
  2238
     * <code>null</code> otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2239
     * <br> This attribute represents the property [character encoding scheme]
7f561c08de6b Initial load
duke
parents:
diff changeset
  2240
     * defined in .
7f561c08de6b Initial load
duke
parents:
diff changeset
  2241
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2242
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
  2243
    public void setActualEncoding(String value) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2244
        actualEncoding = value;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2245
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2246
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2247
   /**
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2248
    * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2249
    */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2250
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2251
    public Text replaceWholeText(String content)
7f561c08de6b Initial load
duke
parents:
diff changeset
  2252
                                 throws DOMException{
7f561c08de6b Initial load
duke
parents:
diff changeset
  2253
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
  2254
7f561c08de6b Initial load
duke
parents:
diff changeset
  2255
        if (needsSyncData()) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2256
            synchronizeData();
7f561c08de6b Initial load
duke
parents:
diff changeset
  2257
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2258
7f561c08de6b Initial load
duke
parents:
diff changeset
  2259
        // make sure we can make the replacement
7f561c08de6b Initial load
duke
parents:
diff changeset
  2260
        if (!canModify(nextSibling)) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2261
            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2262
                DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
7f561c08de6b Initial load
duke
parents:
diff changeset
  2263
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2264
7f561c08de6b Initial load
duke
parents:
diff changeset
  2265
        Node parent = this.getParentNode();
7f561c08de6b Initial load
duke
parents:
diff changeset
  2266
        if (content == null || content.length() == 0) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2267
            // remove current node
7f561c08de6b Initial load
duke
parents:
diff changeset
  2268
            if (parent !=null) { // check if node in the tree
7f561c08de6b Initial load
duke
parents:
diff changeset
  2269
                parent.removeChild(this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2270
                return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2271
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2272
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2273
        Text currentNode = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2274
        if (isReadOnly()){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2275
            Text newNode = this.ownerDocument().createTextNode(content);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2276
            if (parent !=null) { // check if node in the tree
7f561c08de6b Initial load
duke
parents:
diff changeset
  2277
                parent.insertBefore(newNode, this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2278
                parent.removeChild(this);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2279
                currentNode = newNode;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2280
            } else {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2281
                return newNode;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2282
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2283
        }  else {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2284
            this.setData(content);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2285
            currentNode = this;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2286
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2287
        Node sibling =  currentNode.getNextSibling();
7f561c08de6b Initial load
duke
parents:
diff changeset
  2288
        while ( sibling !=null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2289
            parent.removeChild(sibling);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2290
            sibling = currentNode.getNextSibling();
7f561c08de6b Initial load
duke
parents:
diff changeset
  2291
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2292
7f561c08de6b Initial load
duke
parents:
diff changeset
  2293
        return currentNode;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2294
*/
7f561c08de6b Initial load
duke
parents:
diff changeset
  2295
        return null; //Pending
7f561c08de6b Initial load
duke
parents:
diff changeset
  2296
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2297
7f561c08de6b Initial load
duke
parents:
diff changeset
  2298
     /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2299
     * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2300
     * Returns all text of <code>Text</code> nodes logically-adjacent text
7f561c08de6b Initial load
duke
parents:
diff changeset
  2301
     * nodes to this node, concatenated in document order.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2302
     * @since DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2303
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2304
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2305
    public String getWholeText(){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2306
7f561c08de6b Initial load
duke
parents:
diff changeset
  2307
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
  2308
        if (needsSyncData()) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2309
            synchronizeData();
7f561c08de6b Initial load
duke
parents:
diff changeset
  2310
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2311
        if (nextSibling == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2312
            return data;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2313
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2314
        StringBuffer buffer = new StringBuffer();
7f561c08de6b Initial load
duke
parents:
diff changeset
  2315
        if (data != null && data.length() != 0) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2316
            buffer.append(data);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2317
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2318
        getWholeText(nextSibling, buffer);
7f561c08de6b Initial load
duke
parents:
diff changeset
  2319
        return buffer.toString();
7f561c08de6b Initial load
duke
parents:
diff changeset
  2320
*/
7f561c08de6b Initial load
duke
parents:
diff changeset
  2321
        return null; // PENDING
7f561c08de6b Initial load
duke
parents:
diff changeset
  2322
7f561c08de6b Initial load
duke
parents:
diff changeset
  2323
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2324
7f561c08de6b Initial load
duke
parents:
diff changeset
  2325
      /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2326
    * DOM Level 3
7f561c08de6b Initial load
duke
parents:
diff changeset
  2327
     * Returns whether this text node contains whitespace in element content,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2328
     * often abusively called "ignorable whitespace".
7f561c08de6b Initial load
duke
parents:
diff changeset
  2329
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2330
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2331
    public boolean isElementContentWhitespace(){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2332
        return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2333
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2334
7f561c08de6b Initial load
duke
parents:
diff changeset
  2335
     /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2336
     * NON-DOM: set the type of this attribute to be ID type.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2337
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
  2338
     * @param id
7f561c08de6b Initial load
duke
parents:
diff changeset
  2339
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
  2340
    public void setIdAttribute(boolean id){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2341
        //PENDING
7f561c08de6b Initial load
duke
parents:
diff changeset
  2342
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2343
7f561c08de6b Initial load
duke
parents:
diff changeset
  2344
     /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2345
     * DOM Level 3: register the given attribute node as an ID attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
  2346
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2347
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2348
    public void setIdAttribute(String name, boolean makeId) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2349
        //PENDING
7f561c08de6b Initial load
duke
parents:
diff changeset
  2350
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2351
7f561c08de6b Initial load
duke
parents:
diff changeset
  2352
7f561c08de6b Initial load
duke
parents:
diff changeset
  2353
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2354
     * DOM Level 3: register the given attribute node as an ID attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
  2355
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2356
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2357
    public void setIdAttributeNode(Attr at, boolean makeId) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2358
        //PENDING
7f561c08de6b Initial load
duke
parents:
diff changeset
  2359
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2360
7f561c08de6b Initial load
duke
parents:
diff changeset
  2361
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2362
     * DOM Level 3: register the given attribute node as an ID attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
  2363
     */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2364
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2365
    public void setIdAttributeNS(String namespaceURI, String localName,
7f561c08de6b Initial load
duke
parents:
diff changeset
  2366
                                    boolean makeId) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2367
        //PENDING
7f561c08de6b Initial load
duke
parents:
diff changeset
  2368
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2369
         /**
7f561c08de6b Initial load
duke
parents:
diff changeset
  2370
         * Method getSchemaTypeInfo.
7f561c08de6b Initial load
duke
parents:
diff changeset
  2371
         * @return TypeInfo
7f561c08de6b Initial load
duke
parents:
diff changeset
  2372
         */
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2373
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2374
    public TypeInfo getSchemaTypeInfo(){
7f561c08de6b Initial load
duke
parents:
diff changeset
  2375
      return null; //PENDING
7f561c08de6b Initial load
duke
parents:
diff changeset
  2376
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2377
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2378
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2379
    public boolean isId() {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2380
        return false; //PENDING
7f561c08de6b Initial load
duke
parents:
diff changeset
  2381
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2382
7f561c08de6b Initial load
duke
parents:
diff changeset
  2383
7f561c08de6b Initial load
duke
parents:
diff changeset
  2384
    private String xmlEncoding;
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2385
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2386
    public String getXmlEncoding( ) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2387
        return xmlEncoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2388
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2389
    public void setXmlEncoding( String xmlEncoding ) {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2390
        this.xmlEncoding = xmlEncoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2391
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2392
7f561c08de6b Initial load
duke
parents:
diff changeset
  2393
    private boolean xmlStandalone;
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2394
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2395
    public boolean getXmlStandalone() {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2396
        return xmlStandalone;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2397
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2398
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2399
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2400
    public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2401
        this.xmlStandalone = xmlStandalone;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2402
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2403
7f561c08de6b Initial load
duke
parents:
diff changeset
  2404
    private String xmlVersion;
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2405
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2406
    public String getXmlVersion() {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2407
        return xmlVersion;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2408
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2409
17538
d8d911c4e5d4 8013900: More warnings compiling jaxp.
dfuchs
parents: 12457
diff changeset
  2410
    @Override
6
7f561c08de6b Initial load
duke
parents:
diff changeset
  2411
    public void setXmlVersion(String xmlVersion) throws DOMException {
7f561c08de6b Initial load
duke
parents:
diff changeset
  2412
        this.xmlVersion = xmlVersion;
7f561c08de6b Initial load
duke
parents:
diff changeset
  2413
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
  2414
7f561c08de6b Initial load
duke
parents:
diff changeset
  2415
}