KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > zeus > UnmarshalledObject


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  */

19 package org.enhydra.zeus;
20
21 /**
22  * <p>
23  * <code>UnmarshalledObject</code> represents an object that has been
24  * unmarshalled by Zeus. It allows access to the original document's
25  * system and public IDs for use in marshalling.
26  * </p>
27  *
28  * @author Brett McLaughlin
29  * @author Maciej Zawadzki
30  */

31 public class UnmarshalledObject {
32
33     /** The object that was unmarshalled */
34     protected Object JavaDoc object;
35
36     /** The system ID of the original XML document */
37     protected String JavaDoc systemID;
38     
39     /** The public ID of the original XML document */
40     protected String JavaDoc publicID;
41     
42     /**
43      * <p>
44      * A simple contructor that accepts the object, system ID,
45      * and public ID as parameters.
46      * </p>
47      *
48      * @param object the Object graph representing an XML document
49      * @param systemID the system ID of the DTD to which the
50      * XML document must conform
51      * @param publicID the public ID of the DTD to which the
52      * XML document must conform
53      */

54     public UnmarshalledObject(Object JavaDoc object, String JavaDoc publicID, String JavaDoc systemID) {
55         // Error checking
56
if (object == null) {
57             throw new IllegalArgumentException JavaDoc("An UnmarshalledObject cannot " +
58                 "have a null internal Object reference.");
59         }
60         
61         this.object = object;
62         this.systemID = systemID;
63         this.publicID = publicID;
64     }
65
66     /**
67      * <p>
68      * This creates a new instance of an unmarshalled object,
69      * with no system or public ID.
70      * </p>
71      *
72      * @param object the Object graph representing an XML document
73      */

74     public UnmarshalledObject(Object JavaDoc object) {
75         this(object, null, null);
76     }
77
78     /**
79      * <p>
80      * This returns the object graph that represents an XML document.
81      * </p>
82      *
83      * @return <code>Object</code> graph representing an XML document
84      */

85     public Object JavaDoc getObject() {
86         return object;
87     }
88     
89     /**
90      * <p>
91      * Returns the system ID of the DTD to which the
92      * XML document representation of the content must conform.
93      * </p>
94      *
95      * @return <code>String</code> system ID of the DTD to which
96      * the XML document representation of the content must conform.
97      */

98     public String JavaDoc getSystemID() {
99         return systemID;
100     }
101     
102     /**
103      * <p>
104      * Returns the public ID of the DTD to which the
105      * XML document representation of the content must conform.
106      * </p>
107      *
108      * @return <code>String</code> public ID of the DTD to which
109      * the XML document representation of the content must conform.
110      */

111     public String JavaDoc getPublicID() {
112         return publicID;
113     }
114 }
115
Popular Tags