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.ObjectRenders Java Source Code.- Author:
- Pinaki Poddar
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCURRENT_DIRECTORYstatic java.lang.StringDOTstatic charFORWARD_SLASH
-
Constructor Summary
Constructors Constructor Description SourceRenderer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TokenRenderercreateRenderer(CommandProcessor options, java.io.File outFile)java.io.FilegetDestinationDirectory()protected java.io.InputStreamgetInputStream(java.io.File srcDir, java.lang.String path)Gets the input stream.java.io.FilegetSourceDirectory()abstract voidregisterOptions(CommandProcessor options)protected voidrun(java.lang.String[] args)Renders the given source files.protected voidverbose(java.lang.String s)protected voidwarn(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.ExceptionRenders 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
Besides these options, a renderer can accept more options. Any option-format
the format of the converted output. Recognized monikers are htmlandtext. A fully qualified class name that implementsTokenRendereris 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 -somePropertywill 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)
-
-