01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package mx4j.tools.remote.soap.axis.ser;
10:
11: import javax.management.relation.RoleInfo;
12:
13: import org.xml.sax.SAXException;
14:
15: /**
16: * @version $Revision: 1.3 $
17: */
18: public class RoleInfoDeser extends AxisDeserializer {
19: private String name;
20: private String description;
21: private String refMBeanClassName;
22: private boolean readable;
23: private boolean writeable;
24: private int minDegree;
25: private int maxDegree;
26:
27: public void onSetChildValue(Object value, Object hint)
28: throws SAXException {
29: if (RoleInfoSer.NAME.equals(hint))
30: name = (String) value;
31: if (RoleInfoSer.DESCRIPTION.equals(hint))
32: description = (String) value;
33: if (RoleInfoSer.REF_MBEAN_CLASS_NAME.equals(hint))
34: refMBeanClassName = (String) value;
35: if (RoleInfoSer.READABLE.equals(hint))
36: readable = ((Boolean) value).booleanValue();
37: if (RoleInfoSer.WRITEABLE.equals(hint))
38: writeable = ((Boolean) value).booleanValue();
39: if (RoleInfoSer.MIN_DEGREE.equals(hint))
40: minDegree = ((Integer) value).intValue();
41: if (RoleInfoSer.MAX_DEGREE.equals(hint))
42: maxDegree = ((Integer) value).intValue();
43: }
44:
45: protected Object createObject() throws SAXException {
46: try {
47: RoleInfo roleInfo = new RoleInfo(name, refMBeanClassName,
48: readable, writeable, minDegree, maxDegree,
49: description);
50: return roleInfo;
51: } catch (Exception e) {
52: throw new SAXException(e);
53: }
54: }
55:
56: }
|