public class HtmlDocument extends Object
Modifier and Type | Field and Description |
---|---|
static fr.paris.lutece.util.mail.HtmlDocument.ElementUrl |
ELEMENT_CSS
To define a CSS, html element must have:
"link" tag name
"rel" attribute equal to "stylesheet"
The url is contained in the attributed named "href"
|
static fr.paris.lutece.util.mail.HtmlDocument.ElementUrl |
ELEMENT_IMG
To define an image, html element must have:
"img" tag name
The url is contained in the attributed named "src"
|
static fr.paris.lutece.util.mail.HtmlDocument.ElementUrl |
ELEMENT_JAVASCRIPT
To define a javascript, html element must have:
"script" tag name
"type" attribute equal to "text/javascript"
The url is contained in the attributed named "src"
|
Constructor and Description |
---|
HtmlDocument(String strHtml,
String strBaseUrl,
boolean useAbsoluteUrl)
Instanciates an HtmlDocument after having built the DOM tree.
|
Modifier and Type | Method and Description |
---|---|
Map<String,URL> |
getAllUrls(fr.paris.lutece.util.mail.HtmlDocument.ElementUrl elementType)
Get the urls of all html elements specified by elementType
|
List<UrlAttachment> |
getAllUrlsAttachement(fr.paris.lutece.util.mail.HtmlDocument.ElementUrl elementType)
Get the urls of all html elements specified by elementType
|
public static final fr.paris.lutece.util.mail.HtmlDocument.ElementUrl ELEMENT_CSS
public static final fr.paris.lutece.util.mail.HtmlDocument.ElementUrl ELEMENT_JAVASCRIPT
public static final fr.paris.lutece.util.mail.HtmlDocument.ElementUrl ELEMENT_IMG
public HtmlDocument(String strHtml, String strBaseUrl, boolean useAbsoluteUrl)
strHtml
- The Html code to be parsed.strBaseUrl
- The Base url used to retrieve urls.useAbsoluteUrl
- Determine if we use absolute or relative url for HTML element's namespublic Map<String,URL> getAllUrls(fr.paris.lutece.util.mail.HtmlDocument.ElementUrl elementType)
elementType
- the type of element to getpublic List<UrlAttachment> getAllUrlsAttachement(fr.paris.lutece.util.mail.HtmlDocument.ElementUrl elementType)
elementType
- the type of element to getCopyright © 2020 City of Paris. All rights reserved.