KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > model > impl > BindingOperationImpl


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.wsdl.model.impl;
21
22 import java.util.Collection JavaDoc;
23 import org.netbeans.modules.xml.wsdl.model.BindingFault;
24 import org.netbeans.modules.xml.wsdl.model.BindingInput;
25 import org.netbeans.modules.xml.wsdl.model.BindingOperation;
26 import org.netbeans.modules.xml.wsdl.model.BindingOutput;
27 import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement;
28 import org.netbeans.modules.xml.wsdl.model.Operation;
29 import org.netbeans.modules.xml.wsdl.model.WSDLModel;
30 import org.netbeans.modules.xml.wsdl.model.spi.WSDLComponentBase;
31 import org.netbeans.modules.xml.wsdl.model.visitor.WSDLVisitor;
32 import org.netbeans.modules.xml.xam.Reference;
33 import org.w3c.dom.Element JavaDoc;
34
35 /**
36  *
37  * @author Nam Nguyen
38  */

39 public class BindingOperationImpl extends WSDLComponentBase implements BindingOperation {
40     
41     /** Creates a new instance of BindingOperationImpl */
42     public BindingOperationImpl(WSDLModel model, Element e) {
43         super(model, e);
44     }
45     
46     public BindingOperationImpl(WSDLModel model) {
47         this(model, createNewElement(WSDLQNames.OPERATION.getQName(), model));
48     }
49     
50     public void addExtensibilityElement(ExtensibilityElement ee) {
51         addAfter(EXTENSIBILITY_ELEMENT_PROPERTY, ee, TypeCollection.DOCUMENTATION.types());
52     }
53     
54     public void setBindingInput(BindingInput bindingInput) {
55         setChildAfter(BindingInput.class, BINDING_INPUT_PROPERTY, bindingInput, TypeCollection.DOCUMENTATION_EE.types());
56     }
57     
58     public BindingInput getBindingInput() {
59         return getChild(BindingInput.class);
60     }
61     
62     public void setBindingOutput(BindingOutput bindingOutput) {
63         setChildAfter(BindingOutput.class, BINDING_OUTPUT_PROPERTY, bindingOutput,
64                 TypeCollection.DOCUMENTATION_EXTENSIBILITY_BINDINGINPUT.types());
65     }
66     
67     public BindingOutput getBindingOutput() {
68         return getChild(BindingOutput.class);
69     }
70     
71     public void setOperation(Reference<Operation> operationRef) {
72         setName(operationRef == null ? null : operationRef.get().getName());
73     }
74     
75     public Reference<Operation> getOperation() {
76         return getName() == null ? null : new OperationReference(this, getName());
77     }
78     
79     public void addBindingFault(BindingFault bindingFault) {
80         addAfter(BINDING_FAULT_PROPERTY, bindingFault, TypeCollection.DOCUMENTATION_EXTENSIBILITY_BINDINGOUTPUT.types());
81     }
82     
83     public void removeBindingFault(BindingFault bindingFault) {
84         removeChild(BINDING_FAULT_PROPERTY, bindingFault);
85     }
86     
87     public Collection JavaDoc<BindingFault> getBindingFaults() {
88         return getChildren(BindingFault.class);
89     }
90
91     public void accept(WSDLVisitor visitor) {
92         visitor.visit(this);
93     }
94     
95     public void setName(String JavaDoc name) {
96         setAttribute(NAME_PROPERTY, WSDLAttribute.NAME, name);
97     }
98
99     public String JavaDoc getName() {
100         return getAttribute(WSDLAttribute.NAME);
101     }
102 }
103
Popular Tags