Package adams.core.option
Class ApplyActorProducer
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,FileFormatHandler
,LoggingSupporter
,OptionHandler
,OptionProducer<String,String>
,OptionProducerWithOptionHandling<String,String>
,RecursiveOptionProducer
,SizeOfHandler
,Serializable
public class ApplyActorProducer extends AbstractActorJavaCodeProducer
Generates a Java class that allows executing/applying an actor as a method.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApplyActorProducer.ActorType
The type of actor.
-
Field Summary
Fields Modifier and Type Field Description protected ApplyActorProducer.ActorType
m_Type
the type of actor.-
Fields inherited from class adams.core.option.AbstractJavaCodeProducer
JAVA_KEYWORDS, m_AdditionalImportsInsertLocation, m_Copyright, m_Indentation, m_JavaKeywords, m_OutputBuffer, m_OutputDefaultValues, m_Package, m_ShortenedImports, m_SimpleName, m_VarNames
-
Fields inherited from class adams.core.option.AbstractRecursiveOptionProducerWithOptionHandling
m_OptionManager
-
Fields inherited from class adams.core.option.AbstractRecursiveOptionProducer
m_Nesting
-
Fields inherited from class adams.core.option.AbstractOptionProducer
m_Input, m_LastGenerated, m_Output, m_OutputVariableValues, m_SkippedProperties, m_UsePropertyNames
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ApplyActorProducer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAdditionalMethods()
Hook-method for adding additional methods necessary to make the class compile.protected void
addClassStart()
Adds the start of the enclosing "class" statement.protected void
addMainMethod()
Does not generate a main method.protected void
addMethodEnd()
Closes the method with the generated code.protected void
addMethodStart()
Adds the method that encloses the generated code.void
defineOptions()
Adds options to the internal list of options.protected String
getIndentation()
Returns the indentation for code inside the try-catch-block.String
getPackage()
Returns the package name to use.protected List<String>
getRequiredImports()
Returns other necessary imports.String
getSimpleName()
Returns the simple name to use.String
globalInfo()
Returns a string describing the object.static void
main(String[] args)
Executes the producer from commandline.protected void
postIndent(Object value)
Hook method that gets called just after the nesting got decreased.protected void
preIndent(Object value)
Hook method that gets called before nesting is increased.protected void
preProduce()
Hook-method before starting visiting options.void
setPackage(String value)
Sets the package name of the class to generate.void
setSimpleName(String value)
Sets the simple name (without package) of the class to generate.-
Methods inherited from class adams.core.option.AbstractActorJavaCodeProducer
getDefaultFormatExtension, getFormatDescription, getFormatExtensions, getOuterVariableName
-
Methods inherited from class adams.core.option.AbstractJavaCodeProducer
addClassEnd, addClassJavadoc, addConstructor, addCopyright, addImports, addLicensePreamble, addPackage, copyrightTipText, escapeDoubleQuotes, getCast, getClassname, getClassname, getClassname, getCopyright, getCurrentVariable, getNextTmpVariable, getNextTmpVariable, getNextTmpVariable, getOutput, getOutputDefaultValues, initialize, initOutput, insertAdditionalImports, isClassName, outputDefaultValuesTipText, packageTipText, postProduce, preProduce, processClassOption, processOption, processOption, processOption, setCopyright, setOutputDefaultValues, shortenClassname, simpleNameTipText, toString
-
Methods inherited from class adams.core.option.AbstractRecursiveOptionProducerWithOptionHandling
cleanUpOptions, destroy, finishInit, getOptionManager, newOptionManager, toCommandLine
-
Methods inherited from class adams.core.option.AbstractRecursiveOptionProducer
cleanUp, generateLoggingString, getDebugIndentation, getDebugIndentation, getRecursionLevel, reset
-
Methods inherited from class adams.core.option.AbstractOptionProducer
checkInput, doProduce, doProduce, getCurrentValue, getInput, getOptionIdentifier, getOutputVariableValues, getSkippedProperties, getUsePropertyNames, isDefaultValue, loggingLevelTipText, outputVariableValuesTipText, postProduce, produce, produce, runProducer, setLoggingLevel, setOutputVariableValues, setSkippedProperties, toString, write
-
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.option.OptionProducer
cleanUp, doProduce, getInput, getLoggingLevel, getOutputVariableValues, getSkippedProperties, getUsePropertyNames, loggingLevelTipText, outputVariableValuesTipText, produce, setLoggingLevel, setOutputVariableValues, setSkippedProperties, write
-
-
-
-
Field Detail
-
m_Type
protected ApplyActorProducer.ActorType m_Type
the type of actor.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceOptionProducer<String,String>
- Specified by:
globalInfo
in classAbstractOptionProducer<String,String>
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options. Derived classes must override this method to add additional options.- Specified by:
defineOptions
in interfaceOptionHandler
- Specified by:
defineOptions
in interfaceOptionProducerWithOptionHandling<String,String>
- Overrides:
defineOptions
in classAbstractJavaCodeProducer
-
setSimpleName
public void setSimpleName(String value)
Sets the simple name (without package) of the class to generate.- Overrides:
setSimpleName
in classAbstractJavaCodeProducer
- Parameters:
value
- the simple name
-
getSimpleName
public String getSimpleName()
Returns the simple name to use.- Overrides:
getSimpleName
in classAbstractJavaCodeProducer
- Returns:
- the simple name
-
setPackage
public void setPackage(String value)
Sets the package name of the class to generate.- Overrides:
setPackage
in classAbstractJavaCodeProducer
- Parameters:
value
- the package name
-
getPackage
public String getPackage()
Returns the package name to use.- Overrides:
getPackage
in classAbstractJavaCodeProducer
- Returns:
- the package name
-
getIndentation
protected String getIndentation()
Returns the indentation for code inside the try-catch-block.- Specified by:
getIndentation
in classAbstractJavaCodeProducer
- Returns:
- the indentation string
-
preIndent
protected void preIndent(Object value)
Hook method that gets called before nesting is increased.- Overrides:
preIndent
in classAbstractJavaCodeProducer
- Parameters:
value
- the current object
-
postIndent
protected void postIndent(Object value)
Hook method that gets called just after the nesting got decreased.- Overrides:
postIndent
in classAbstractJavaCodeProducer
- Parameters:
value
- the current object
-
getRequiredImports
protected List<String> getRequiredImports()
Returns other necessary imports.- Overrides:
getRequiredImports
in classAbstractJavaCodeProducer
- Returns:
- the class names
-
addClassStart
protected void addClassStart()
Adds the start of the enclosing "class" statement.
Default implementation does not derive the class from another superclass.- Overrides:
addClassStart
in classAbstractJavaCodeProducer
-
addMethodStart
protected void addMethodStart()
Adds the method that encloses the generated code.- Specified by:
addMethodStart
in classAbstractJavaCodeProducer
-
addAdditionalMethods
protected void addAdditionalMethods()
Hook-method for adding additional methods necessary to make the class compile.- Overrides:
addAdditionalMethods
in classAbstractJavaCodeProducer
-
addMethodEnd
protected void addMethodEnd()
Closes the method with the generated code.- Specified by:
addMethodEnd
in classAbstractJavaCodeProducer
-
addMainMethod
protected void addMainMethod()
Does not generate a main method.- Overrides:
addMainMethod
in classAbstractJavaCodeProducer
-
preProduce
protected void preProduce()
Hook-method before starting visiting options.- Overrides:
preProduce
in classAbstractActorJavaCodeProducer
- See Also:
AbstractOptionProducer.initOutput()
-
main
public static void main(String[] args)
Executes the producer from commandline.- Parameters:
args
- the commandline arguments, use -help for help
-
-