Class HTMLInputSource
java.lang.Object
org.xml.sax.InputSource
com.webmethods.rtl.markup.html.parser.HTMLInputSource
Input source that guesses correct charset to use by pre-processing the
source.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected boolean
protected IAuthenticator
protected InputStream
protected Reader
protected String
protected Locale
protected String
protected String
protected static final int
protected static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
calculateCharset
(URLConnection conn, String defaultCharset) Calculates charset as specified by connection headers.protected String
calculateLanguage
(URLConnection conn, String defaultLang) Calculates lang as specified by connection headers.void
close()
Convenience method to close whatever stream was used.boolean
protected InputStream
getByteStream
(int loop) protected String
guessCharset
(InputStream in, String lang, String defaultCharset) Auto-dectect charset based on content.protected String
localizeMessage
(String key) protected String
localizeMessage
(String key, Object[] args) protected String
localizeMessage
(String bundleName, String key, Object[] args) void
open()
Convenience method to open input source and set systemId and encoding properties.void
setAllowFilesystemAccess
(boolean allowFilesystemAccess) void
setAuthenticator
(IAuthenticator authenticator) void
setByteStream
(InputStream byteStream) void
setCharacterStream
(Reader characterStream) void
setEncoding
(String encoding) void
void
setPublicId
(String publicId) void
setSystemId
(String systemId) Methods inherited from class org.xml.sax.InputSource
isEmpty
-
Field Details
-
ACCEPT_CONTENT
- See Also:
-
ACCEPT_CHARSET
- See Also:
-
ACCEPT_LANGUAGE
- See Also:
-
CONTENT_CHARSET
- See Also:
-
DEFAULT_ACCEPT_CHARSET
- See Also:
-
DEFAULT_CONTENT_CHARSET
- See Also:
-
PREPROCESS_LENGTH
protected static final int PREPROCESS_LENGTH- See Also:
-
REDIRECT_LOOP
protected static final int REDIRECT_LOOP- See Also:
-
m_publicId
-
m_systemId
-
m_encoding
-
m_byteStream
-
m_characterStream
-
m_allowFilesystemAccess
protected boolean m_allowFilesystemAccess -
m_locale
-
m_authenticator
-
-
Constructor Details
-
HTMLInputSource
public HTMLInputSource() -
HTMLInputSource
-
-
Method Details
-
setPublicId
- Overrides:
setPublicId
in classInputSource
-
getPublicId
- Overrides:
getPublicId
in classInputSource
-
setSystemId
- Overrides:
setSystemId
in classInputSource
-
getSystemId
- Overrides:
getSystemId
in classInputSource
-
setEncoding
- Overrides:
setEncoding
in classInputSource
-
getEncoding
- Overrides:
getEncoding
in classInputSource
-
setByteStream
- Overrides:
setByteStream
in classInputSource
-
getByteStream
- Overrides:
getByteStream
in classInputSource
-
setCharacterStream
- Overrides:
setCharacterStream
in classInputSource
-
getCharacterStream
- Overrides:
getCharacterStream
in classInputSource
-
getAllowFilesystemAccess
public boolean getAllowFilesystemAccess() -
setAllowFilesystemAccess
public void setAllowFilesystemAccess(boolean allowFilesystemAccess) -
getLocale
-
setLocale
-
getAuthenticator
-
setAuthenticator
-
open
Convenience method to open input source and set systemId and encoding properties.- Throws:
IOException
-
close
Convenience method to close whatever stream was used.- Throws:
IOException
-
getByteStream
- Throws:
IOException
-
calculateLanguage
Calculates lang as specified by connection headers.- Throws:
IOException
-
calculateCharset
Calculates charset as specified by connection headers.- Throws:
IOException
-
guessCharset
protected String guessCharset(InputStream in, String lang, String defaultCharset) throws IOException Auto-dectect charset based on content.- Throws:
IOException
-
localizeMessage
-
localizeMessage
-
localizeMessage
-