01: // You can redistribute this software and/or modify it under the terms of
02: // the Infozone Software License version 2 published by the Infozone Group
03: // (http://www.infozone-group.org).
04: //
05: // Copyright (C) @year@ by The Infozone Group. All rights reserved.
06: //
07: // $Id: XObject.java,v 1.1 2002/05/10 08:59:12 per_nyfelt Exp $
08:
09: package org.infozone.tools.xml.queries;
10:
11: import java.io.*;
12:
13: import org.w3c.dom.DocumentFragment;
14: import org.w3c.dom.NodeList;
15:
16: /**
17: * @version $Revision: 1.1 $ $Date: 2002/05/10 08:59:12 $
18: * @author <a href="http://www.softwarebuero.de">SMB</a>
19: */
20: public interface XObject extends Serializable {
21:
22: //
23: // Constants
24: //
25:
26: /** Result is null. */
27: public final static int CLASS_NULL = -1;
28:
29: /** Result type is not known. */
30: public final static int CLASS_UNKNOWN = 0;
31:
32: /** Result type is a boolean. */
33: public final static int CLASS_BOOLEAN = 1;
34:
35: /** Result type is a Integer. */
36: public final static int CLASS_NUMBER = 2;
37:
38: /** Result type is a String. */
39: public final static int CLASS_STRING = 3;
40:
41: /** Result type is a NodeSet. */
42: public final static int CLASS_NODESET = 4;
43:
44: /** Result type is a Document Fragment. */
45: public final static int CLASS_RTREEFRAG = 5;
46:
47: /**
48: */
49: public int getType() throws Exception;
50:
51: /**
52: * Cast result object to a boolean.
53: * @return The Object casted to boolean
54: * @exception SAXException If any error occurs.
55: */
56: public boolean bool() throws Exception;
57:
58: /**
59: * Cast result object to a number.
60: * @return The Object casted to double.
61: * @exception SAXException If any error occurs.
62: */
63: public double num() throws Exception;
64:
65: /**
66: * Cast result object to a string.
67: * @return The Object casted to string.
68: */
69: public String str() throws Exception;
70:
71: /**
72: * Cast result object to a nodelist.
73: * @return The Object casted to NodeList.
74: * @exception SAXException If any error occurs.
75: */
76: public NodeList nodeset() throws Exception;
77:
78: /**
79: * Cast result object to a result tree fragment.
80: * @return The Object casted to DocumentFragment.
81: */
82: public DocumentFragment rtree() throws Exception;
83:
84: }
|