Top Description Fields Constructors Methods
com.rometools.rome.io

public Class XmlReaderException

extends IOException
Class Inheritance
Imports
java.io.IOException, .InputStream

The XmlReaderException is thrown by the XmlReader constructors if the charset encoding can not be determined according to the XML 1.0 specification and RFC 3023.

The exception returns the unconsumed InputStream to allow the application to do an alternate processing with the stream. Note that the original InputStream given to the XmlReader cannot be used as that one has been already read.

Field Summary

Modifier and TypeField and Description
private final String
private final String
private final String
private final InputStream
private static final long
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
XmlReaderException(final String
message describing the reason for the exception.
msg
,
final String
BOM encoding.
bomEnc
,
final String
XML guess encoding.
xmlGuessEnc
,
final String
XML prolog encoding.
xmlEnc
,
final InputStream
the unconsumed InputStream.
is
)

Creates an exception instance if the charset encoding could not be determined.

public
XmlReaderException(final String
message describing the reason for the exception.
msg
,
final String
MIME type in the content-type.
ctMime
,
final String
encoding in the content-type.
ctEnc
,
final String
BOM encoding.
bomEnc
,
final String
XML guess encoding.
xmlGuessEnc
,
final String
XML prolog encoding.
xmlEnc
,
final InputStream
the unconsumed InputStream.
is
)

Creates an exception instance if the charset encoding could not be determined.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the BOM encoding, null if none.
getBomEncoding
()

Returns the BOM encoding found in the InputStream.

public String

Returns:

the encoding in the content-type, null if there was not content-type, no encoding in it or the encoding detection did not involve HTTP.
getContentTypeEncoding
()

Returns the encoding in the content-type used to attempt determining the encoding.

public String

Returns:

the MIME type in the content-type, null if there was not content-type or the encoding detection did not involve HTTP.
getContentTypeMime
()

Returns the MIME type in the content-type used to attempt determining the encoding.

public InputStream

Returns:

the unconsumed InputStream.
getInputStream
()

Returns the unconsumed InputStream to allow the application to do an alternate encoding detection on the InputStream.

public String

Returns:

the encoding of the XML prolog, null if none.
getXmlEncoding
()

Returns the encoding found in the XML prolog of the InputStream.

public String

Returns:

the encoding guess, null if it couldn't be guessed.
getXmlGuessEncoding
()

Returns the encoding guess based on the first bytes of the InputStream.

Field Detail

bomEncodingback to summary
private final String bomEncoding
contentTypeEncodingback to summary
private final String contentTypeEncoding
contentTypeMimeback to summary
private final String contentTypeMime
isback to summary
private final InputStream is
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.io.IOException.serialVersionUID.

xmlEncodingback to summary
private final String xmlEncoding
xmlGuessEncodingback to summary
private final String xmlGuessEncoding

Constructor Detail

XmlReaderExceptionback to summary
public XmlReaderException(final String msg, final String bomEnc, final String xmlGuessEnc, final String xmlEnc, final InputStream is)

Creates an exception instance if the charset encoding could not be determined.

Instances of this exception are thrown by the XmlReader.

Parameters
msg:String

message describing the reason for the exception.

bomEnc:String

BOM encoding.

xmlGuessEnc:String

XML guess encoding.

xmlEnc:String

XML prolog encoding.

is:InputStream

the unconsumed InputStream.

XmlReaderExceptionback to summary
public XmlReaderException(final String msg, final String ctMime, final String ctEnc, final String bomEnc, final String xmlGuessEnc, final String xmlEnc, final InputStream is)

Creates an exception instance if the charset encoding could not be determined.

Instances of this exception are thrown by the XmlReader.

Parameters
msg:String

message describing the reason for the exception.

ctMime:String

MIME type in the content-type.

ctEnc:String

encoding in the content-type.

bomEnc:String

BOM encoding.

xmlGuessEnc:String

XML guess encoding.

xmlEnc:String

XML prolog encoding.

is:InputStream

the unconsumed InputStream.

Method Detail

getBomEncodingback to summary
public String getBomEncoding()

Returns the BOM encoding found in the InputStream.

Returns:String

the BOM encoding, null if none.

getContentTypeEncodingback to summary
public String getContentTypeEncoding()

Returns the encoding in the content-type used to attempt determining the encoding.

Returns:String

the encoding in the content-type, null if there was not content-type, no encoding in it or the encoding detection did not involve HTTP.

getContentTypeMimeback to summary
public String getContentTypeMime()

Returns the MIME type in the content-type used to attempt determining the encoding.

Returns:String

the MIME type in the content-type, null if there was not content-type or the encoding detection did not involve HTTP.

getInputStreamback to summary
public InputStream getInputStream()

Returns the unconsumed InputStream to allow the application to do an alternate encoding detection on the InputStream.

Returns:InputStream

the unconsumed InputStream.

getXmlEncodingback to summary
public String getXmlEncoding()

Returns the encoding found in the XML prolog of the InputStream.

Returns:String

the encoding of the XML prolog, null if none.

getXmlGuessEncodingback to summary
public String getXmlGuessEncoding()

Returns the encoding guess based on the first bytes of the InputStream.

Returns:String

the encoding guess, null if it couldn't be guessed.