Package org.codelibs.jhighlight.renderer
Interface Renderer
-
- All Superinterfaces:
Renderer
- All Known Implementing Classes:
CppXhtmlRenderer
,GroovyXhtmlRenderer
,JavaScriptXhtmlRenderer
,JavaXhtmlRenderer
,XhtmlRenderer
,XmlXhtmlRenderer
public interface Renderer extends Renderer
Provides interface to render the source code highlighting.- Since:
- 1.0
- Version:
- $Revision: 3108 $
- Author:
- Geert Bevin (gbevin[remove] at uwyn dot com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
highlight(String name, InputStream in, OutputStream out, String encoding, boolean fragment)
Transforms source code that's provided through anInputStream
to highlighted syntax and writes it back to anOutputStream
.String
highlight(String name, String in, String encoding, boolean fragment)
Transforms source code that's provided through aString
to highlighted syntax and returns it as aString
.
-
-
-
Method Detail
-
highlight
void highlight(String name, InputStream in, OutputStream out, String encoding, boolean fragment) throws IOException
Transforms source code that's provided through anInputStream
to highlighted syntax and writes it back to anOutputStream
.- Specified by:
highlight
in interfaceRenderer
- Parameters:
name
- The name of the source file.in
- The input stream that provides the source code that needs to be transformed.out
- The output stream to which to result should be written.encoding
- The encoding that will be used to read and write the text.fragment
-true
if the result should be a fragment; orfalse
if it should be a complete document- Throws:
IOException
- Since:
- 1.0
- See Also:
highlight(String, String, String, boolean)
-
highlight
String highlight(String name, String in, String encoding, boolean fragment) throws IOException
Transforms source code that's provided through aString
to highlighted syntax and returns it as aString
.- Specified by:
highlight
in interfaceRenderer
- Parameters:
name
- The name of the source file.in
- The input string that provides the source code that needs to be transformed.encoding
- The encoding that will be used to read and write the text.fragment
-true
if the result should be a fragment; orfalse
if it should be a complete document- Returns:
- the highlighted source code as a string
- Throws:
IOException
- Since:
- 1.0
- See Also:
highlight(String, InputStream, OutputStream, String, boolean)
-
-