2 * Copyright (C) 2007 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.apache.harmony.xml.dom;
19 import org.w3c.dom.Comment;
20 import org.w3c.dom.Node;
23 * Provides a straightforward implementation of the corresponding W3C DOM
24 * interface. The class is used internally only, thus only notable members that
25 * are not in the original interface are documented (the W3C docs are quite
26 * extensive). Hope that's ok.
28 * Some of the fields may have package visibility, so other classes belonging to
29 * the DOM implementation can easily access them while maintaining the DOM tree
32 public final class CommentImpl extends CharacterDataImpl implements Comment {
34 CommentImpl(DocumentImpl document, String data) {
35 super(document, data);
39 public String getNodeName() {
44 public short getNodeType() {
45 return Node.COMMENT_NODE;
49 * Returns true if this comment contains the illegal character sequence
50 * "--". Such nodes may not be serialized.
52 public boolean containsDashDash() {
53 return buffer.indexOf("--") != -1;