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;
027:
028: import javax.xml.namespace.QName;
029:
030: import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
031: import com.sun.tools.internal.ws.wsdl.framework.Entity;
032: import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
033: import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
034:
035: /**
036: * Entity corresponding to the "output" child element of a port type operation.
037: *
038: * @author WS Development Team
039: */
040: public class Output extends Entity {
041:
042: public Output() {
043: }
044:
045: public String getName() {
046: return _name;
047: }
048:
049: public void setName(String name) {
050: _name = name;
051: }
052:
053: public QName getMessage() {
054: return _message;
055: }
056:
057: public void setMessage(QName n) {
058: _message = n;
059: }
060:
061: public Message resolveMessage(AbstractDocument document) {
062: return (Message) document.find(Kinds.MESSAGE, _message);
063: }
064:
065: public QName getElementName() {
066: return WSDLConstants.QNAME_OUTPUT;
067: }
068:
069: public Documentation getDocumentation() {
070: return _documentation;
071: }
072:
073: public void setDocumentation(Documentation d) {
074: _documentation = d;
075: }
076:
077: public void withAllQNamesDo(QNameAction action) {
078: if (_message != null) {
079: action.perform(_message);
080: }
081: }
082:
083: public void withAllEntityReferencesDo(EntityReferenceAction action) {
084: super .withAllEntityReferencesDo(action);
085: if (_message != null) {
086: action.perform(Kinds.MESSAGE, _message);
087: }
088: }
089:
090: public void accept(WSDLDocumentVisitor visitor) throws Exception {
091: visitor.preVisit(this );
092: visitor.postVisit(this );
093: }
094:
095: public void validateThis() {
096: if (_message == null) {
097: failValidation("validation.missingRequiredAttribute",
098: "message");
099: }
100: }
101:
102: private Documentation _documentation;
103: private String _name;
104: private QName _message;
105: }
|