Class Scripted
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,FileBasedScripting
,FileBasedScriptingWithOptions
,SizeOfHandler
,Serializable
public class Scripted extends AbstractScriptedPDFGenerator
A PDF generator that uses any scripting handler for processing the objects with a script located in the specified file.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractPDFGenerator
m_GeneratorObject
the loaded script object.protected AbstractScriptingHandler
m_Handler
the scripting handler to use.-
Fields inherited from class adams.flow.transformer.pdfgenerate.AbstractScriptedPDFGenerator
m_ScriptFile, m_ScriptObject, m_ScriptOptions
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description Scripted()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
The type of data the generator accepts.protected String
check(Object[] objects)
Hook method for checking the objects before processing them.protected String
checkScriptObject()
Checks the script object.void
defineOptions()
Adds options to the internal list of options.void
destroy()
Frees up memory in a "destructive" non-reversible way.protected String
doProcess(Object[] objects, File outputFile)
Processes the objects to generate the PDF.AbstractScriptingHandler
getHandler()
Gets the handler to use for scripting.String
globalInfo()
Returns a string describing the object.String
handlerTipText()
Returns the tip text for this property.protected String
loadScriptObject()
Loads the scripts object and sets its options.String
scriptOptionsTipText()
Returns the tip text for this property.void
setHandler(AbstractScriptingHandler value)
Sets the handler to use for scripting.-
Methods inherited from class adams.flow.transformer.pdfgenerate.AbstractScriptedPDFGenerator
getScriptFile, getScriptOptions, initScriptObject, reset, scriptFileTipText, setScriptFile, setScriptOptions
-
Methods inherited from class adams.flow.transformer.pdfgenerate.AbstractPDFGenerator
getQuickInfo, process
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_GeneratorObject
protected transient AbstractPDFGenerator m_GeneratorObject
the loaded script object.
-
m_Handler
protected AbstractScriptingHandler m_Handler
the scripting handler to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractScriptedPDFGenerator
-
scriptOptionsTipText
public String scriptOptionsTipText()
Returns the tip text for this property.- Specified by:
scriptOptionsTipText
in interfaceFileBasedScriptingWithOptions
- Overrides:
scriptOptionsTipText
in classAbstractScriptedPDFGenerator
- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setHandler
public void setHandler(AbstractScriptingHandler value)
Sets the handler to use for scripting.- Parameters:
value
- the handler
-
getHandler
public AbstractScriptingHandler getHandler()
Gets the handler to use for scripting.- Returns:
- the handler
-
handlerTipText
public String handlerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
loadScriptObject
protected String loadScriptObject()
Loads the scripts object and sets its options.- Specified by:
loadScriptObject
in classAbstractScriptedPDFGenerator
- Returns:
- null if OK, otherwise the error message
-
accepts
public Class[] accepts()
The type of data the generator accepts.- Specified by:
accepts
in classAbstractPDFGenerator
- Returns:
- the classes
-
checkScriptObject
protected String checkScriptObject()
Checks the script object.- Specified by:
checkScriptObject
in classAbstractScriptedPDFGenerator
- Returns:
- null if OK, otherwise the error message
-
check
protected String check(Object[] objects)
Hook method for checking the objects before processing them.- Overrides:
check
in classAbstractScriptedPDFGenerator
- Parameters:
objects
- the objects to check- Returns:
- null if successful, otherwise error message
-
doProcess
protected String doProcess(Object[] objects, File outputFile)
Processes the objects to generate the PDF.- Specified by:
doProcess
in classAbstractPDFGenerator
- Parameters:
objects
- the objects to processoutputFile
- the output file to generate- Returns:
- null if successful, otherwise error message
-
destroy
public void destroy()
Frees up memory in a "destructive" non-reversible way.- Specified by:
destroy
in interfaceDestroyable
- Overrides:
destroy
in classAbstractScriptedPDFGenerator
- See Also:
AbstractOptionHandler.cleanUpOptions()
-
-