KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > schema2beans > Bean


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.schema2beans;
21
22 import java.beans.*;
23
24 /**
25  * @author cliffwd
26  *
27  * All generated beans that use the runtime will implement this interface.
28  * It allows for some navigation and reflection.
29  */

30 public interface Bean {
31     public void addPropertyChangeListener(PropertyChangeListener l);
32     public void removePropertyChangeListener(PropertyChangeListener l);
33
34     /**
35      * @return a representation of the property. This method does not return
36      * null. If there is no object available for the specified
37      * property name, an exception is thrown.
38      */

39     public BeanProp beanProp(String JavaDoc name);
40
41     /**
42      * @return the schema name of this bean as define by this bean's parent.
43      */

44     public String JavaDoc dtdName();
45     public boolean isRoot();
46     public Bean _getParent();
47     public Bean _getRoot();
48
49     /**
50      * Return the bean name of this graph node.
51      */

52     public String JavaDoc name();
53     public boolean hasName(String JavaDoc name);
54     public int indexToId(String JavaDoc name, int index);
55     public int idToIndex(String JavaDoc name, int id);
56     public Bean propertyById(String JavaDoc name, int id);
57     public Object JavaDoc getValueById(String JavaDoc name, int id);
58     public void setValue(String JavaDoc name, Object JavaDoc value);
59     public void setValue(String JavaDoc name, int index, Object JavaDoc value);
60     public void setValueById(String JavaDoc name, int id, Object JavaDoc value);
61     public int removeValue(String JavaDoc name, Object JavaDoc value);
62     public int addValue(String JavaDoc name, Object JavaDoc value);
63     public Object JavaDoc getValue(String JavaDoc name);
64     public Object JavaDoc getValue(String JavaDoc name, int index);
65     public Object JavaDoc[] getValues(String JavaDoc name);
66     public BaseProperty getProperty();
67     public BaseProperty getProperty(String JavaDoc propName);
68     public BaseProperty[] listProperties();
69
70     /**
71      * Find all child beans and put them into the give beans List.
72      */

73     public void childBeans(boolean recursive, java.util.List JavaDoc beans);
74 }
75
Popular Tags