|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.jxr.JavaCodeTransform
public class JavaCodeTransform
Syntax highlights java by turning it into html. A codeviewer object is created and then keeps state as lines are passed in. Each line passed in as java test, is returned as syntax highlighted html text. Users of the class can set how the java code will be highlighted with setter methods. Only valid java lines should be passed in since the object maintains state and may not handle illegal code gracefully. The actual system is implemented as a series of filters that deal with specific portions of the java code. The filters are as follows:
htmlFilter |__ multiLineCommentFilter -> uriFilter |___ inlineCommentFilter |___ stringFilter |___ keywordFilter |___ uriFilter |___ jxrFilter |___ importFilter
Field Summary | |
---|---|
static String |
COMMENT_END
end comment delimiter |
static String |
COMMENT_START
start comment delimiter |
static String |
JAVADOC_COMMENT_END
end javadoc comment delimiter |
static String |
JAVADOC_COMMENT_START
start javadoc comment delimiter |
static boolean |
LINE_NUMBERS
show line numbers |
static String |
RESERVED_WORD_END
end reserved word delimiter |
static String |
RESERVED_WORD_START
start reserved word delimiter |
static String |
STRING_END
end String delimiter |
static String |
STRING_START
start String delimiter |
static String |
STYLESHEET_FILENAME
stylesheet file name |
static char[] |
VALID_URI_CHARS
Specify the only characters that are allowed in a URI besides alpha and numeric characters. |
static String[] |
VALID_URI_SCHEMES
Description of the Field |
Constructor Summary | |
---|---|
JavaCodeTransform(PackageManager packageManager)
Constructor for the JavaCodeTransform object |
Method Summary | |
---|---|
String |
getCurrentFilename()
Get the current filename |
String |
getDestfile()
The current destination file being written |
String |
getFooter()
Gets the footer attribute of the JavaCodeTransform object |
String |
getHeader()
Gets the header attribute of the JavaCodeTransform object |
String |
getPackageRoot()
From the current file, determine the package root based on the current path. |
String |
getRevision()
The current revision of the CVS module |
String |
getSourceDirectory()
The current source directory being read from. |
String |
getSourcefile()
The current source file being read |
void |
setCurrentFilename(String filename)
Set the current filename |
String |
syntaxHighlight(String line)
Now different method of seeing if at end of input stream, closes inputs stream at end. |
void |
transform(Reader sourceReader,
Writer destWriter,
Locale locale,
String inputEncoding,
String outputEncoding,
String javadocLinkDir,
String revision,
boolean showHeader,
boolean showFooter)
This is the public method for doing all transforms of code. |
void |
transform(String sourcefile,
String destfile,
Locale locale,
String inputEncoding,
String outputEncoding,
String javadocLinkDir,
String revision)
This is the public method for doing all transforms of code. |
String |
uriFilter(String line)
Given a line of text, search for URIs and make href's out of them |
String |
xrLine(String line,
String packageName)
Highlight the package in this line. |
String |
xrLine(String line,
String packageName,
ClassType classType)
Cross Reference the given line with JXR returning the new content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean LINE_NUMBERS
public static final String COMMENT_START
public static final String COMMENT_END
public static final String JAVADOC_COMMENT_START
public static final String JAVADOC_COMMENT_END
public static final String STRING_START
public static final String STRING_END
public static final String RESERVED_WORD_START
public static final String RESERVED_WORD_END
public static final String STYLESHEET_FILENAME
public static final String[] VALID_URI_SCHEMES
public static final char[] VALID_URI_CHARS
Constructor Detail |
---|
public JavaCodeTransform(PackageManager packageManager)
packageManager
- PackageManager for this projectMethod Detail |
---|
public final String syntaxHighlight(String line)
line
- String
public String getHeader()
public final String getFooter()
public final void transform(Reader sourceReader, Writer destWriter, Locale locale, String inputEncoding, String outputEncoding, String javadocLinkDir, String revision, boolean showHeader, boolean showFooter) throws IOException
sourceReader
- ReaderdestWriter
- Writerlocale
- StringinputEncoding
- StringoutputEncoding
- StringjavadocLinkDir
- Stringrevision
- StringshowHeader
- booleanshowFooter
- boolean
IOException
public final void transform(String sourcefile, String destfile, Locale locale, String inputEncoding, String outputEncoding, String javadocLinkDir, String revision) throws IOException
sourcefile
- Stringdestfile
- Stringlocale
- StringinputEncoding
- StringoutputEncoding
- StringjavadocLinkDir
- Stringrevision
- String
IOException
public final String getCurrentFilename()
public final void setCurrentFilename(String filename)
filename
- Stringpublic final String getPackageRoot()
public final String uriFilter(String line)
line
- String
public final String getRevision()
public final String getSourcefile()
public final String getDestfile()
public final String getSourceDirectory()
public final String xrLine(String line, String packageName, ClassType classType)
line
- StringpackageName
- StringclassType
- ClassType
public final String xrLine(String line, String packageName)
line
- input linepackageName
- package name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |