org.eclipse.mylar.internal.tasks.ui.util
Class HTML2TextReader
java.lang.Object
java.io.Reader
org.eclipse.mylar.internal.tasks.ui.util.SingleCharReader
org.eclipse.mylar.internal.tasks.ui.util.SubstitutionTextReader
org.eclipse.mylar.internal.tasks.ui.util.HTML2TextReader
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Readable
public class HTML2TextReader
- extends SubstitutionTextReader
COPY OF: org.eclipse.jface.internal.text.html.HTML2TextReader
Fields inherited from class java.io.Reader |
lock |
Constructor Summary |
HTML2TextReader(java.io.Reader reader,
org.eclipse.jface.text.TextPresentation presentation)
Transforms the HTML text from the reader to formatted text. |
Methods inherited from class java.io.Reader |
mark, markSupported, read, read, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EMPTY_STRING
private static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
fgEntityLookup
private static final java.util.Map fgEntityLookup
fgTags
private static final java.util.Set fgTags
fCounter
private int fCounter
fTextPresentation
private org.eclipse.jface.text.TextPresentation fTextPresentation
fBold
private int fBold
fStartOffset
private int fStartOffset
fInParagraph
private boolean fInParagraph
fIsPreformattedText
private boolean fIsPreformattedText
fIgnore
private boolean fIgnore
HTML2TextReader
public HTML2TextReader(java.io.Reader reader,
org.eclipse.jface.text.TextPresentation presentation)
- Transforms the HTML text from the reader to formatted text.
- Parameters:
reader
- the readerpresentation
- If not null
, formattings will be applied to
the presentation.
read
public int read()
throws java.io.IOException
- Overrides:
read
in class SubstitutionTextReader
- Throws:
java.io.IOException
- See Also:
Reader.read()
startBold
protected void startBold()
startPreformattedText
protected void startPreformattedText()
stopPreformattedText
protected void stopPreformattedText()
stopBold
protected void stopBold()
computeSubstitution
protected java.lang.String computeSubstitution(int c)
throws java.io.IOException
- Description copied from class:
SubstitutionTextReader
- Computes the substitution for the given character and if necessary
subsequent characters. Implementation should use
nextChar
to read subsequent characters.
- Specified by:
computeSubstitution
in class SubstitutionTextReader
- Parameters:
c
- the character to be substituted
- Returns:
- the substitution for
c
- Throws:
java.io.IOException
- in case computing the substitution fails
html2Text
private java.lang.String html2Text(java.lang.String html)
processHTMLTag
private java.lang.String processHTMLTag()
throws java.io.IOException
- Throws:
java.io.IOException
processPreformattedText
private java.lang.String processPreformattedText(int c)
unread
private void unread(int ch)
throws java.io.IOException
- Throws:
java.io.IOException
entity2Text
protected java.lang.String entity2Text(java.lang.String symbol)
processEntity
private java.lang.String processEntity()
throws java.io.IOException
- Throws:
java.io.IOException