java.lang.Object
io.sf.carte.doc.agent.AbstractUserAgent
io.sf.carte.doc.dom4j.DOM4JUserAgent
- All Implemented Interfaces:
UserAgent
,UserAgent.AgentControl
,Serializable
User Agent based on DOM4J document trees.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.sf.carte.doc.agent.UserAgent
UserAgent.AgentControl
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
DOM4JUserAgent
(EnumSet<Parser.Flag> parserFlags) protected
DOM4JUserAgent
(EnumSet<Parser.Flag> parserFlags, boolean useXPP3) -
Method Summary
Modifier and TypeMethodDescriptionprotected EntityResolver
static AbstractUserAgent
createUserAgent
(EnumSet<Parser.Flag> parserFlags, boolean useXPP3) Creates an user agent that reads XHTML documents with DOM4J.protected InputStream
parseDocument
(Reader re) Reads and parses an XHTML document located in the given URL.void
setEntityResolver
(EntityResolver resolver) Sets the entity resolver to be used when parsing documents.Methods inherited from class io.sf.carte.doc.agent.AbstractUserAgent
authenticationCredentials, createConnection, getAgentControl, getAuthenticationCredentials, getCookieConfig, getCookies, getOriginPolicy, getParserFlags, getProperty, isVisitedURL, openConnection, readCookies, setConnectionTimeout, setOriginPolicy, setProperty, setUseragentId
-
Field Details
-
resolver
-
-
Constructor Details
-
DOM4JUserAgent
-
DOM4JUserAgent
-
-
Method Details
-
createUserAgent
Creates an user agent that reads XHTML documents with DOM4J.- Parameters:
useXPP3
- Sets the use of the XPP3 pull parser to parse the documents.- Returns:
- the user agent.
-
createEntityResolver
-
setEntityResolver
Sets the entity resolver to be used when parsing documents.- Parameters:
resolver
- the entity resolver.
-
readURL
Reads and parses an XHTML document located in the given URL.- Parameters:
url
- the URL that points to the document.- Returns:
- the XHTMLDocument.
- Throws:
IOException
- if there is an I/O problem reading the URL.DocumentException
- if there is a problem parsing the document.
-
openInputStream
- Throws:
IOException
-
parseDocument
protected DOM4JUserAgent.AgentXHTMLDocumentFactory.AgentXHTMLDocument parseDocument(Reader re) throws DocumentException, IOException - Throws:
DocumentException
IOException
-
getXHTMLDocumentFactory
-