|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.infinityloop.upcast.exportfilters.ExportFilter
de.infinityloop.upcast.exportfilters.RichExportFilter
de.infinityloop.upcast.exportfilters.ExportFilterBase
public abstract class ExportFilterBase
Field Summary | |
---|---|
protected int |
gprefIndentationFactor
specified indentation step size. |
protected java.lang.String |
gprefNamespacePrefix
The namespace prefix to use when outputting with namespace. |
protected boolean |
gprefPrettyPrint
a boolean indicating whether pretty printing is to be performed. |
protected java.lang.String |
gprefStyleAttrName
Name for the local CSS styling attribute. |
protected boolean |
gprefUseNamespace
Determines whether output of upCast elements should be done with the upCast namespace (=true) or in the null namespace (=false). |
static java.lang.String |
kDiffStyleAttrName
attribute local name of the private diffStyle attribute |
protected static int |
kFilterRequiredFrameVersion
the required minimal version of upCast for this filter to run. |
protected static int |
kFilterVersion
The version of the filter implementation. |
static java.lang.String |
kFullStyleAttrName
attribute local name of the private fullStyle attribute |
protected static java.lang.String |
kGraphicalAttrName
name of the attribute holding the css local override style information for the respective element. |
static java.lang.String |
kInfinityloopInternalNamespace
Namespace of infinity-loop application-internal (private) attributes. |
protected static java.lang.String |
kLogicalAttrName
name of the attribute holding the css class name of the respective lement. |
protected de.infinityloop.upcast.importfilters.RTFImportFilter |
rtfInFilter
|
Fields inherited from class de.infinityloop.upcast.exportfilters.RichExportFilter |
---|
elementNameConversionTable, indentationLevel, inFilter, inOriginalText, kContentDTD, kEndTag, kIndentationStep, kMinimizedEndTag, kNoEndTag, kVisualDTD |
Fields inherited from class de.infinityloop.upcast.exportfilters.ExportFilter |
---|
converterParent, cssDefaultUnits, instanceID, kAllowEmptyCellsParamName, kCALSTableModelParamValue, kCombineWithLogicalStyleParamName, kCommandlineFilterName, kCommandlineParamName, kConfigurationFileParamName, kCPU_UpcastDefaultMap, kCSSFilterName, kCSSPropertyUnitMapParamName, kCSSRefParamName, kCSSSelectorSyntaxParamName, kCustomStylesheetJarPathParamName, kCustomStylesheetPIParamName, kDecryptionKey, kDeleteAfterConversionParamName, kDeleteEmptiesParamName, kDocBookFilterName, kDocBookRootParamName, kDOCTYPEDeclarationParamName, kDTDTypeDTDParamValue, kDTDTypeParamName, kDTDTypeXMLSchemaParamValue, kFilterNameParamName, kHTMLTableModelParamValue, kIncludeHiddenContentsParamName, kIncludeVisualElementsParamName, kInfileParamName, kInlineCSSStylesheetParamName, kMacronameParamName, kNamespacePrefixParamName, kOutfileParamName, kOutputEncodingParamName, kOutputResolutionParamName, kPrecompileStylesheetParamName, kQualityFactorParamName, kRawTreeParamName, kRepeatInlineClassPropertiesOnElement, kRevisionTrackingParamName, kRTFImport, kStandalone, kStylesheetParametersParamName, kStylesheetParamName, kSuffixParamName, kSuffixParamName_OLD, kTableModelParamName, kUnicodeTranslationMapParamName, kUnicodeTranslatorFilterName, kUpcastDefaultCSSUnitMapPath, kUpcastDefaultMapPath, kUpcastHTMLMapPath, kUpcastNSXMLMapPath, kUpcastXMLMapPath, kUseNamespaceParamName, kUTM_UpcastDefaultMap, kUTM_UpcastHTMLMap, kUTM_UpcastXMLMap, kValidateParamName, kValidatorFilterName, kWaitForCompletionParamName, kWriteDTDParamName, kWriteTOCParamName, kXHTMLFilterName, kXHTMLTransitionalFilterName, kXMLBasicDTDXSLTFilterName, kXMLFilterName, kXMLVersionParamName, kXSLTProcessorFilterName, kXSLTProcessorParamName, logger, serverMode |
Constructor Summary | |
---|---|
ExportFilterBase()
The constructor. |
|
ExportFilterBase(boolean sMode,
de.infinityloop.upcast.Converter c)
The constructor. |
Method Summary | |
---|---|
java.lang.String |
canAdd(de.infinityloop.upcast.Converter c)
Checks if this filter can be added to the list of currently active export filters. |
protected abstract void |
characters(java.lang.String text)
Called by the framework for document character content. |
protected java.util.Vector |
convertPropertyListToVector(java.lang.String plist)
breaks a complete CSS property string into Pair()s of property name, property value. |
protected int |
convertTwipsToPixels(int twips)
converts the passed value in twips to pixels, based on output resolution set in the upCast Import filter dialog. |
protected void |
customConfigurationEditorDismissed(boolean ok)
Called by the framework when the configuration editor was dismissed by the user by either clicking "OK" or "Cancel". |
void |
doExport(de.infinityloop.upcast.Converter parent,
OutputProxy op)
This method exports the whole document in the format as implemented by the export filter class. |
protected java.lang.String |
encodeForClassAttribute(java.lang.String s)
Helper: Encodes the passed class name for commpatibility with the CSS export filter. |
protected java.lang.String |
encodeForXMLAttribute(java.lang.String s)
Helper: Encodes the passed String for use as an XML 1.0 attribute value string. |
protected java.lang.String |
encodeForXMLText(java.lang.String s)
Helper: Encodes the passed String for use as character data in XML 1.0. |
protected abstract void |
endDocument()
Called by the framework after finishing the conversion. |
protected abstract void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attr)
Called by the framework at the end of an element. |
protected java.lang.String |
extractPropertyValue(org.xml.sax.Attributes atts,
java.lang.String propName,
java.lang.String unit)
Extracts a single value from a CSS property string's property with the name propName. |
protected java.lang.String |
formatAttribute(org.xml.sax.Attributes atts,
java.lang.String attName)
Helper: Formats an attribute value for writing as XML. |
protected java.lang.String |
formatAttribute(org.xml.sax.Attributes atts,
java.lang.String attName,
java.lang.String destName)
Helper: Formats an attribute value for writing as XML, using the specified different attribute name for the result. |
protected java.lang.String |
formatAttributeFiltered(org.xml.sax.Attributes atts,
java.lang.String attName,
CSSPropertyFilter propfilter)
Helper: Formats an attribute value for writing as XML, filtering on Attributes containing CSS using the specified filter. |
protected java.lang.String |
formatAttributeNMTOKEN(org.xml.sax.Attributes atts,
java.lang.String attName)
Helper: Formats an attribute value for writing as XML and makes sure that it is a NMTOKEN compliant value. |
protected java.lang.String |
getApplicationVersionAsString()
retrieves the upCast application's version as String. |
java.lang.String |
getConfigAsText()
This is called by the framework when it needs a String of text representing the current filter settings in human-readable form. |
protected java.util.Stack |
getCustomConfigurationEditorTabs()
This function must return a Stack object containing (String tabTitle, JComponent tabContent) Pair()s for use in one tab each of the standard interface provided by the upCast framework. |
protected java.lang.String |
getDiffStyleFiltered(org.xml.sax.Attributes atts,
CSSPropertyFilter f)
Helper: Extracts the differential style attribute from the passed Attributes object, and optionally filters it against a passed PropertyFilter. |
int |
getFilterCompatibility()
retrieves filter compatibility constant |
int |
getFilterVersion()
Returns filter version number kFilterVersion. |
protected java.lang.String |
getFullStyleFiltered(org.xml.sax.Attributes atts,
CSSPropertyFilter f)
Helper: Extracts the base/full style attribute from the passed Attributes object, and optionally filters it against a passed PropertyFilter. |
protected abstract java.lang.String |
getHumanReadableConfigurationDescription()
This is called by the framework when it needs a String of text representing the current filter settings in human-readable form. |
abstract java.lang.String |
getIdentificationName()
Returns the "internal" name of this filter, i.e. the one by which this filter is selected in BCF or upCast API. |
protected java.lang.String |
getMangledComponent(java.lang.String s,
int componentIndex)
Retrieves the component with a specified index of a mangled string. |
java.lang.String |
getModuleClassName()
Returns the module class name, which will be shown in the list of available export filters popup menu. |
java.lang.String |
getModuleName()
Returns the filter instance name set by the user. |
protected boolean |
getParameterBoolean(java.lang.String param,
boolean dflt)
Retrieves the named preferences object belonging to this filter from the preferences pool as a boolean value. |
protected double |
getParameterDouble(java.lang.String param,
double dflt)
Retrieves the named preferences object belonging to this filter from the preferences pool as a double value. |
protected int |
getParameterInt(java.lang.String param,
int dflt)
Retrieves the named preferences object belonging to this filter from the preferences pool as an integer value. |
protected java.lang.String |
getParameterString(java.lang.String param,
java.lang.String dflt)
Retrieves the named preferences object belonging to this filter from the preferences pool as a String. |
int |
getRequiredJRE()
Returns the minimum Java/JDK version required to run the filter. |
boolean |
hasConfigDialog()
Indicates to the framework whether this filter implementation has a configuration dialog at all. |
protected void |
indent()
Increases current indentation level by 1. |
protected java.lang.String |
indentation()
Calculates the currently valid indentation string, based on the current indentation level (as implicitly set by using indent() and outdent() methods). |
protected java.lang.String |
indentation(int steps,
java.lang.String indentationElement)
Calculates the indentation string based on the passed values. |
void |
initializeConfig()
Initializes filter parameters to their default values. |
protected void |
initializeConfiguration()
Initializes custom filter parameters to their default values. |
int |
initializeFilter(int frameVersion)
Initialize Filter. |
void |
issueDebug(long flags,
java.lang.String debugMessage)
Records a debugging message in the log. |
void |
issueError(int code,
java.lang.Object[] params)
|
void |
issueError(java.lang.String errorMessage)
Reports an error to the user. |
void |
issueInfo(java.lang.String infoMessage)
Records an informative message in the log. |
void |
issueWarning(int code,
java.lang.Object[] params)
|
void |
issueWarning(java.lang.String warningMessage)
Reports a warning to the user. |
protected abstract void |
literal(java.lang.String literalData)
Called by the framework for literal destination document content. |
protected java.lang.String |
makeFinalTag(java.lang.String tag)
Generates the final tag name from the tag given as parameter. |
protected void |
nl(java.io.Writer w)
writes the platform-dependent newline character. |
protected void |
outdent()
Decreases current indentation level by 1. |
boolean |
presentConfigDialog(javax.swing.JFrame parent)
Create and present the configuration dialog. |
void |
removeConfig()
Removes any parameters stored in the preferences for this filter instance. |
void |
reset()
Initialize global instance variables before a run. |
protected java.lang.String |
resolveExpression(java.lang.String expression)
Resolves a string containing variables referencing current runtime file information. |
protected boolean |
runsWithUI()
Returns true when upCast is running in GUI mode, false otherwise. |
void |
setParameter(java.lang.String name,
java.lang.Object value)
Put a new named value into this filter's preferences parameter pool. |
protected void |
setProgressMessage(java.lang.String message)
Set the label of the progress bar to the specified text to inform the user of the action currently taking place. |
protected abstract void |
startDocument(java.io.Writer destination,
java.lang.String systemId)
Called by the framework when starting a new document conversion. |
protected abstract void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attr)
Called by the framework at the start of an element. |
protected java.lang.String |
translateClassAttrForCSS(java.lang.String s)
Helper: Translates class names from their Word representation to a CSS-compatible version, without making them XML writable; this has to be done in a second step by calling encodeForXMLAttribute(). |
void |
updateConfig()
By calling this method, the framework indicates that preference values might have changed out of control of the filter and therefore any cached values need to be re-read from the preferences pool. |
protected void |
updateConfiguration()
By calling this method, the framework indicates that preference values might have changed out of control of the filter and therefore any cached values need to be re-read from the preferences pool. |
protected void |
userCancelled()
This method is called by the framework when it has detected that the user clicked the "Cancel" button in the progress display UI element. |
protected void |
writeNode(java.io.Writer out,
org.w3c.dom.Node node,
int writeEndTag)
This handles recursively calling the SAX like API methods for custom eport filters. |
protected void |
writeXMLProlog(java.io.Writer w)
writes the XML prolog, including the current encoding attribute. |
Methods inherited from class de.infinityloop.upcast.exportfilters.RichExportFilter |
---|
calculateCSSStylesheet, calculateDTDElementsCSSDefaults, calculatePagesizeCSS, filterPropertyString, getDefaultParKind, getHTMLColor, getLogger, hasAncestorElement, hasVisualContent, indentLevel, makeCLASSAttr_XML, makePCDATA_XML, makePCDATAAttr_XML, makeXMLName, outdentLevel, writeAllChildren, writeCopyrightHeaderXML, writeElement, writeElement, writeIndentation, writeIndentationEndTag, writeInfoGroupAsXML |
Methods inherited from class de.infinityloop.upcast.exportfilters.ExportFilter |
---|
findPreferences, getConverterParent, getDoc, getFilter, getInstanceSelector, getPreferenceAsBoolean, getPreferenceAsDouble, getPreferenceAsInt, getPreferenceAsLong, getPreferenceAsString, getServerMode, getTextFromSubtree, removeParameter, setConverterParent, setInstanceSelector, setServerMode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.infinityloop.upcast.ModuleGUI |
---|
getInstanceSelector, setInstanceSelector |
Field Detail |
---|
protected static int kFilterVersion
protected static int kFilterRequiredFrameVersion
public static final java.lang.String kInfinityloopInternalNamespace
public static final java.lang.String kFullStyleAttrName
public static final java.lang.String kDiffStyleAttrName
protected static final java.lang.String kLogicalAttrName
protected static final java.lang.String kGraphicalAttrName
protected de.infinityloop.upcast.importfilters.RTFImportFilter rtfInFilter
protected boolean gprefPrettyPrint
protected int gprefIndentationFactor
protected java.lang.String gprefNamespacePrefix
protected boolean gprefUseNamespace
protected java.lang.String gprefStyleAttrName
Constructor Detail |
---|
public ExportFilterBase(boolean sMode, de.infinityloop.upcast.Converter c)
public ExportFilterBase()
Method Detail |
---|
public int getFilterCompatibility()
getFilterCompatibility
in class de.infinityloop.upcast.exportfilters.ExportFilter
public int initializeFilter(int frameVersion)
initializeFilter
in class de.infinityloop.upcast.exportfilters.ExportFilter
frameVersion
- the framework version; use this to check against your required framework version.
public int getFilterVersion()
getFilterVersion
in class de.infinityloop.upcast.exportfilters.ExportFilter
public java.lang.String canAdd(de.infinityloop.upcast.Converter c)
canAdd
in class de.infinityloop.upcast.exportfilters.ExportFilter
c
- the parent converter object (opaque)
public void reset()
reset
in class de.infinityloop.upcast.exportfilters.RichExportFilter
public final void doExport(de.infinityloop.upcast.Converter parent, OutputProxy op) throws java.lang.Exception
doExport
in class de.infinityloop.upcast.exportfilters.ExportFilter
java.lang.Exception
protected final void writeNode(java.io.Writer out, org.w3c.dom.Node node, int writeEndTag) throws java.lang.Exception
writeNode
in class de.infinityloop.upcast.exportfilters.RichExportFilter
java.lang.Exception
protected final java.lang.String makeFinalTag(java.lang.String tag)
makeFinalTag
in class de.infinityloop.upcast.exportfilters.RichExportFilter
protected void writeXMLProlog(java.io.Writer w) throws java.io.IOException
w
- The current Writer object used for output
java.io.IOException
protected java.lang.String indentation(int steps, java.lang.String indentationElement)
steps
- number of steps to indent using the indentationElementindentationElement
- the string that indents one level, e.g. " " (a space)
protected java.lang.String indentation()
protected void indent()
protected void outdent()
protected void nl(java.io.Writer w) throws java.io.IOException
w
- the current Writer object used for output
java.io.IOException
protected final void setProgressMessage(java.lang.String message)
message
- the action message textprotected final java.lang.String getApplicationVersionAsString()
protected final java.lang.String getMangledComponent(java.lang.String s, int componentIndex)
s
- The mangled stringcomponentIndex
- the index of the component you want to retrieve.
Components are numbered starting at 0.
protected int convertTwipsToPixels(int twips)
twips
- the value in twips you want to know the pixel equivalent of
protected final java.lang.String resolveExpression(java.lang.String expression)
expression
- - the String expression to resolve
protected java.util.Vector convertPropertyListToVector(java.lang.String plist)
plist
- the property list String to be broken up into propertyname/value Pair()s
Pair
protected java.lang.String extractPropertyValue(org.xml.sax.Attributes atts, java.lang.String propName, java.lang.String unit)
atts
- the Attributes object passed. This contains two attributes holding style information, the base style
and some overriding style properties. This method merges these two styles and then performs the search
automatically.propName
- name of the property to extract, e.g. 'width' or 'list-style-type'.unit
- the unit name of the value should be converted to (only for properties of type length), e.g. "in" or "px"
public boolean presentConfigDialog(javax.swing.JFrame parent)
presentConfigDialog
in interface de.infinityloop.upcast.ModuleGUI
presentConfigDialog
in class de.infinityloop.upcast.exportfilters.ExportFilter
parent
- the JFrame parent any presented dialog should use as its parent
public java.lang.String getConfigAsText()
getConfigAsText
in interface de.infinityloop.upcast.ModuleGUI
getConfigAsText
in class de.infinityloop.upcast.exportfilters.ExportFilter
public final void initializeConfig()
initializeConfig
in interface de.infinityloop.upcast.ModuleGUI
initializeConfig
in class de.infinityloop.upcast.exportfilters.ExportFilter
initializeConfiguration()
public final void removeConfig()
public final void updateConfig()
updateConfig
in interface de.infinityloop.upcast.ModuleGUI
updateConfig
in class de.infinityloop.upcast.exportfilters.ExportFilter
updateConfiguration()
public final java.lang.String getModuleName()
getModuleName
in interface de.infinityloop.upcast.ModuleGUI
getModuleName
in class de.infinityloop.upcast.exportfilters.ExportFilter
public boolean hasConfigDialog()
hasConfigDialog
in interface de.infinityloop.upcast.ModuleGUI
hasConfigDialog
in class de.infinityloop.upcast.exportfilters.ExportFilter
public java.lang.String getModuleClassName()
getModuleClassName
in interface de.infinityloop.upcast.ModuleGUI
getModuleClassName
in class de.infinityloop.upcast.exportfilters.ExportFilter
public abstract java.lang.String getIdentificationName()
getIdentificationName
in interface de.infinityloop.upcast.ModuleGUI
getIdentificationName
in class de.infinityloop.upcast.exportfilters.ExportFilter
public int getRequiredJRE()
getRequiredJRE
in interface de.infinityloop.upcast.ModuleGUI
getRequiredJRE
in class de.infinityloop.upcast.exportfilters.ExportFilter
protected java.lang.String formatAttribute(org.xml.sax.Attributes atts, java.lang.String attName)
atts
- the Attributes object where attName might be a member ofattName
- the name of the attribute that should be formatted
protected java.lang.String formatAttribute(org.xml.sax.Attributes atts, java.lang.String attName, java.lang.String destName)
atts
- the Attributes object where attName might be a member ofattName
- the name of the attribute that should be formatteddestName
- the name for the attribute to use in the result string
protected java.lang.String formatAttributeFiltered(org.xml.sax.Attributes atts, java.lang.String attName, CSSPropertyFilter propfilter)
atts
- the Attributes object where attName might be a member ofattName
- the name of the attribute that should be formattedpropfilter
- the property filter description object
protected java.lang.String formatAttributeNMTOKEN(org.xml.sax.Attributes atts, java.lang.String attName)
atts
- the Attributes object where attName might be a member ofattName
- the name of the attribute that should be formatted
protected java.lang.String getDiffStyleFiltered(org.xml.sax.Attributes atts, CSSPropertyFilter f)
atts
- the Attributes objectf
- the property filter to filter against
protected java.lang.String getFullStyleFiltered(org.xml.sax.Attributes atts, CSSPropertyFilter f)
atts
- the Attributes objectf
- the property filter to filter against
protected final java.lang.String encodeForXMLAttribute(java.lang.String s)
s
- Unicode attribute value String to encode
protected final java.lang.String encodeForXMLText(java.lang.String s)
s
- Unicode character string to be encoded
protected final java.lang.String encodeForClassAttribute(java.lang.String s)
s
- CSS class name
protected final java.lang.String translateClassAttrForCSS(java.lang.String s)
s
- CSS class name
protected final boolean runsWithUI()
protected final boolean getParameterBoolean(java.lang.String param, boolean dflt)
param
- the name (key) of the parameter to retrievedflt
- the default value to use when the requested parameter is not found in the preferences pool
protected final int getParameterInt(java.lang.String param, int dflt)
param
- the name (key) of the parameter to retrievedflt
- the default value to use when the requested parameter is not found in the preferences pool
protected final double getParameterDouble(java.lang.String param, double dflt)
param
- the name (key) of the parameter to retrievedflt
- the default value to use when the requested parameter is not found in the preferences pool
protected final java.lang.String getParameterString(java.lang.String param, java.lang.String dflt)
param
- the name (key) of the parameter to retrievedflt
- the default value to use when the requested parameter is not found in the preferences pool
public void setParameter(java.lang.String name, java.lang.Object value)
setParameter
in class de.infinityloop.upcast.exportfilters.ExportFilter
name
- the name of the parameter; may not contain the dot '.' character as that is used
internally to separate namespace hierarchies.value
- the value object. This can be one of the following standard classes: String, Integer,
Double, Boolean. Storage of arbitrary objects is not supported in this version!public void issueError(java.lang.String errorMessage)
errorMessage
- the error message string to displaypublic void issueError(int code, java.lang.Object[] params)
public void issueWarning(java.lang.String warningMessage)
warningMessage
- the warning message to write to the log filepublic void issueWarning(int code, java.lang.Object[] params)
public void issueInfo(java.lang.String infoMessage)
infoMessage
- the informative message to write to the log filepublic void issueDebug(long flags, java.lang.String debugMessage)
debugMessage
- the debug message to write to the log fileprotected java.util.Stack getCustomConfigurationEditorTabs()
protected void customConfigurationEditorDismissed(boolean ok)
ok
- true when the user clicked "OK" to dismiss the dialog, false otherwise.protected abstract java.lang.String getHumanReadableConfigurationDescription()
protected void userCancelled()
protected void initializeConfiguration()
protected void updateConfiguration()
updateConfig()
protected abstract void startDocument(java.io.Writer destination, java.lang.String systemId)
destination
- the Writer you should write the result tosystemId
- the URL/file name of the destination file; might not be valid
when the conversion's originally destination was already a Stream
with no associated location information.protected abstract void endDocument() throws java.lang.Exception
java.lang.Exception
protected abstract void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attr)
protected abstract void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attr)
protected abstract void characters(java.lang.String text)
protected abstract void literal(java.lang.String literalData)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |