KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > tools > mapping > reversedb2 > ojbmetatreemodel > OjbMetaFieldDescriptorNode


1 package org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel;
2
3 import org.apache.ojb.broker.metadata.DescriptorRepository;
4 import org.apache.ojb.broker.metadata.FieldDescriptor;
5
6 public class OjbMetaFieldDescriptorNode extends OjbMetaTreeNode
7 {
8
9     private static java.util.ArrayList JavaDoc supportedActions = new java.util.ArrayList JavaDoc();
10         
11     private FieldDescriptor fieldDescriptor;
12 /* Copyright 2002-2005 The Apache Software Foundation
13  *
14  * Licensed under the Apache License, Version 2.0 (the "License");
15  * you may not use this file except in compliance with the License.
16  * You may obtain a copy of the License at
17  *
18  * http://www.apache.org/licenses/LICENSE-2.0
19  *
20  * Unless required by applicable law or agreed to in writing, software
21  * distributed under the License is distributed on an "AS IS" BASIS,
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23  * See the License for the specific language governing permissions and
24  * limitations under the License.
25  */

26     public OjbMetaFieldDescriptorNode(
27         DescriptorRepository pRepository,
28         OjbMetaDataTreeModel pTreeModel,
29         OjbMetaTreeNode pparent,
30         FieldDescriptor pFieldDescriptor)
31     {
32         super(pRepository, pTreeModel, pparent);
33         this.fieldDescriptor = pFieldDescriptor;
34     }
35
36     /**
37      * @see OjbMetaTreeNode#_load()
38      */

39     protected boolean _load()
40     {
41         return true;
42     }
43
44     /**
45      * @see OjbMetaTreeNode#isLeaf()
46      */

47     public boolean isLeaf()
48     {
49         return false;
50     }
51
52     /**
53      * @see OjbMetaTreeNode#getAllowsChildren()
54      */

55     public boolean getAllowsChildren()
56     {
57         return false;
58     }
59
60     /**
61      * @see OjbMetaTreeNode#setAttribute(String, Object)
62      */

63     public void setAttribute(String JavaDoc strKey, Object JavaDoc value)
64     {
65     }
66
67     /**
68      * @see OjbMetaTreeNode#getAttribute(String)
69      */

70     public Object JavaDoc getAttribute(String JavaDoc strKey)
71     {
72         return null;
73     }
74
75     /**
76      * @see PropertyEditorTarget#getPropertyEditorClass()
77      */

78     public Class JavaDoc getPropertyEditorClass()
79     {
80         return null;
81     }
82     
83     public String JavaDoc toString()
84     {
85         return "FieldDescriptor: " + fieldDescriptor.getAttributeName();
86     }
87
88     /**
89      * @see ActionTarget#getActions()
90      */

91     public java.util.Iterator JavaDoc getActions()
92     {
93         return supportedActions.iterator();
94     }
95     
96     /**
97      * @see ActionTarget#actionListCacheable()
98      */

99     public boolean actionListCachable()
100     {
101         return true;
102     }
103     
104     public boolean actionListStatic()
105     {
106         return true;
107     }
108     
109     /**
110      * Return the descriptor object this node is associated with. E.g. if the
111      * node displays a class descriptor, the ClassDescriptor describing the class
112      * should be returned. Used for creating a Transferable.
113      */

114     public Object JavaDoc getAssociatedDescriptor()
115     {
116         return fieldDescriptor;
117     }
118     
119 }
120
121
Popular Tags