KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitmodelext > policy > impl > PolicyImpl


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 2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.websvc.wsitmodelext.policy.impl;
21
22 import org.netbeans.modules.websvc.wsitmodelext.security.SecurityQName;
23 import org.netbeans.modules.websvc.wsitmodelext.policy.All;
24 import org.netbeans.modules.websvc.wsitmodelext.policy.ExactlyOne;
25 import org.netbeans.modules.websvc.wsitmodelext.policy.Policy;
26 import org.netbeans.modules.websvc.wsitmodelext.policy.PolicyQName;
27 import org.netbeans.modules.websvc.wsitmodelext.policy.PolicyReference;
28 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
29 import org.netbeans.modules.xml.wsdl.model.WSDLModel;
30 import org.netbeans.modules.xml.wsdl.model.visitor.WSDLVisitor;
31 import org.w3c.dom.Element JavaDoc;
32
33 import java.util.Collections JavaDoc;
34
35 /**
36  *
37  * @author Martin Grebac
38  */

39 public class PolicyImpl extends PolicyComponentImpl implements Policy {
40     
41     /**
42      * Creates a new instance of PolicyImpl
43      */

44     public PolicyImpl(WSDLModel model, Element JavaDoc e) {
45         super(model, e);
46     }
47     
48     public PolicyImpl(WSDLModel model){
49         this(model, createPrefixedElement(PolicyQName.POLICY.getQName(), model));
50     }
51
52     @Override JavaDoc
53     public void accept(WSDLVisitor visitor) {
54         visitor.visit(this);
55     }
56
57     public void setID(String JavaDoc id) {
58         setAnyAttribute(SecurityQName.SECPOLID.getQName(), id);
59     }
60
61     public String JavaDoc getID() {
62         return getAnyAttribute(SecurityQName.SECPOLID.getQName());
63     }
64
65     public void setAll(All all) {
66         java.util.List JavaDoc<Class JavaDoc<? extends WSDLComponent>> classes = Collections.emptyList();
67         setChild(All.class, ALL_PROPERTY, all, classes);
68     }
69
70     public All getAll() {
71         return getChild(All.class);
72     }
73
74     public void removeAll(All all) {
75         removeChild(ALL_PROPERTY, all);
76     }
77
78     public void setExactlyOne(ExactlyOne exactlyOne) {
79         java.util.List JavaDoc<Class JavaDoc<? extends WSDLComponent>> classes = Collections.emptyList();
80         setChild(ExactlyOne.class, EXACTLYONE_PROPERTY, exactlyOne, classes);
81     }
82
83     public ExactlyOne getExactlyOne() {
84         return getChild(ExactlyOne.class);
85     }
86
87     public void removeExactlyOne(ExactlyOne exactlyOne) {
88         removeChild(EXACTLYONE_PROPERTY, exactlyOne);
89     }
90
91     public void setPolicy(Policy policy) {
92         java.util.List JavaDoc<Class JavaDoc<? extends WSDLComponent>> classes = Collections.emptyList();
93         setChild(Policy.class, POLICY_PROPERTY, policy, classes);
94     }
95
96     public Policy getPolicy() {
97         return getChild(Policy.class);
98     }
99
100     public void removePolicy(Policy policy) {
101         removeChild(POLICY_PROPERTY, policy);
102     }
103
104     public void setPolicyReference(PolicyReference policyReference) {
105         java.util.List JavaDoc<Class JavaDoc<? extends WSDLComponent>> classes = Collections.emptyList();
106         setChild(PolicyReference.class, POLICYREFERENCE_PROPERTY, policyReference, classes);
107     }
108
109     public PolicyReference getPolicyReference() {
110         return getChild(PolicyReference.class);
111     }
112
113     public void removePolicyReference(PolicyReference policyReference) {
114         removeChild(POLICYREFERENCE_PROPERTY, policyReference);
115     }
116 }
117
Popular Tags