jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
changeset 43852 93a527059d8a
parent 28326 2b9860c0d68a
child 45678 65fdff10664d
equal deleted inserted replaced
43752:3c68ef249093 43852:93a527059d8a
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    29 import java.util.logging.Logger;
    29 import java.util.logging.Logger;
    30 
    30 
    31 import javax.xml.soap.SOAPElement;
    31 import javax.xml.soap.SOAPElement;
    32 import javax.xml.soap.SOAPException;
    32 import javax.xml.soap.SOAPException;
    33 
    33 
       
    34 import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
       
    35 import org.w3c.dom.Comment;
    34 import org.w3c.dom.DOMException;
    36 import org.w3c.dom.DOMException;
       
    37 import org.w3c.dom.Document;
       
    38 import org.w3c.dom.NamedNodeMap;
       
    39 import org.w3c.dom.Node;
       
    40 import org.w3c.dom.NodeList;
    35 import org.w3c.dom.Text;
    41 import org.w3c.dom.Text;
    36 
    42 
    37 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
    43 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
    38 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
    44 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
       
    45 import org.w3c.dom.UserDataHandler;
    39 
    46 
    40 public class SOAPCommentImpl
    47 public class SOAPCommentImpl
    41     extends com.sun.org.apache.xerces.internal.dom.CommentImpl
       
    42     implements javax.xml.soap.Text, org.w3c.dom.Comment {
    48     implements javax.xml.soap.Text, org.w3c.dom.Comment {
    43 
    49 
    44     protected static final Logger log =
    50     protected static final Logger log =
    45         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
    51         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
    46                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
    52                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
    47     protected static ResourceBundle rb =
    53     protected static ResourceBundle rb =
    48         log.getResourceBundle();
    54         log.getResourceBundle();
    49 
    55 
       
    56     @Override
       
    57     public String getData() throws DOMException {
       
    58         return comment.getData();
       
    59     }
       
    60 
       
    61     @Override
       
    62     public void setData(String data) throws DOMException {
       
    63         comment.setData(data);
       
    64     }
       
    65 
       
    66     @Override
       
    67     public int getLength() {
       
    68         return comment.getLength();
       
    69     }
       
    70 
       
    71     @Override
       
    72     public String substringData(int offset, int count) throws DOMException {
       
    73         return comment.substringData(offset, count);
       
    74     }
       
    75 
       
    76     @Override
       
    77     public void appendData(String arg) throws DOMException {
       
    78         comment.appendData(arg);
       
    79     }
       
    80 
       
    81     @Override
       
    82     public void insertData(int offset, String arg) throws DOMException {
       
    83         comment.insertData(offset, arg);
       
    84     }
       
    85 
       
    86     @Override
       
    87     public void deleteData(int offset, int count) throws DOMException {
       
    88         comment.deleteData(offset, count);
       
    89     }
       
    90 
       
    91     @Override
       
    92     public void replaceData(int offset, int count, String arg) throws DOMException {
       
    93         comment.replaceData(offset, count, arg);
       
    94     }
       
    95 
       
    96     @Override
       
    97     public String getNodeName() {
       
    98         return comment.getNodeName();
       
    99     }
       
   100 
       
   101     @Override
       
   102     public String getNodeValue() throws DOMException {
       
   103         return comment.getNodeValue();
       
   104     }
       
   105 
       
   106     @Override
       
   107     public void setNodeValue(String nodeValue) throws DOMException {
       
   108         comment.setNodeValue(nodeValue);
       
   109     }
       
   110 
       
   111     @Override
       
   112     public short getNodeType() {
       
   113         return comment.getNodeType();
       
   114     }
       
   115 
       
   116     @Override
       
   117     public Node getParentNode() {
       
   118         return comment.getParentNode();
       
   119     }
       
   120 
       
   121     @Override
       
   122     public NodeList getChildNodes() {
       
   123         return comment.getChildNodes();
       
   124     }
       
   125 
       
   126     @Override
       
   127     public Node getFirstChild() {
       
   128         return comment.getFirstChild();
       
   129     }
       
   130 
       
   131     @Override
       
   132     public Node getLastChild() {
       
   133         return comment.getLastChild();
       
   134     }
       
   135 
       
   136     @Override
       
   137     public Node getPreviousSibling() {
       
   138         return comment.getPreviousSibling();
       
   139     }
       
   140 
       
   141     @Override
       
   142     public Node getNextSibling() {
       
   143         return comment.getNextSibling();
       
   144     }
       
   145 
       
   146     @Override
       
   147     public NamedNodeMap getAttributes() {
       
   148         return comment.getAttributes();
       
   149     }
       
   150 
       
   151     @Override
       
   152     public Document getOwnerDocument() {
       
   153         return comment.getOwnerDocument();
       
   154     }
       
   155 
       
   156     @Override
       
   157     public Node insertBefore(Node newChild, Node refChild) throws DOMException {
       
   158         return comment.insertBefore(newChild, refChild);
       
   159     }
       
   160 
       
   161     @Override
       
   162     public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
       
   163         return comment.replaceChild(newChild, oldChild);
       
   164     }
       
   165 
       
   166     @Override
       
   167     public Node removeChild(Node oldChild) throws DOMException {
       
   168         return comment.removeChild(oldChild);
       
   169     }
       
   170 
       
   171     @Override
       
   172     public Node appendChild(Node newChild) throws DOMException {
       
   173         return comment.appendChild(newChild);
       
   174     }
       
   175 
       
   176     @Override
       
   177     public boolean hasChildNodes() {
       
   178         return comment.hasChildNodes();
       
   179     }
       
   180 
       
   181     @Override
       
   182     public Node cloneNode(boolean deep) {
       
   183         return comment.cloneNode(deep);
       
   184     }
       
   185 
       
   186     @Override
       
   187     public void normalize() {
       
   188         comment.normalize();
       
   189     }
       
   190 
       
   191     @Override
       
   192     public boolean isSupported(String feature, String version) {
       
   193         return comment.isSupported(feature, version);
       
   194     }
       
   195 
       
   196     @Override
       
   197     public String getNamespaceURI() {
       
   198         return comment.getNamespaceURI();
       
   199     }
       
   200 
       
   201     @Override
       
   202     public String getPrefix() {
       
   203         return comment.getPrefix();
       
   204     }
       
   205 
       
   206     @Override
       
   207     public void setPrefix(String prefix) throws DOMException {
       
   208         comment.setPrefix(prefix);
       
   209     }
       
   210 
       
   211     @Override
       
   212     public String getLocalName() {
       
   213         return comment.getLocalName();
       
   214     }
       
   215 
       
   216     @Override
       
   217     public boolean hasAttributes() {
       
   218         return comment.hasAttributes();
       
   219     }
       
   220 
       
   221     @Override
       
   222     public String getBaseURI() {
       
   223         return comment.getBaseURI();
       
   224     }
       
   225 
       
   226     @Override
       
   227     public short compareDocumentPosition(Node other) throws DOMException {
       
   228         return comment.compareDocumentPosition(other);
       
   229     }
       
   230 
       
   231     @Override
       
   232     public String getTextContent() throws DOMException {
       
   233         return comment.getTextContent();
       
   234     }
       
   235 
       
   236     @Override
       
   237     public void setTextContent(String textContent) throws DOMException {
       
   238         comment.setTextContent(textContent);
       
   239     }
       
   240 
       
   241     @Override
       
   242     public boolean isSameNode(Node other) {
       
   243         return comment.isSameNode(other);
       
   244     }
       
   245 
       
   246     @Override
       
   247     public String lookupPrefix(String namespaceURI) {
       
   248         return comment.lookupPrefix(namespaceURI);
       
   249     }
       
   250 
       
   251     @Override
       
   252     public boolean isDefaultNamespace(String namespaceURI) {
       
   253         return comment.isDefaultNamespace(namespaceURI);
       
   254     }
       
   255 
       
   256     @Override
       
   257     public String lookupNamespaceURI(String prefix) {
       
   258         return comment.lookupNamespaceURI(prefix);
       
   259     }
       
   260 
       
   261     @Override
       
   262     public boolean isEqualNode(Node arg) {
       
   263         return comment.isEqualNode(arg);
       
   264     }
       
   265 
       
   266     @Override
       
   267     public Object getFeature(String feature, String version) {
       
   268         return comment.getFeature(feature, version);
       
   269     }
       
   270 
       
   271     @Override
       
   272     public Object setUserData(String key, Object data, UserDataHandler handler) {
       
   273         return comment.setUserData(key, data, handler);
       
   274     }
       
   275 
       
   276     @Override
       
   277     public Object getUserData(String key) {
       
   278         return comment.getUserData(key);
       
   279     }
       
   280 
       
   281     private Comment comment;
       
   282 
    50     public SOAPCommentImpl(SOAPDocumentImpl ownerDoc, String text) {
   283     public SOAPCommentImpl(SOAPDocumentImpl ownerDoc, String text) {
    51         super(ownerDoc, text);
   284         comment = ownerDoc.getDomDocument().createComment(text);
       
   285         ownerDoc.register(this);
    52     }
   286     }
    53 
   287 
    54     public String getValue() {
   288     public String getValue() {
    55         String nodeValue = getNodeValue();
   289         String nodeValue = getNodeValue();
    56         return (nodeValue.equals("") ? null : nodeValue);
   290         return (nodeValue.equals("") ? null : nodeValue);
   109     public boolean isElementContentWhitespace() {
   343     public boolean isElementContentWhitespace() {
   110         //TODO: maybe we have to implement this in future.
   344         //TODO: maybe we have to implement this in future.
   111         throw new UnsupportedOperationException("Not Supported");
   345         throw new UnsupportedOperationException("Not Supported");
   112     }
   346     }
   113 
   347 
       
   348     public Comment getDomElement() {
       
   349         return comment;
       
   350     }
   114 }
   351 }