01: package com.jclark.xml.parse;
02:
03: import java.util.Enumeration;
04: import java.net.URL;
05:
06: /**
07: * Information about a DTD.
08: * @version $Revision: 1.6 $ $Date: 1998/06/25 04:41:33 $
09: */
10: public interface DTD {
11: /**
12: * Returns the document type name or null if there was no DOCTYPE
13: * declaration.
14: */
15: String getDocumentTypeName();
16:
17: /**
18: * Indicates a general entity.
19: *
20: * @see #getEntity
21: * @see #entityNames
22: */
23: static byte GENERAL_ENTITY = 0;
24: /**
25: * Indicates a parameter entity.
26: *
27: * @see #getEntity
28: * @see #entityNames
29: */
30: static byte PARAMETER_ENTITY = 1;
31: /**
32: * Indicates an entity declared with a NOTATION declaration.
33: *
34: * @see #getEntity
35: * @see #entityNames
36: */
37: static byte NOTATION = 2;
38:
39: /**
40: * Returns information about the entity with the specified name
41: * and type or null if there was no such entity declared.
42: * @see #GENERAL_ENTITY
43: * @see #PARAMETER_ENTITY
44: * @see #NOTATION
45: */
46: Entity getEntity(byte entityType, String name);
47:
48: /**
49: * Returns an enumeration over the names of entities of the
50: * specified type.
51: *
52: * @see #GENERAL_ENTITY
53: * @see #PARAMETER_ENTITY
54: * @see #NOTATION
55: */
56: Enumeration entityNames(byte entityType);
57:
58: /**
59: * The external subset declared in the document type declaration
60: * is modelled as a parameter entity with this name.
61: * This will not be included in the names enumerated by
62: * <code>entityNames</code>.
63: * If there is an external subset then its contents will
64: * be preceded by a StartEntityReferenceEvent with this name,
65: * and followed by an EndEntityReferenceEvent.
66: */
67: static String EXTERNAL_SUBSET_NAME = "#DOCTYPE";
68:
69: /**
70: * Returns information about the element type with the specified name,
71: * or null if there was neither an ELEMENT nor an ATTLIST declaration.
72: */
73: ElementType getElementType(String name);
74:
75: /**
76: * Returns an enumeration over the names of element types which were
77: * declared in the DTD or for which attributes were declared in the DTD.
78: */
79: Enumeration elementTypeNames();
80:
81: /**
82: * Returns true if the complete DTD was processed.
83: */
84: boolean isComplete();
85:
86: /**
87: * Returns true if <code>standalone="yes"</code> was specified in the
88: * XML declaration.
89: */
90: boolean isStandalone();
91: }
|