01: /*
02: * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: package com.sun.tools.internal.ws.wsdl.document;
27:
28: import java.util.Iterator;
29:
30: import javax.xml.namespace.QName;
31:
32: import com.sun.tools.internal.ws.wsdl.framework.Entity;
33: import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
34: import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
35: import com.sun.tools.internal.ws.wsdl.framework.Extensible;
36: import com.sun.tools.internal.ws.wsdl.framework.Extension;
37:
38: /**
39: * Entity corresponding to the "fault" child element of a binding operation.
40: *
41: * @author WS Development Team
42: */
43: public class BindingFault extends Entity implements Extensible {
44:
45: public BindingFault() {
46: _helper = new ExtensibilityHelper();
47: }
48:
49: public String getName() {
50: return _name;
51: }
52:
53: public void setName(String name) {
54: _name = name;
55: }
56:
57: public QName getElementName() {
58: return WSDLConstants.QNAME_FAULT;
59: }
60:
61: public Documentation getDocumentation() {
62: return _documentation;
63: }
64:
65: public void setDocumentation(Documentation d) {
66: _documentation = d;
67: }
68:
69: public void addExtension(Extension e) {
70: _helper.addExtension(e);
71: }
72:
73: public Iterator extensions() {
74: return _helper.extensions();
75: }
76:
77: public void withAllSubEntitiesDo(EntityAction action) {
78: _helper.withAllSubEntitiesDo(action);
79: }
80:
81: public void accept(WSDLDocumentVisitor visitor) throws Exception {
82: visitor.preVisit(this );
83: _helper.accept(visitor);
84: visitor.postVisit(this );
85: }
86:
87: public void validateThis() {
88: if (_name == null) {
89: failValidation("validation.missingRequiredAttribute",
90: "name");
91: }
92: }
93:
94: private ExtensibilityHelper _helper;
95: private Documentation _documentation;
96: private String _name;
97: }
|