jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
changeset 43852 93a527059d8a
parent 33547 e4c76ac38b12
child 45678 65fdff10664d
equal deleted inserted replaced
43752:3c68ef249093 43852:93a527059d8a
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, 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.Level;
    29 import java.util.logging.Level;
    30 
    30 
    31 import javax.xml.namespace.QName;
    31 import javax.xml.namespace.QName;
    32 import javax.xml.soap.*;
    32 import javax.xml.soap.*;
    33 
    33 
       
    34 import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
    34 import org.w3c.dom.Element;
    35 import org.w3c.dom.Element;
    35 
    36 
    36 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
    37 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
    37 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument;
    38 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument;
    38 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
    39 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
    41 public abstract class HeaderImpl extends ElementImpl implements SOAPHeader {
    42 public abstract class HeaderImpl extends ElementImpl implements SOAPHeader {
    42     protected static final boolean MUST_UNDERSTAND_ONLY = false;
    43     protected static final boolean MUST_UNDERSTAND_ONLY = false;
    43 
    44 
    44     protected HeaderImpl(SOAPDocumentImpl ownerDoc, NameImpl name) {
    45     protected HeaderImpl(SOAPDocumentImpl ownerDoc, NameImpl name) {
    45         super(ownerDoc, name);
    46         super(ownerDoc, name);
       
    47     }
       
    48 
       
    49     public HeaderImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
       
    50         super(ownerDoc, domElement);
    46     }
    51     }
    47 
    52 
    48     protected abstract SOAPHeaderElement createHeaderElement(Name name)
    53     protected abstract SOAPHeaderElement createHeaderElement(Name name)
    49         throws SOAPException;
    54         throws SOAPException;
    50     protected abstract SOAPHeaderElement createHeaderElement(QName name)
    55     protected abstract SOAPHeaderElement createHeaderElement(QName name)
   274         }
   279         }
   275         return upgradeHeaderElement;
   280         return upgradeHeaderElement;
   276     }
   281     }
   277 
   282 
   278     protected SOAPElement convertToSoapElement(Element element) {
   283     protected SOAPElement convertToSoapElement(Element element) {
   279         if (element instanceof SOAPHeaderElement) {
   284         final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element);
   280             return (SOAPElement) element;
   285         if (soapNode instanceof SOAPHeaderElement) {
       
   286             return (SOAPElement) soapNode;
   281         } else {
   287         } else {
   282             SOAPHeaderElement headerElement;
   288             SOAPHeaderElement headerElement;
   283             try {
   289             try {
   284                 headerElement =
   290                 headerElement =
   285                     createHeaderElement(NameImpl.copyElementName(element));
   291                     createHeaderElement(NameImpl.copyElementName(element));