001: /*
002: * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.internal.ws.wsdl.document.soap;
027:
028: import javax.xml.namespace.QName;
029:
030: import com.sun.tools.internal.ws.wsdl.framework.Extension;
031: import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
032:
033: /**
034: * A SOAP header fault extension.
035: *
036: * @author WS Development Team
037: */
038: public class SOAPHeaderFault extends Extension {
039:
040: public SOAPHeaderFault() {
041: }
042:
043: public QName getElementName() {
044: return SOAPConstants.QNAME_HEADERFAULT;
045: }
046:
047: public String getNamespace() {
048: return _namespace;
049: }
050:
051: public void setNamespace(String s) {
052: _namespace = s;
053: }
054:
055: public SOAPUse getUse() {
056: return _use;
057: }
058:
059: public void setUse(SOAPUse u) {
060: _use = u;
061: }
062:
063: public boolean isEncoded() {
064: return _use == SOAPUse.ENCODED;
065: }
066:
067: public boolean isLiteral() {
068: return _use == SOAPUse.LITERAL;
069: }
070:
071: public String getEncodingStyle() {
072: return _encodingStyle;
073: }
074:
075: public void setEncodingStyle(String s) {
076: _encodingStyle = s;
077: }
078:
079: public String getPart() {
080: return _part;
081: }
082:
083: public void setMessage(QName message) {
084: _message = message;
085: }
086:
087: public QName getMessage() {
088: return _message;
089: }
090:
091: public void setPart(String s) {
092: _part = s;
093: }
094:
095: public void withAllQNamesDo(QNameAction action) {
096: super .withAllQNamesDo(action);
097:
098: if (_message != null) {
099: action.perform(_message);
100: }
101: }
102:
103: public void validateThis() {
104: if (_message == null) {
105: failValidation("validation.missingRequiredAttribute",
106: "message");
107: }
108: if (_part == null) {
109: failValidation("validation.missingRequiredAttribute",
110: "part");
111: }
112: if (_use == null) {
113: failValidation("validation.missingRequiredAttribute", "use");
114: }
115: }
116:
117: private String _encodingStyle;
118: private String _namespace;
119: private String _part;
120: private QName _message;
121: private SOAPUse _use = SOAPUse.LITERAL;
122: }
|