KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > customizers > webservice > AuthorizationEntry


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  * AuthorizationEntry.java
21  *
22  * Created on May 19, 2006, 6:28 PM
23  */

24
25 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.webservice;
26
27 import java.util.ResourceBundle JavaDoc;
28
29 import org.netbeans.modules.j2ee.sun.dd.api.CommonDDBean;
30 import org.netbeans.modules.j2ee.sun.dd.api.common.Message;
31 import org.netbeans.modules.j2ee.sun.dd.api.common.MessageSecurity;
32
33 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.GenericTableModel;
34
35
36 /**
37  *
38  * @author Peter Williams
39  */

40 public class AuthorizationEntry extends GenericTableModel.TableEntry {
41
42     private static final ResourceBundle JavaDoc webserviceBundle = ResourceBundle.getBundle(
43         "org.netbeans.modules.j2ee.sun.share.configbean.customizers.webservice.Bundle"); // NOI18N
44

45     private String JavaDoc childAttributeName;
46     
47     public AuthorizationEntry(String JavaDoc propName, String JavaDoc attrName, String JavaDoc resBase) {
48         super(null, propName, webserviceBundle, resBase, false, false);
49         
50         childAttributeName = attrName;
51     }
52
53     public Object JavaDoc getEntry(CommonDDBean parent) {
54         Object JavaDoc result = null;
55
56         if(parent.size(propertyName) > 0) {
57             result = parent.getAttributeValue(propertyName, childAttributeName);
58         }
59         
60         return result;
61     }
62
63     public void setEntry(CommonDDBean parent, Object JavaDoc value) {
64         // Set blank strings to null. This object also handles message-security-binding
65
// though, so we have to check it out.
66
if(value instanceof String JavaDoc && ((String JavaDoc) value).length() == 0) {
67             value = null;
68         }
69
70         if(parent.size(propertyName) == 0) {
71             parent.setValue(propertyName, Boolean.TRUE);
72         }
73         
74         parent.setAttributeValue(propertyName, childAttributeName, (String JavaDoc) value);
75     }
76
77     public Object JavaDoc getEntry(CommonDDBean parent, int row) {
78         throw new UnsupportedOperationException JavaDoc();
79     }
80
81     public void setEntry(CommonDDBean parent, int row, Object JavaDoc value) {
82         throw new UnsupportedOperationException JavaDoc();
83     }
84 }
85
Popular Tags