|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--com.guiffy.inside.GuiffyReport
/* Class GuiffyReport is the compare report engine for generating Guiffy compare reports within Java applications. GuiffyReport extends Thread.
Guiffy compares source(text) files of any type - supports Unicode character set. And, Guiffy accepts all 3 forms of end-of-line.
Example code :
The following instantiates a GuiffyReport object
with all its properties set to default.
import com.guiffy.inside.*; ... GuiffyReport gRep = new GuiffyReport( );Then, we set GuiffyReport compare file names and the report file name.
gRep.set1stFile(firFileName); gRep.set2ndFile(secFileName); gRep.setRepFile(repFileName);Then, we run GuiffyReport.
gRep.start();And, wait for GuiffyReport Thread to finish
try { gRep.join(); } catch (InterruptedException e) { System.err.println ( e.toString() ); }Then, we check the return status.
int rstat = gRep.getStatus(); if (rstat != GuiffyReport.OK) { System.err.println( "GuiffyReport error: status=" + rstat); System.exit(rstat); }OR you can use the Exit Hook technique:
GuiffyHook grhook = new GuiffyHook(); grhook.setGuiffyReport(gRep); gRep.setGuiffyExit(grhook); gRep.start();Then, (in the exitHook) we check the return status.
if(ghgr != null) { int rstat = ghgr.getStatus(); if (rstat != GuiffyReport.OK) { System.err.println( "GuiffyReport error: status=" + rstat); System.exit(rstat); }And, if the Report ran, we get the Report metrics.
System.err.println("Changes=" + ghgr.getNumberofChanges() ); System.err.println("Matching=" + ghgr.getNumberofLinesMatching() ); System.err.println("Deleted=" + ghgr.getNumberofLinesDeleted() ); System.err.println("Inserted=" + ghgr.getNumberofLinesInserted() ); }
Thread
Field Summary | |
static int |
CANT_FIND_1STFILE
|
static int |
CANT_FIND_2NDFILE
|
static int |
CANT_READ_1STFILE
|
static int |
CANT_READ_2NDFILE
|
static int |
CANT_WRIT_RESFILE
|
static int |
ENCODING_NOTAVAIL
|
static int |
ERRORIS_EXCEPTION
|
static int |
EVALPER_ISEXPIRED
|
static int |
ISAFOLDER_1STFILE
|
static int |
ISAFOLDER_2NDFILE
|
static int |
OK
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY |
Constructor Summary | |
GuiffyReport()
|
Method Summary | |
int |
getNumberofChanges()
Returns the number of change blocks. |
int |
getNumberofLinesDeleted()
Returns the number of lines deleted. |
int |
getNumberofLinesInserted()
Returns the number of lines inserted. |
int |
getNumberofLinesMatching()
Returns the number of lines matching. |
int |
getStatus()
Returns Status of GuiffyReport Run. |
void |
run()
|
void |
set1stFile(java.lang.String firstname)
Sets the 1st File Name. |
void |
set1stFileEncoding(java.lang.String encods)
Sets File Encoding for 1st files. |
void |
set1stHTMLTableWriter(java.io.Writer htmlwrer)
Sets the 1stTableHTML Writer. |
void |
set1stReader(java.io.Reader firstrder)
Sets the 1st Reader. |
void |
set2ndFile(java.lang.String secndname)
Sets the 2nd File Name. |
void |
set2ndFileEncoding(java.lang.String encods)
Sets File Encoding for 2nd files. |
void |
set2ndHTMLTableWriter(java.io.Writer htmlwrer)
Sets the 2ndTableHTML Writer. |
void |
set2ndReader(java.io.Reader secndrder)
Sets the 2nd Reader. |
void |
setBackgroundColor(java.awt.Color baccol)
Sets the Background color option(Matching, Inserted, and Deleted). |
void |
setChangedBackgroundColor(java.awt.Color chnbac)
Sets the Changed background color option. |
void |
setDeletesBackgroundColor(java.awt.Color delbac)
Sets the Deleted background color option. |
void |
setDeletesColor(java.awt.Color delcol)
Sets the Deleted text foreground color option. |
void |
setDeletesFont(java.awt.Font delfon)
Sets the Deleted text font option. |
void |
setEOLOption(java.lang.String eolopt)
Sets Write EOLs option for Saved files. |
void |
setEscapeTags(boolean esctag)
Sets Escape Tags option (for compare htlm reports) true or false. |
void |
setFileEncoding(java.lang.String encods)
Sets File Encoding for 1st and 2nd files. |
void |
setFillerBackgroundColor(java.awt.Color filbac)
Sets the Filler background color option. |
void |
setFillerColor(java.awt.Color filcol)
Sets the Filler foreground color option. |
void |
setFillerFont(java.awt.Font filfon)
Sets the Fillers font option. |
void |
setGuiffyExit(GuiffyExit hook)
Sets the GuiffyExit hook of the GuiffyReport If set to null, a previously added GuiffyExit hook will be removed. |
void |
setH1(java.lang.String header)
Sets the 1st FileName header. |
void |
setH2(java.lang.String header)
Sets the 2nd FileName header. |
void |
setIgnoreBlank(boolean ignblk)
Sets IgnoreBlanklines option true or false. |
void |
setIgnoreCase(boolean igncas)
Sets IgnoreCase option true or false. |
void |
setIgnoreEmbeddedWhiteSpace(boolean igs)
Sets Ignore Embedded type Whitespace flag. |
void |
setIgnoreField(int begcol,
int endcol)
Sets IgnoreField option columns xxx thru yyy. |
void |
setIgnoreField2(int begcol,
int endcol)
Sets IgnoreField2 option columns xxx thru yyy. |
void |
setIgnoreLeadingWhiteSpace(boolean igs)
Sets Ignore Leading type Whitespace flag. |
void |
setIgnoreTrailingWhiteSpace(boolean igs)
Sets Ignore Trailing type Whitespace flag. |
void |
setIgnoreWhitespace(boolean ignwhi)
Sets IgnoreWhitespace of all types option true or false. |
void |
setInsertsBackgroundColor(java.awt.Color insbac)
Sets the Inserted background color option. |
void |
setInsertsColor(java.awt.Color inscol)
Sets the Inserted text foreground color option. |
void |
setInsertsFont(java.awt.Font insfon)
Sets the Inserted text font option. |
void |
setLineNumBackgroundColor(java.awt.Color linbac)
Sets the LineNumbers background color option. |
void |
setLineNumColor(java.awt.Color lincol)
Sets the LineNumbers foreground color option. |
void |
setLineNumFont(java.awt.Font linfon)
Sets the LineNumbers font option. |
void |
setMatchingBackgroundColor(java.awt.Color matbac)
Sets the Matching background color option. |
void |
setMatchingColor(java.awt.Color matcol)
Sets the Matching text foreground color option. |
void |
setMatchingFont(java.awt.Font matfon)
Sets the Matching text font option. |
void |
setMinimumBlocksDiff(boolean minblk)
Sets Minimize Blocks Changed Diff option true or false. |
void |
setOEMLicenseKey(java.io.ByteArrayInputStream bais)
Set License Key based on special OEMKey ByteArrayInputStream |
void |
setQtRexs(java.lang.String[] rxs,
int rxi)
Sets Quietly Ignore Regular Expressions list. |
void |
setRepFile(java.lang.String htmlrname)
Sets the HTML Report File Name. |
void |
setRepWriter(java.io.Writer htmlwrer)
Sets the HTML Report Writer. |
void |
setSaveEncoding(java.lang.String encods)
Sets Save Encoding for MergeResult file. |
void |
setShowContextDiffs(boolean shocxt)
Sets Show Context Differences option true or false. |
void |
setShowContextKB(int conkbs)
Sets Show Context When KB Size option. |
void |
setShowContextSize(int conlns)
Sets Show Context Differences Size option. |
void |
setShowContextWhen(boolean shocxt)
Sets Show Context When option true or false. |
void |
setShowGutter(boolean shogut)
Sets Show Gutter option (for compare htlm reports) true or false. |
void |
setShowIgnoredDiffs(boolean sig)
Sets Show Ignored Diffs default is false. |
void |
setShowInLineDiffs(boolean shoinl)
Sets Show InLine Differences option true or false. |
void |
setShowInLinePercent(int shopct)
Sets Show InLine Differences < Percent of line value. |
void |
setShowLineNumbers(boolean sholno)
Sets Show Line Numbers option true or false. |
void |
setShowOnlyDiffs(boolean shonly)
Sets Show Only Differences option true or false. |
void |
setTabSize(int tabsiz)
Sets Tab Size option. |
void |
setViewSplitVertical(boolean viwver)
Sets View Split Vertical option true or false. |
void |
setViewTogether(boolean viwtog)
Sets View Together option true or false. |
Methods inherited from class java.lang.Thread |
activeCount,
checkAccess,
countStackFrames,
currentThread,
destroy,
dumpStack,
enumerate,
getContextClassLoader,
getName,
getPriority,
getThreadGroup,
interrupt,
interrupted,
isAlive,
isDaemon,
isInterrupted,
join,
join,
join,
resume,
setContextClassLoader,
setDaemon,
setName,
setPriority,
sleep,
sleep,
start,
stop,
stop,
suspend,
toString,
yield |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int OK
public static final int CANT_FIND_1STFILE
public static final int CANT_FIND_2NDFILE
public static final int CANT_READ_1STFILE
public static final int CANT_READ_2NDFILE
public static final int CANT_WRIT_RESFILE
public static final int ISAFOLDER_1STFILE
public static final int ISAFOLDER_2NDFILE
public static final int ENCODING_NOTAVAIL
public static final int ERRORIS_EXCEPTION
public static final int EVALPER_ISEXPIRED
Constructor Detail |
public GuiffyReport()
Method Detail |
public void run()
public int getStatus()
OK = 0; CANT_FIND_1STFILE = 1; // Can't find 1st file CANT_FIND_2NDFILE = 2; // Can't find 2nd file CANT_READ_1STFILE = 4; // Can't read 1st file CANT_READ_2NDFILE = 5; // Can't read 2nd file CANT_WRIT_RESFILE = 7; // Can't write/create Result file ENCODING_NOTAVAIL = 11; // File Encoding specified NA ERRORIS_EXCEPTION = 12; // Exception // (perhaps, encoding format) EVALPER_ISEXPIRED = 13; // Evaluation period has expired
public int getNumberofChanges()
public int getNumberofLinesMatching()
public int getNumberofLinesDeleted()
public int getNumberofLinesInserted()
public void setGuiffyExit(GuiffyExit hook)
GuiffyExit
public void setOEMLicenseKey(java.io.ByteArrayInputStream bais)
public void set1stFile(java.lang.String firstname)
firstname
- the 1st File name as a complete path.public void set2ndFile(java.lang.String secndname)
secndname
- the 2nd File name as a complete path.public void set1stReader(java.io.Reader firstrder)
firstrder
- the 1st Reader.public void set2ndReader(java.io.Reader secndrder)
secndrder
- the 2nd Reader.public void setRepFile(java.lang.String htmlrname)
htmlrname
- the HTML Report File name as a complete path.public void setRepWriter(java.io.Writer htmlwrer)
htmlwrer
- the Result Writer.public void set1stHTMLTableWriter(java.io.Writer htmlwrer)
htmlwrer
- the Result Writer.public void set2ndHTMLTableWriter(java.io.Writer htmlwrer)
htmlwrer
- the Result Writer.public void setH1(java.lang.String header)
header
- the 1st filename header.public void setH2(java.lang.String header)
header
- the 2nd filename header.public void setFileEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void set1stFileEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void set2ndFileEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void setSaveEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void setIgnoreCase(boolean igncas)
igncas
- the boolean value that determines whether case differences
are ignored during the compare.public void setIgnoreField(int begcol, int endcol)
begcol
- the ignore field's beginning columnendcol
- the ignore field's ending column
Tabs are expanded according to the TabSize value prior to
ignoring a fieldpublic void setIgnoreField2(int begcol, int endcol)
begcol
- the ignore field's beginning columnendcol
- the ignore field's ending column
Tabs are expanded according to the TabSize value prior to
ignoring a fieldpublic void setIgnoreWhitespace(boolean ignwhi)
ignwhi
- the boolean value that determines whether whitespace
differences are ignored during the compare.public void setIgnoreLeadingWhiteSpace(boolean igs)
igs
- the boolean value that determines whether leading whitespace
differences are ignored during the compare.public void setIgnoreEmbeddedWhiteSpace(boolean igs)
igs
- the boolean value that determines whether embedded whitespace
differences are ignored during the compare.public void setIgnoreTrailingWhiteSpace(boolean igs)
igs
- the boolean value that determines whether trailing whitespace
differences are ignored during the compare.public void setIgnoreBlank(boolean ignblk)
ignblk
- the boolean value that determines whether blankline
differences are ignored during the compare.public void setQtRexs(java.lang.String[] rxs, int rxi)
rxs
- the String array of ignore regular expressions.rxi
- the number of regular expressions.public void setTabSize(int tabsiz)
tabsiz
- the int value that specifies tab sizes.
Tabs are expanded for the Ignore Field.public void setEOLOption(java.lang.String eolopt)
eolopt
- the String value of "DOS", "MacOS" or "Unix" specifies
the format for writing End-Of-Lines in Saved Files.public void setShowOnlyDiffs(boolean shonly)
shonly
- the boolean value that specifies to show only the
differences in compare views.public void setShowContextDiffs(boolean shocxt)
shocxt
- the boolean value that specifies to show context around
differences in compare views.public void setShowContextSize(int conlns)
conlns
- the number of lines of context to show before and after
differences. If less than 1, default of 10 is used.
If greater than 48, value of 48 is used.public void setShowContextWhen(boolean shocxt)
shocxt
- the boolean value that specifies to show context when
files are > specified KB in size.public void setShowContextKB(int conkbs)
conkbs
- show context when file is > KB.
If less than 1, default of 400 is used.public void setShowInLineDiffs(boolean shoinl)
shoinl
- the boolean value that specifies to show InLine diffs
in compare views.public void setShowInLinePercent(int shopct)
shopct
- the int value that specifies to show InLine diffs
when < percent of line length.public void setShowIgnoredDiffs(boolean sig)
sig
- the boolean value for show ignored diffspublic void setShowLineNumbers(boolean sholno)
sholno
- the boolean value that specifies to show Line Numbers
in compare views.public void setShowGutter(boolean shogut)
shogut
- the boolean value that specifies to show Gutter
in compare report.public void setEscapeTags(boolean esctag)
esctag
- the boolean value that specifies to escape tags
in compare report.public void setMatchingFont(java.awt.Font matfon)
matfon
- the Font for Matching text.public void setInsertsFont(java.awt.Font insfon)
insfon
- the Font for Inserted text.public void setDeletesFont(java.awt.Font delfon)
delfon
- the Font for Deleted text.public void setLineNumFont(java.awt.Font linfon)
linfon
- the Font for LineNumbers.public void setFillerFont(java.awt.Font filfon)
filfon
- the Font for Fillers.public void setBackgroundColor(java.awt.Color baccol)
baccol
- the Color for Backgrounds.public void setMatchingColor(java.awt.Color matcol)
matcol
- the Color for Matching text foreground.public void setMatchingBackgroundColor(java.awt.Color matbac)
matbac
- the Color for Matching background.public void setInsertsColor(java.awt.Color inscol)
inscol
- the Color for Inserted text foreground.public void setInsertsBackgroundColor(java.awt.Color insbac)
insbac
- the Color for Inserted background.public void setDeletesColor(java.awt.Color delcol)
delcol
- the Color for Deleted text foreground.public void setDeletesBackgroundColor(java.awt.Color delbac)
delbac
- the Color for Deleted background.public void setChangedBackgroundColor(java.awt.Color chnbac)
chnbac
- the Color for Changed background.public void setLineNumColor(java.awt.Color lincol)
lincol
- the Color for LineNumbers foreground.public void setLineNumBackgroundColor(java.awt.Color linbac)
linbac
- the Color for LineNumbers background.public void setFillerColor(java.awt.Color filcol)
filcol
- the Color for Filler foreground.public void setFillerBackgroundColor(java.awt.Color filbac)
filbac
- the Color for Filler background.public void setViewTogether(boolean viwtog)
viwtog
- the boolean value that specifies to show differences
together in one compare view.public void setViewSplitVertical(boolean viwver)
viwver
- the boolean value that specifies to show differences
split vertically side-by-side in compare views.public void setMinimumBlocksDiff(boolean minblk)
minlin
- the boolean value that determines which diff
algorithm is used - Minimize Lines/Blocks changed.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |