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 java.util.Set;
12: import javax.security.auth.Subject;
13:
14: import org.xml.sax.SAXException;
15:
16: /**
17: * @version $Revision: 1.4 $
18: */
19: public class SubjectDeser extends AxisDeserializer {
20: private boolean readOnly;
21: private Set principals;
22: private Set publicCredentials;
23: private Set privateCredentials;
24:
25: public void onSetChildValue(Object value, Object hint)
26: throws SAXException {
27: if (SubjectSer.READ_ONLY.equals(hint))
28: readOnly = ((Boolean) value).booleanValue();
29: else if (SubjectSer.PRINCIPALS.equals(hint))
30: principals = (Set) value;
31: else if (SubjectSer.PUBLIC_CREDENTIALS.equals(hint))
32: publicCredentials = (Set) value;
33: else if (SubjectSer.PRIVATE_CREDENTIALS.equals(hint))
34: privateCredentials = (Set) value;
35: }
36:
37: protected Object createObject() throws SAXException {
38: return new Subject(readOnly, principals, publicCredentials,
39: privateCredentials);
40: }
41: }
|