01: package com.jclark.xml.tok;
02:
03: /**
04: * An XML declaration.
05: * @version $Revision: 1.3 $ $Date: 1998/02/17 04:24:35 $
06: */
07: public class XmlDecl extends TextDecl {
08: private boolean standalone;
09:
10: /**
11: * Returns true if the XML declaration specified
12: * <code>standalone="yes"</code>.
13: */
14: public boolean isStandalone() {
15: return standalone;
16: }
17:
18: /**
19: * Creates an <code>XMLDecl</code> from the specified byte subarray.
20: * The specified encoding is used to convert bytes to characters.
21: * The byte subarray should be a <code>TOK_XML_DECL</code> token
22: * returned from Encoding.tokenizeProlog or Encoding.tokenizeContent,
23: * starting with <code><?</code> and ending with <code>?></code>.
24: * @exception InvalidTokenException if the specified byte subarray
25: * is not a legal XML declaration.
26: */
27: public XmlDecl(Encoding enc, byte[] buf, int off, int end)
28: throws InvalidTokenException {
29: standalone = init(true, enc, buf, off, end);
30: }
31:
32: }
|