net.sf.jsefa.xml
Class XmlReaderFactory

java.lang.Object
  extended by net.sf.jsefa.xml.XmlReaderFactory

public final class XmlReaderFactory
extends Object

Factory for creating Reader from different sources suitable to read a xml document providing autodetection of the character set encoding.

The autodetection mechanism follows the recommendations of Section F.1 of the XML specification.

Author:
Norman Lahme-Huetig

Method Summary
static Reader create(File file)
          Creates a Reader from the given File with an autodetected character set encoding.
static Reader create(InputStream inputStream)
          Creates a Reader from the given InputStream with an autodetected character set encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Reader create(File file)
Creates a Reader from the given File with an autodetected character set encoding.

Parameters:
file - the file to create a reader for
Returns:
a Reader
Throws:
XmlEncodingException - if an unsupported encoding is detected or an error occurs while encoding detection

create

public static Reader create(InputStream inputStream)
Creates a Reader from the given InputStream with an autodetected character set encoding.

Parameters:
inputStream - the input stream to create a reader for
Returns:
a Reader
Throws:
XmlEncodingException - if an unsupported encoding is detected or an error occurs while encoding detection


Copyright © 2014. All rights reserved.