## org.apache.jasper.xmlparser
Class XMLEncodingDetector

    java.lang.Object
      org.apache.jasper.xmlparser.XMLEncodingDetector

Direct Known Subclasses:
  XercesEncodingDetector

public class XMLEncodingDetector
extends java.lang.Object

Constructor Summary
`XMLEncodingDetector()`

Method Summary
`static java.lang.Object[]` `getEncoding(java.lang.String fname, java.util.jar.JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err)` Autodetects the encoding of the XML document supplied by the given input stream.
`java.lang.Object[]` `getEncodingMethod(java.lang.String fname, java.util.jar.JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XMLEncodingDetector

    public XMLEncodingDetector()

Method Detail

### getEncoding

    public static java.lang.Object[] getEncoding(java.lang.String fname,
                                                 java.util.jar.JarFile jarFile,
                                                 JspCompilationContext ctxt,
                                                 ErrorDispatcher err)
                                          throws java.io.IOException,
                                                 JasperException

  Autodetects the encoding of the XML document supplied by the given input stream. Encoding autodetection is done according to the XML 1.0 specification, Appendix F.1: Detection Without External Encoding Information.

  Parameters:
    `err` - The error dispatcher
  Returns:
    Two-element array, where the first element (of type java.lang.String) contains the name of the autodetected encoding, and the second element (of type java.lang.Boolean) specifies whether the encoding was specified by the encoding attribute of an XML declaration (prolog).
  Throws:
    `java.io.IOException`
    `JasperException`

### getEncodingMethod

    public java.lang.Object[] getEncodingMethod(java.lang.String fname,
                                                java.util.jar.JarFile jarFile,
                                                JspCompilationContext ctxt,
                                                ErrorDispatcher err)
                                         throws java.io.IOException,
                                                JasperException

  Throws:
    `java.io.IOException`
    `JasperException`

Copyright © 2000 Apache Software Foundation. All Rights Reserved.