Package openbook.tools.converter
Class SourceRenderer
- java.lang.Object
-
- openbook.tools.converter.SourceRenderer
-
- Direct Known Subclasses:
Java2HTMLConverter
,Java2TextConverter
public abstract class SourceRenderer extends java.lang.Object
Renders Java Source Code.- Author:
- Pinaki Poddar
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CURRENT_DIRECTORY
static java.lang.String
DOT
static char
FORWARD_SLASH
-
Constructor Summary
Constructors Constructor Description SourceRenderer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TokenRenderer
createRenderer(CommandProcessor options, java.io.File outFile)
java.io.File
getDestinationDirectory()
protected java.io.InputStream
getInputStream(java.io.File srcDir, java.lang.String path)
Gets the input stream.java.io.File
getSourceDirectory()
abstract void
registerOptions(CommandProcessor options)
protected void
run(java.lang.String[] args)
Renders the given source files.protected void
verbose(java.lang.String s)
protected void
warn(java.lang.String s)
-
-
-
Field Detail
-
FORWARD_SLASH
public static final char FORWARD_SLASH
- See Also:
- Constant Field Values
-
DOT
public static final java.lang.String DOT
- See Also:
- Constant Field Values
-
CURRENT_DIRECTORY
public static final java.lang.String CURRENT_DIRECTORY
- See Also:
- Constant Field Values
-
-
Method Detail
-
run
protected final void run(java.lang.String[] args) throws java.lang.Exception
Renders the given source files. The syntax of the command is
$ java SourceRenderer [options] files
For example,$ java SourceRenderer -stylesheet mystyle.css -sourcepath test -d generated/html acme/foo/SomeClass.java
Recognized options are
-format
the format of the converted output. Recognized monikers are html
andtext
. A fully qualified class name that implementsTokenRenderer
is allowed. Default ishtml
-sourcepath
the root of the source files. Default is the current directory -d
the root of the generated files. Default is the current directory -someProperty
will configure the renderer if a bean-style setter methodsetSomeProperty(String|boolean|int)
is available. See available documentation on the specificrenderer
.
Stylesheet file must be under destination directory.-stylesheet
is relative to destination directory.- Parameters:
args
- command-line arguments.- Throws:
java.lang.Exception
-
getDestinationDirectory
public java.io.File getDestinationDirectory()
-
getSourceDirectory
public java.io.File getSourceDirectory()
-
registerOptions
public abstract void registerOptions(CommandProcessor options)
-
createRenderer
public abstract TokenRenderer createRenderer(CommandProcessor options, java.io.File outFile)
-
getInputStream
protected java.io.InputStream getInputStream(java.io.File srcDir, java.lang.String path)
Gets the input stream.- Parameters:
srcDir
- the root source directory.path
- the path to input file.
-
verbose
protected void verbose(java.lang.String s)
-
warn
protected void warn(java.lang.String s)
-
-