01: /**
02: * Copyright 2004-2005 jManage.org
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: */package org.jmanage.core.management;
16:
17: import java.util.Arrays;
18: import java.util.Comparator;
19:
20: /**
21: *
22: * date: Aug 13, 2004
23: * @author Rakesh Kalra
24: */
25: public class ObjectInfo implements java.io.Serializable {
26:
27: private ObjectName objectName;
28: private String description;
29: private boolean isOpen;
30: private String className;
31: private ObjectAttributeInfo[] attributes;
32: private ObjectOperationInfo[] operations;
33: private ObjectConstructorInfo[] constructors;
34: private ObjectNotificationInfo[] notifications;
35:
36: public ObjectInfo(ObjectName objectName, String className,
37: String description, ObjectAttributeInfo[] attributes,
38: ObjectConstructorInfo[] constructors,
39: ObjectOperationInfo[] operations,
40: ObjectNotificationInfo[] notifications) {
41: this .objectName = objectName;
42: this .className = className;
43: this .description = description;
44: this .attributes = attributes;
45: this .constructors = constructors;
46: this .operations = operations;
47: this .notifications = notifications;
48: /* alphabetically sort the attribute list */
49: Arrays.sort(this .attributes, new Comparator() {
50: public int compare(Object o1, Object o2) {
51: ObjectAttributeInfo attrInfo1 = (ObjectAttributeInfo) o1;
52: ObjectAttributeInfo attrInfo2 = (ObjectAttributeInfo) o2;
53: return attrInfo1.getName().compareToIgnoreCase(
54: attrInfo2.getName());
55: }
56: });
57: }
58:
59: public ObjectAttributeInfo[] getAttributes() {
60: return attributes;
61: }
62:
63: public String getClassName() {
64: return className;
65: }
66:
67: public ObjectConstructorInfo[] getConstructors() {
68: return constructors;
69: }
70:
71: public String getDescription() {
72: return description;
73: }
74:
75: public ObjectNotificationInfo[] getNotifications() {
76: return notifications;
77: }
78:
79: public ObjectOperationInfo[] getOperations() {
80: return operations;
81: }
82:
83: public ObjectName getObjectName() {
84: return objectName;
85: }
86: }
|