com.bluecast.xml
Class XMLInputReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--com.bluecast.xml.XMLInputReader
Direct Known Subclasses:
XMLReaderReader, XMLStreamReader

public abstract class XMLInputReader
extends java.io.Reader

A Reader for XML documents the proper character set to use based on Byte Order Marks and XML declarations.

Version:
$Revision: 1.1 $
Author:
Yuval Oren, yuval@bluecast.com

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
XMLInputReader()
           
 
Method Summary
 java.lang.String getXMLDeclaredEncoding()
          Gets the declared encoding from the XML declaration, or null if no value was found.
 java.lang.String getXMLVersion()
          Gets the version string from the XML declaration, or null.
 boolean isXMLStandalone()
          Returns the Standalone value from the XML declaration.
 boolean isXMLStandaloneDeclared()
          Returns true if an XML "standalone" declaration was found.
protected  int parseXMLDeclaration(char[] cbuf, int offset, int length)
          Call this to parse the XML declaration.
protected  void resetInput()
           
 
Methods inherited from class java.io.Reader
close, mark, markSupported, read, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLInputReader

public XMLInputReader()
Method Detail

resetInput

protected void resetInput()

parseXMLDeclaration

protected int parseXMLDeclaration(char[] cbuf,
                                  int offset,
                                  int length)
                           throws java.io.IOException
Call this to parse the XML declaration. Returns the number of characters used by the declaration, or zero if no declaration was found.

java.io.IOException

getXMLVersion

public java.lang.String getXMLVersion()
Gets the version string from the XML declaration, or null.


isXMLStandalone

public boolean isXMLStandalone()
Returns the Standalone value from the XML declaration. Defaults to false if no value was declared.


isXMLStandaloneDeclared

public boolean isXMLStandaloneDeclared()
Returns true if an XML "standalone" declaration was found.


getXMLDeclaredEncoding

public java.lang.String getXMLDeclaredEncoding()
Gets the declared encoding from the XML declaration, or null if no value was found.