com.opencms.htmlconverter
Interface I_CmsHtmlConverterInterface

All Known Implementing Classes:
CmsHtmlConverter

public interface I_CmsHtmlConverterInterface

Interface definition of CmsHtmlConverter with declaration of necessary methods.

Version:
1.0
Author:
Andreas Zahner

Method Summary
 boolean converterConfigured()
          Checks whether CmsHtmlConverter is already configured or not
 void convertHTML(Reader in, Writer out)
          Transforms HTML code into user defined output
 String convertHTML(String inString)
          Transforms HTML code into user defined output
 String getConverterConfFile()
          If defined, returns filename of CmsHtmlConverter configuration file
 int getNumberErrors()
          returns number of found errors in last parsed html code
 String getTidyConfFile()
          If defined, returns JTidy configuration filename
 boolean hasErrors(InputStream input)
          Checks if HTML code has errors
 boolean hasErrors(String inString)
          Checks if HTML code has errors
 void setConverterConfFile(String confFile)
          Configures CmsHtmlConverter from file
 void setConverterConfString(String configuration)
          Configures CmsHtmlConverter from string
 void setTidyConfFile(String fileName)
          Configures JTidy from file
 void showErrors(InputStream input, OutputStream output)
          Checks if HTML code has errors and lists errors
 String showErrors(String inString)
          Checks if HTML code has errors and lists errors
 boolean tidyConfigured()
          Checks whether JTidy is already configured or not
 

Method Detail

setTidyConfFile

public void setTidyConfFile(String fileName)
Configures JTidy from file

Parameters:
fileName - filename of JTidy configuration file

getTidyConfFile

public String getTidyConfFile()
If defined, returns JTidy configuration filename

Returns:
filename of JTidy configuration file

tidyConfigured

public boolean tidyConfigured()
Checks whether JTidy is already configured or not

Returns:
true if JTidy configuration file is set, otherwise false

setConverterConfFile

public void setConverterConfFile(String confFile)
Configures CmsHtmlConverter from file

Parameters:
confFile - filename of configuration file

setConverterConfString

public void setConverterConfString(String configuration)
Configures CmsHtmlConverter from string

Parameters:
configuration - string with CmsHtmlConverter configuration

getConverterConfFile

public String getConverterConfFile()
If defined, returns filename of CmsHtmlConverter configuration file

Returns:
filename of configuration file

converterConfigured

public boolean converterConfigured()
Checks whether CmsHtmlConverter is already configured or not

Returns:
true if CmsHtmlConverter configuration is set, otherwise false

hasErrors

public boolean hasErrors(String inString)
Checks if HTML code has errors

Parameters:
inString - String with HTML code
Returns:
true if errors were detected, otherwise false

hasErrors

public boolean hasErrors(InputStream input)
Checks if HTML code has errors

Returns:
true if errors were detected, otherwise false

getNumberErrors

public int getNumberErrors()
returns number of found errors in last parsed html code

Returns:
int with number of errors

showErrors

public String showErrors(String inString)
Checks if HTML code has errors and lists errors

Parameters:
inString - String with HTML code
Returns:
String with detected errors

showErrors

public void showErrors(InputStream input,
                       OutputStream output)
Checks if HTML code has errors and lists errors

Parameters:
input - InputStream with HTML code
output - OutputStream with detected errors

convertHTML

public String convertHTML(String inString)
Transforms HTML code into user defined output

Parameters:
inString - String with HTML code
Returns:
String with transformed code

convertHTML

public void convertHTML(Reader in,
                        Writer out)
Transforms HTML code into user defined output