|
Enhydra-Oyster 2.1-7 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.oyster.util.HtmlAnalyzer
HtmlAnalyzer class is used for parsing html code which has to become content
of the message. For parsing is used JTidy parser. As result of parsing, DOM
(Document Object Model) structure is obtained. It is tree-like construction
with nodes and hierarchical structures that descripts input html code. This
structure is easy for browsing and searching for specific html elements and
attributes. By using DOM, all references to resources (image, movie, sound... ),
defined in "src" and "background" attributes, are explored and swapped with
generated unique Content-ID values which are necessary in forming
"multipart/related" MimeMultipart object.
DOM, generated inside of the object of this class, is also used in the process of
generation plain/text message based on, and derived from the given html code.
This plain text is later used in creation of "multipart/alternative"
MimeMultipart object.
Constructor Summary | |
HtmlAnalyzer(java.io.InputStream content0,
java.lang.String externalPlainText0)
Constructs HtmlAnalyzer from data given from InputStream. |
|
HtmlAnalyzer(java.io.InputStream content0,
java.lang.String path0,
java.lang.String externalPlainText0)
Constructs HtmlAnalyzer from data given from InputStream. |
Method Summary | |
java.lang.String |
getHtmlText()
Returns html/text document passed throught JTidy html parser. |
java.lang.String |
getPlainText()
Returns plain/text representation of given html code document |
java.util.Vector |
getSwappedAdresses()
Returns pairs of swapped resource URL adresses or File paths and appropriate generated Content IDs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HtmlAnalyzer(java.io.InputStream content0, java.lang.String externalPlainText0) throws SMIMEException
content0
- html code given as InputStreamexternalPlainText0
- external plain text message represented as String.
If this argument has value null then autogeneration of text plain message is
performed according to passed html code via content0 argument.
SMIMEException
- caused by its private method analyze().public HtmlAnalyzer(java.io.InputStream content0, java.lang.String path0, java.lang.String externalPlainText0) throws SMIMEException
content0
- html code given as InputStream.path0
- common path used for resolving all resources in html code with
relative path adresses.externalPlainText0
- external plain text message represented as String.
If this argument has value null then autogeneration of text plain message is
performed according to passed html code via content0 argument.
SMIMEException
- caused by its private method analyze().Method Detail |
public java.util.Vector getSwappedAdresses()
public java.lang.String getPlainText()
public java.lang.String getHtmlText() throws SMIMEException
SMIMEException
- caused by non SMIMEException which is:
UnsupportedEncodingException.
|
Enhydra-Oyster 2.1-7 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |