fi.karppinen.xml
Class MarkdownTagSoupInputSource

java.lang.Object
  extended by org.xml.sax.InputSource
      extended by fi.karppinen.xml.MarkdownTagSoupInputSource

public class MarkdownTagSoupInputSource
extends InputSource

Makes it possible to feed Markdown source to markdown.pl and then to TagSoup. The system property fi.karppinen.xml.markdownexecutable should contain the absolute path to markdown.pl.

Version:
$Id: MarkdownTagSoupInputSource.java,v 1.1 2006/10/30 19:57:09 hsivonen Exp $
Author:
hsivonen

Field Summary
private static String[] ARGS
           
private  Process markdown
           
 
Constructor Summary
MarkdownTagSoupInputSource(Reader content)
          The reader constructor.
MarkdownTagSoupInputSource(String content)
          The string constructor.
 
Method Summary
 InputStream getByteStream()
           
 Reader getCharacterStream()
           
 String getEncoding()
           
private  void initWithReader(Reader content)
           
private  void initWithString(String content)
           
 void setByteStream(InputStream arg0)
           
 void setCharacterStream(Reader arg0)
           
 void setEncoding(String arg0)
           
private  void startProcess()
           
private  OutputStream streamToMarkdown()
           
 
Methods inherited from class org.xml.sax.InputSource
getPublicId, getSystemId, setPublicId, setSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARGS

private static final String[] ARGS

markdown

private Process markdown
Constructor Detail

MarkdownTagSoupInputSource

public MarkdownTagSoupInputSource(String content)
                           throws IOException
The string constructor.

Parameters:
content - a string containing Markdown source
Throws:
IOException - if something goes wrong

MarkdownTagSoupInputSource

public MarkdownTagSoupInputSource(Reader content)
                           throws IOException
The reader constructor.

Parameters:
content - a reader reading Markdown source
Throws:
IOException - if something goes wrong
Method Detail

startProcess

private void startProcess()
                   throws IOException
Throws:
IOException

initWithString

private void initWithString(String content)
                     throws IOException
Parameters:
content -
Throws:
IOException

initWithReader

private void initWithReader(Reader content)
                     throws IOException
Parameters:
content -
Throws:
IOException

streamToMarkdown

private OutputStream streamToMarkdown()

getByteStream

public InputStream getByteStream()
Overrides:
getByteStream in class InputSource
See Also:
InputSource.getByteStream()

getCharacterStream

public Reader getCharacterStream()
Overrides:
getCharacterStream in class InputSource
See Also:
InputSource.getCharacterStream()

getEncoding

public String getEncoding()
Overrides:
getEncoding in class InputSource
See Also:
InputSource.getEncoding()

setByteStream

public void setByteStream(InputStream arg0)
Overrides:
setByteStream in class InputSource
See Also:
InputSource.setByteStream(java.io.InputStream)

setCharacterStream

public void setCharacterStream(Reader arg0)
Overrides:
setCharacterStream in class InputSource
See Also:
InputSource.setCharacterStream(java.io.Reader)

setEncoding

public void setEncoding(String arg0)
Overrides:
setEncoding in class InputSource
See Also:
InputSource.setEncoding(java.lang.String)