|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.betabeans.scroogexhtml.ScroogeXHTMLBase
ScroogeXHTMLBase is the base class for ScroogeXHTML. It defines most of its
properties and implements some low-level methods for debugging and for the
XHTML conversion.
Note that future implementations could change the design and move the
textElementToXHTML method to a helper class, making ScroogeXHTML more
modular.
Field Summary | |
protected boolean |
abortConversion
set this property to true to abort the conversion |
protected boolean |
addOuterHTML
set this property to include surrounding opening and closing html and body tags |
protected java.util.Vector |
afterTextConversionListeners
the text element listeners. |
protected static java.lang.String |
BETABEANS_URL
BetaBeans URL |
protected static java.lang.String |
CONTENT_TYPE_8859_1
ISO 8859-1 content type definition |
protected boolean |
convertFontBGColor
set this property to convert text background colors |
protected boolean |
convertFontColor
set this property to convert text foreground colors |
protected boolean |
convertFontHLColor
set this property to convert text highlight colors |
protected boolean |
convertFontName
set this property to convert font names |
protected boolean |
convertFontSize
set this property to convert font sizes |
protected boolean |
convertFontStyle
set this property to convert font styles (bold, italic, underline...) |
protected boolean |
convertHyperlinks
set this property to call the hyperlink listeners |
protected boolean |
convertSpaces
set this property to convert spaces to tags |
protected int |
curFontCSet
the current font character set |
protected java.lang.StringBuffer |
curFontName
the current font name |
protected int |
curFontNr
the current font number |
protected java.lang.String |
curFontType
the current font type |
protected static java.lang.String |
DEFAULT_FONT_COLOR
default font color (default: black) |
protected static java.lang.String |
DEFAULT_FONT_NAME
default font name (default: 'Times,serif') |
protected static int |
DEFAULT_FONT_SIZE
default font size (default: 12 pt) |
protected java.lang.String |
defaultFontColor
set this property to the default font color of your RTF document. |
protected java.lang.String |
defaultFontName
set this property to the default font name of your RTF document. |
protected int |
defaultFontNr
the default Font number |
protected int |
defaultFontSize
set this property to the default font size of your RTF document. |
protected static java.lang.String |
DOCTYPE_XHTML_10_STRICT
XHTML 1.0 Strict DOCTYPE definition |
protected static java.lang.String |
DOCTYPE_XHTML_10_TRANSITIONAL
XHTML 1.0 Transitional DOCTYPE definition |
protected java.lang.String |
documentTitle
set this property to the XHTML document title |
protected java.lang.String |
headTags
use this property to define additional HTML tags in the <head> section |
protected static java.lang.String |
HTML_OPEN
the standard opening html tag for XHTML documents |
protected java.util.Vector |
hyperlinkListeners
the hyperlink listeners |
protected boolean |
includeDefaultFontStyle
set this property to true to include a CSS definition for the BODY tag, and to reduce the document size |
protected boolean |
includeDocType
set this property to true if you want to include the DOCTYPE tag in the first line of the XHTML document Note that some browsers will check the document for valid XHTML if the DOCTYPE tag is included. |
protected boolean |
includeXMLDeclaration
set this property to true to include the XML declaration line at the top of the document |
protected boolean |
isDebugging
set this property to true to generate a debugging document. |
protected short |
logLevel
use this property to set the log level |
protected java.util.Vector |
logListeners
the logging listeners |
protected java.lang.String |
metaAuthor
use this property to define the Meta tag for the author name |
protected java.lang.String |
metaContentType
use this property to define the Meta tag for the content type |
protected java.lang.String |
metaDate
use this property to define the Meta tag for the date manually |
protected boolean |
metaDateAuto
use this property to define an automatic date tag |
protected java.lang.String |
metaDescription
use this property to define the Meta tag for the description |
protected boolean |
metaGenerator
use this property to define an automatic generator tag |
protected java.lang.String |
metaKeywords
use this property to define the Meta tag for keywords |
protected java.lang.String |
metaTags
use this property to define additional Meta tags |
protected de.betabeans.scroogexhtml.ScroogeXHTMLParser |
parser
the parser object |
protected int |
processed
this read only property contains the number of processed bytes |
protected boolean |
processFontstyle
reserved for optimization |
protected java.util.Vector |
progressListeners
the progress listeners |
protected de.betabeans.scroogexhtml.ScroogeXHTMLReader |
reader
the reader object |
protected java.util.Properties |
replaceFonts
Use this property to define font names which need to be replaced. |
protected static java.lang.String |
SCROOGEXHTML_NAME
Bean Name |
protected static java.lang.String |
SCROOGEXHTML_VERSION
Bean Version |
protected boolean |
showMessages
Deprecated. |
protected java.lang.String |
styleSheetInclude
use this property to define embedded style sheets |
protected java.lang.String |
styleSheetLink
use this property to link to an external style sheet |
protected de.betabeans.scroogexhtml.ScroogeXHTMLWriter |
writer
the writer object |
protected boolean |
xhtmlStrict
set this property to true to generate XHTML 1.0 Strict |
protected static java.lang.String |
XML_DECLARATION
the XML declaration |
Constructor Summary | |
ScroogeXHTMLBase()
|
Method Summary | |
void |
addAfterTextConversionListener(AfterTextConversionListener listener)
Adds an AfterTextConversion listener |
void |
addHyperlinkListener(HyperlinkListener listener)
Adds a feature to the HyperlinkListener attribute of the ScroogeXHTMLBase object |
void |
addLogListener(LogListener listener)
Adds a feature to the LogListener attribute of the ScroogeXHTMLBase object |
void |
addProgressListener(ProgressListener listener)
Adds a feature to the ProgressListener attribute of the ScroogeXHTMLBase object |
protected void |
debug(java.lang.String color,
char debugChar)
write debug string |
protected void |
debug(java.lang.String color,
java.lang.String debugText)
This methods writes a debug string to the output document. |
boolean |
getAbortConversion()
Gets the abortConversion attribute of the ScroogeXHTMLBase object |
boolean |
getAddOuterHTML()
Gets the addOuterHTML attribute of the ScroogeXHTMLBase object |
boolean |
getConvertFontBGColor()
Gets the convertFontBGColor attribute of the ScroogeXHTMLBase object |
boolean |
getConvertFontColor()
Gets the convertFontColor attribute of the ScroogeXHTMLBase object |
boolean |
getConvertFontHLColor()
Gets the convertFontHLColor attribute of the ScroogeXHTMLBase object |
boolean |
getConvertFontName()
Gets the convertFontName attribute of the ScroogeXHTMLBase object |
boolean |
getConvertFontSize()
Gets the convertFontSize attribute of the ScroogeXHTMLBase object |
boolean |
getConvertFontStyle()
Gets the convertFontStyle attribute of the ScroogeXHTMLBase object |
boolean |
getConvertHyperlinks()
Gets the convertHyperlinks attribute of the ScroogeXHTMLBase object |
boolean |
getConvertSpaces()
Gets the convertSpaces attribute of the ScroogeXHTMLBase object |
java.lang.String |
getDefaultFontColor()
Gets the defaultFontColor attribute of the ScroogeXHTMLBase object |
java.lang.String |
getDefaultFontName()
Gets the defaultFontName attribute of the ScroogeXHTMLBase object |
int |
getDefaultFontSize()
Gets the defaultFontSize attribute of the ScroogeXHTMLBase object |
protected java.lang.String |
getDefaultFontStyleDefinition()
Gets the defaultFontStyleDefinition attribute of the ScroogeXHTMLBase object |
java.lang.String |
getDocumentTitle()
Gets the documentTitle attribute of the ScroogeXHTMLBase object |
java.lang.String |
getHeadTags()
Gets the headTags attribute of the ScroogeXHTMLBase object |
boolean |
getIncludeDefaultFontStyle()
Gets the includeDefaultFontStyle attribute of the ScroogeXHTMLBase object |
boolean |
getIncludeDocType()
Gets the includeDocType attribute of the ScroogeXHTMLBase object |
boolean |
getIncludeXMLDeclaration()
Gets the includeXMLDeclaration attribute of the ScroogeXHTMLBase object |
short |
getLogLevel()
Gets the logLevel attribute of the ScroogeXHTMLBase object |
java.lang.String |
getMetaAuthor()
Gets the metaAuthor attribute of the ScroogeXHTMLBase object |
java.lang.String |
getMetaContentType()
Gets the metaContentType attribute of the ScroogeXHTMLBase object |
java.lang.String |
getMetaDate()
Gets the metaDate attribute of the ScroogeXHTMLBase object |
boolean |
getMetaDateAuto()
Gets the metaDateAuto attribute of the ScroogeXHTMLBase object |
java.lang.String |
getMetaDescription()
Gets the metaDescription attribute of the ScroogeXHTMLBase object |
boolean |
getMetaGenerator()
Gets the metaGenerator attribute of the ScroogeXHTMLBase object |
java.lang.String |
getMetaKeywords()
Gets the metaKeywords attribute of the ScroogeXHTMLBase object |
java.lang.String |
getMetaTags()
Gets the metaTags attribute of the ScroogeXHTMLBase object |
int |
getProcessed()
Gets the processed attribute of the ScroogeXHTMLBase object |
java.util.Properties |
getReplaceFonts()
Gets the replaceFonts attribute of the ScroogeXHTMLBase object |
boolean |
getShowMessages()
Gets the showMessages attribute of the ScroogeXHTMLBase object |
java.lang.String |
getStyleSheetInclude()
Gets the styleSheetInclude attribute of the ScroogeXHTMLBase object |
java.lang.String |
getStyleSheetLink()
Gets the styleSheetLink attribute of the ScroogeXHTMLBase object |
java.lang.String |
getVersion()
Gets the version attribute of the ScroogeXHTMLBase object |
boolean |
getXhtmlStrict()
Gets the xhtmlStrict attribute of the ScroogeXHTMLBase object |
boolean |
isDebugMode()
Gets the debugMode attribute of the ScroogeXHTMLBase object |
protected void |
log(short logLevel,
java.lang.String logMessage)
Send log messages to System.out, System.err and all listeners. |
static java.lang.String |
nameAndVersion()
Description of the Method |
protected void |
notifyProgress()
notify all progress listeners |
void |
removeAfterTextConversionListener(AfterTextConversionListener listener)
Remove a AfterTextConversionListener |
void |
removeHyperlinkListener(HyperlinkListener listener)
Remove a HyperlinkListener |
void |
removeLogListener(LogListener listener)
Remove a LogListener |
void |
removeProgressListener(ProgressListener listener)
Remove a ProgressListener |
void |
setAbortConversion(boolean newValue)
Sets the abortConversion attribute of the ScroogeXHTMLBase object |
void |
setAddOuterHTML(boolean newValue)
Sets the addOuterHTML attribute of the ScroogeXHTMLBase object |
void |
setConvertFontBGColor(boolean newValue)
Sets the convertFontBGColor attribute of the ScroogeXHTMLBase object |
void |
setConvertFontColor(boolean newValue)
Sets the convertFontColor attribute of the ScroogeXHTMLBase object |
void |
setConvertFontHLColor(boolean newValue)
Sets the convertFontHLColor attribute of the ScroogeXHTMLBase object |
void |
setConvertFontName(boolean newValue)
Sets the convertFontName attribute of the ScroogeXHTMLBase object |
void |
setConvertFontSize(boolean newValue)
Sets the convertFontSize attribute of the ScroogeXHTMLBase object |
void |
setConvertFontStyle(boolean newValue)
Sets the convertFontStyle attribute of the ScroogeXHTMLBase object |
void |
setConvertHyperlinks(boolean newValue)
Sets the convertHyperlinks attribute of the ScroogeXHTMLBase object |
void |
setConvertSpaces(boolean newValue)
Sets the convertSpaces attribute of the ScroogeXHTMLBase object |
void |
setDebugMode(boolean newValue)
Sets the debugMode attribute of the ScroogeXHTMLBase object |
void |
setDefaultFontColor(java.lang.String newValue)
Sets the defaultFontColor attribute of the ScroogeXHTMLBase object |
void |
setDefaultFontName(java.lang.String newValue)
Sets the defaultFontName attribute of the ScroogeXHTMLBase object |
void |
setDefaultFontSize(int newValue)
Sets the defaultFontSize attribute of the ScroogeXHTMLBase object |
void |
setDocumentTitle(java.lang.String newValue)
Sets the documentTitle attribute of the ScroogeXHTMLBase object |
void |
setHeadTags(java.lang.String newValue)
Sets the headTags attribute of the ScroogeXHTMLBase object |
void |
setIncludeDefaultFontStyle(boolean newValue)
Sets the includeDefaultFontStyle attribute of the ScroogeXHTMLBase object |
void |
setIncludeDocType(boolean newValue)
Sets the includeDocType attribute of the ScroogeXHTMLBase object |
void |
setIncludeXMLDeclaration(boolean newValue)
Sets the includeXMLDeclaration attribute of the ScroogeXHTMLBase object |
void |
setLogLevel(short newValue)
Sets the logLevel attribute of the ScroogeXHTMLBase object |
void |
setMetaAuthor(java.lang.String newValue)
Sets the metaAuthor attribute of the ScroogeXHTMLBase object |
void |
setMetaContentType(java.lang.String newValue)
Sets the metaContentType attribute of the ScroogeXHTMLBase object |
void |
setMetaDate(java.lang.String newValue)
Sets the metaDate attribute of the ScroogeXHTMLBase object |
void |
setMetaDateAuto(boolean newValue)
Sets the metaDateAuto attribute of the ScroogeXHTMLBase object |
void |
setMetaDescription(java.lang.String newValue)
Sets the metaDescription attribute of the ScroogeXHTMLBase object |
void |
setMetaGenerator(boolean newValue)
Sets the metaGenerator attribute of the ScroogeXHTMLBase object |
void |
setMetaKeywords(java.lang.String newValue)
Sets the metaKeywords attribute of the ScroogeXHTMLBase object |
void |
setMetaTags(java.lang.String newValue)
Sets the metaTags attribute of the ScroogeXHTMLBase object |
void |
setReplaceFonts(java.util.Properties newValue)
Sets the replaceFonts attribute of the ScroogeXHTMLBase object |
void |
setShowMessages(boolean newValue)
Sets the showMessages attribute of the ScroogeXHTMLBase object |
void |
setStyleSheetInclude(java.lang.String newValue)
Sets the styleSheetInclude attribute of the ScroogeXHTMLBase object |
void |
setStyleSheetLink(java.lang.String newValue)
Sets the styleSheetLink attribute of the ScroogeXHTMLBase object |
void |
setVersion(java.lang.String value)
Sets the version attribute of the ScroogeXHTMLBase object |
void |
setXhtmlStrict(boolean newValue)
Sets the xhtmlStrict attribute of the ScroogeXHTMLBase object |
protected java.lang.String |
textElementToXHTML(java.lang.String textString,
ScroogeXHTMLDocText textElement)
A ScroogeXHTMLDocText object calls this method to convert itself to XHTML. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String DOCTYPE_XHTML_10_TRANSITIONAL
protected static final java.lang.String DOCTYPE_XHTML_10_STRICT
protected static final java.lang.String CONTENT_TYPE_8859_1
protected static final java.lang.String XML_DECLARATION
protected static final java.lang.String HTML_OPEN
protected static final java.lang.String DEFAULT_FONT_COLOR
protected static final java.lang.String DEFAULT_FONT_NAME
protected static final int DEFAULT_FONT_SIZE
protected static final java.lang.String BETABEANS_URL
protected static final java.lang.String SCROOGEXHTML_NAME
protected static final java.lang.String SCROOGEXHTML_VERSION
protected java.lang.StringBuffer curFontName
protected java.lang.String curFontType
protected int defaultFontNr
protected int curFontNr
protected int curFontCSet
protected de.betabeans.scroogexhtml.ScroogeXHTMLReader reader
protected de.betabeans.scroogexhtml.ScroogeXHTMLParser parser
protected de.betabeans.scroogexhtml.ScroogeXHTMLWriter writer
protected java.util.Vector hyperlinkListeners
protected java.util.Vector logListeners
protected java.util.Vector progressListeners
protected java.util.Vector afterTextConversionListeners
ScroogeXHTMLBase.addAfterTextConversionListener()
, all text element
listener will pass each piece of text to the listener in the
afterTextConversion method after it is converted. It is possible to
modify the text and / or the text properties there.protected boolean processFontstyle
protected boolean abortConversion
protected boolean addOuterHTML
protected boolean convertFontBGColor
protected boolean convertFontHLColor
protected boolean convertFontColor
protected boolean convertFontName
protected boolean convertFontSize
protected boolean convertFontStyle
protected boolean convertHyperlinks
protected boolean convertSpaces
protected java.lang.String defaultFontColor
protected java.lang.String defaultFontName
protected int defaultFontSize
protected java.lang.String documentTitle
protected java.lang.String headTags
protected boolean includeDefaultFontStyle
protected boolean includeDocType
protected boolean includeXMLDeclaration
protected boolean isDebugging
protected short logLevel
protected java.lang.String metaAuthor
protected java.lang.String metaDescription
protected java.lang.String metaContentType
protected boolean metaDateAuto
protected java.lang.String metaDate
protected boolean metaGenerator
protected java.lang.String metaKeywords
protected java.lang.String metaTags
protected int processed
protected java.util.Properties replaceFonts
protected boolean showMessages
protected java.lang.String styleSheetInclude
protected java.lang.String styleSheetLink
protected boolean xhtmlStrict
Constructor Detail |
public ScroogeXHTMLBase()
Method Detail |
public static final java.lang.String nameAndVersion()
public void setShowMessages(boolean newValue)
newValue
- The new showMessages valuepublic void setAbortConversion(boolean newValue)
newValue
- The new abortConversion valuepublic void setConvertFontBGColor(boolean newValue)
newValue
- The new convertFontBGColor valuepublic void setConvertFontHLColor(boolean newValue)
newValue
- The new convertFontHLColor valuepublic void setConvertFontColor(boolean newValue)
newValue
- The new convertFontColor valuepublic void setConvertFontName(boolean newValue)
newValue
- The new convertFontName valuepublic void setConvertFontSize(boolean newValue)
newValue
- The new convertFontSize valuepublic void setConvertFontStyle(boolean newValue)
newValue
- The new convertFontStyle valuepublic void setConvertHyperlinks(boolean newValue)
newValue
- The new convertHyperlinks valuepublic void setConvertSpaces(boolean newValue)
newValue
- The new convertSpaces valuepublic void setAddOuterHTML(boolean newValue)
newValue
- The new addOuterHTML valuepublic void setDebugMode(boolean newValue)
newValue
- The new debugMode valuepublic void setDefaultFontColor(java.lang.String newValue)
newValue
- The new defaultFontColor valuepublic void setDefaultFontName(java.lang.String newValue)
newValue
- The new defaultFontName valuepublic void setDefaultFontSize(int newValue)
newValue
- The new defaultFontSize valuepublic void setDocumentTitle(java.lang.String newValue)
newValue
- The new documentTitle valuepublic void setHeadTags(java.lang.String newValue)
newValue
- The new headTags valuepublic void setIncludeXMLDeclaration(boolean newValue)
newValue
- The new includeXMLDeclaration valuepublic void setIncludeDocType(boolean newValue)
newValue
- The new includeDocType valuepublic void setMetaAuthor(java.lang.String newValue)
newValue
- The new metaAuthor valuepublic void setMetaContentType(java.lang.String newValue)
newValue
- The new metaContentType valuepublic void setMetaDateAuto(boolean newValue)
newValue
- The new metaDateAuto valuepublic void setMetaDescription(java.lang.String newValue)
newValue
- The new metaDescription valuepublic void setMetaGenerator(boolean newValue)
newValue
- The new metaGenerator valuepublic void setMetaKeywords(java.lang.String newValue)
newValue
- The new metaKeywords valuepublic void setMetaTags(java.lang.String newValue)
newValue
- The new metaTags valuepublic void setReplaceFonts(java.util.Properties newValue)
newValue
- The new replaceFonts valuepublic void setStyleSheetLink(java.lang.String newValue)
newValue
- The new styleSheetLink valuepublic void setStyleSheetInclude(java.lang.String newValue)
newValue
- The new styleSheetInclude valuepublic void setIncludeDefaultFontStyle(boolean newValue)
newValue
- The new includeDefaultFontStyle valuepublic void setMetaDate(java.lang.String newValue)
newValue
- The new metaDate valuepublic void setXhtmlStrict(boolean newValue)
newValue
- The new xhtmlStrict valuepublic void setLogLevel(short newValue)
newValue
- The new logLevel valuepublic void setVersion(java.lang.String value)
value
- The new version valuepublic boolean getShowMessages()
public boolean getAbortConversion()
public boolean getConvertHyperlinks()
public boolean getConvertFontBGColor()
public java.lang.String getVersion()
public boolean getConvertFontHLColor()
public short getLogLevel()
public boolean getConvertFontColor()
public boolean getConvertFontName()
public boolean getConvertFontSize()
public boolean getConvertFontStyle()
public boolean getConvertSpaces()
public boolean getAddOuterHTML()
public boolean isDebugMode()
public java.lang.String getDefaultFontColor()
public java.lang.String getDefaultFontName()
public boolean getIncludeDefaultFontStyle()
public int getDefaultFontSize()
public java.lang.String getHeadTags()
public boolean getIncludeDocType()
public boolean getIncludeXMLDeclaration()
public java.lang.String getMetaAuthor()
public java.lang.String getMetaContentType()
public boolean getMetaDateAuto()
public java.lang.String getMetaDate()
public java.lang.String getMetaDescription()
public boolean getMetaGenerator()
public java.lang.String getMetaKeywords()
public java.lang.String getMetaTags()
public java.util.Properties getReplaceFonts()
public java.lang.String getStyleSheetLink()
public java.lang.String getStyleSheetInclude()
public boolean getXhtmlStrict()
public java.lang.String getDocumentTitle()
public int getProcessed()
public void addProgressListener(ProgressListener listener)
listener
- The feature to be added to the ProgressListener
attributepublic void addLogListener(LogListener listener)
listener
- The feature to be added to the LogListener attributepublic void removeProgressListener(ProgressListener listener)
listener
- Description of Parameterpublic void removeLogListener(LogListener listener)
listener
- Description of Parameterpublic void addHyperlinkListener(HyperlinkListener listener)
listener
- The feature to be added to the HyperlinkListener
attributepublic void removeHyperlinkListener(HyperlinkListener listener)
listener
- Description of Parameterpublic void addAfterTextConversionListener(AfterTextConversionListener listener)
listener
- The listener to be added to the
AfterTextConversionListener attributepublic void removeAfterTextConversionListener(AfterTextConversionListener listener)
listener
- Description of Parameterprotected java.lang.String getDefaultFontStyleDefinition()
protected void debug(java.lang.String color, java.lang.String debugText)
color
- the debug string colordebugText
- Description of Parameterprotected void debug(java.lang.String color, char debugChar)
color
- the debug string colordebugChar
- the debugging informationprotected void notifyProgress()
protected java.lang.String textElementToXHTML(java.lang.String textString, ScroogeXHTMLDocText textElement)
textString
- Description of ParametertextElement
- Description of Parameterprotected void log(short logLevel, java.lang.String logMessage)
logLevel
- the log levellogMessage
- the log message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |