KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmanage > core > management > ObjectInfo


1 /**
2  * Copyright 2004-2005 jManage.org
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.jmanage.core.management;
17
18 import java.util.Arrays JavaDoc;
19 import java.util.Comparator JavaDoc;
20
21 /**
22  *
23  * date: Aug 13, 2004
24  * @author Rakesh Kalra
25  */

26 public class ObjectInfo implements java.io.Serializable JavaDoc {
27
28     private ObjectName objectName;
29     private String JavaDoc description;
30     private boolean isOpen;
31     private String JavaDoc className;
32     private ObjectAttributeInfo[] attributes;
33     private ObjectOperationInfo[] operations;
34     private ObjectConstructorInfo[] constructors;
35     private ObjectNotificationInfo[] notifications;
36
37     public ObjectInfo(ObjectName objectName,
38                       String JavaDoc className,
39                       String JavaDoc description,
40                       ObjectAttributeInfo[] attributes,
41                       ObjectConstructorInfo[] constructors,
42                       ObjectOperationInfo[] operations,
43                       ObjectNotificationInfo[] notifications) {
44         this.objectName = objectName;
45         this.className = className;
46         this.description = description;
47         this.attributes = attributes;
48         this.constructors = constructors;
49         this.operations = operations;
50         this.notifications = notifications;
51         /* alphabetically sort the attribute list */
52         Arrays.sort(this.attributes, new Comparator JavaDoc(){
53             public int compare(Object JavaDoc o1, Object JavaDoc o2) {
54                 ObjectAttributeInfo attrInfo1 = (ObjectAttributeInfo)o1;
55                 ObjectAttributeInfo attrInfo2 = (ObjectAttributeInfo)o2;
56                 return attrInfo1.getName().compareToIgnoreCase(attrInfo2.getName());
57             }
58         });
59     }
60
61     public ObjectAttributeInfo[] getAttributes() {
62         return attributes;
63     }
64
65     public String JavaDoc getClassName() {
66         return className;
67     }
68
69     public ObjectConstructorInfo[] getConstructors() {
70         return constructors;
71     }
72
73     public String JavaDoc getDescription() {
74         return description;
75     }
76
77     public ObjectNotificationInfo[] getNotifications() {
78         return notifications;
79     }
80
81     public ObjectOperationInfo[] getOperations() {
82         return operations;
83     }
84
85     public ObjectName getObjectName() {
86         return objectName;
87     }
88 }
89
Popular Tags