KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > remote > soap > axis > ser > RoleInfoDeser


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.tools.remote.soap.axis.ser;
10
11 import javax.management.relation.RoleInfo JavaDoc;
12
13 import org.xml.sax.SAXException JavaDoc;
14
15 /**
16  * @version $Revision: 1.3 $
17  */

18 public class RoleInfoDeser extends AxisDeserializer
19 {
20    private String JavaDoc name;
21    private String JavaDoc description;
22    private String JavaDoc refMBeanClassName;
23    private boolean readable;
24    private boolean writeable;
25    private int minDegree;
26    private int maxDegree;
27
28    public void onSetChildValue(Object JavaDoc value, Object JavaDoc hint) throws SAXException JavaDoc
29    {
30       if (RoleInfoSer.NAME.equals(hint)) name = (String JavaDoc)value;
31       if (RoleInfoSer.DESCRIPTION.equals(hint)) description = (String JavaDoc)value;
32       if (RoleInfoSer.REF_MBEAN_CLASS_NAME.equals(hint)) refMBeanClassName = (String JavaDoc)value;
33       if (RoleInfoSer.READABLE.equals(hint)) readable = ((Boolean JavaDoc)value).booleanValue();
34       if (RoleInfoSer.WRITEABLE.equals(hint)) writeable = ((Boolean JavaDoc)value).booleanValue();
35       if (RoleInfoSer.MIN_DEGREE.equals(hint)) minDegree = ((Integer JavaDoc)value).intValue();
36       if (RoleInfoSer.MAX_DEGREE.equals(hint)) maxDegree = ((Integer JavaDoc)value).intValue();
37    }
38
39    protected Object JavaDoc createObject() throws SAXException JavaDoc
40    {
41       try
42       {
43          RoleInfo JavaDoc roleInfo =
44                  new RoleInfo JavaDoc(name, refMBeanClassName, readable, writeable, minDegree, maxDegree, description);
45          return roleInfo;
46       }
47       catch (Exception JavaDoc e)
48       {
49          throw new SAXException JavaDoc(e);
50       }
51    }
52
53 }
54
Popular Tags