Package adams.parser.plugin
Class AbstractParserProcedure
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.parser.plugin.AbstractParserProcedure
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,ParserProcedure
,Serializable
- Direct Known Subclasses:
Println
public abstract class AbstractParserProcedure extends LoggingObject implements ParserProcedure
Ancestor for custom procedures to be used in parsers. Procedures must be stateless, as only a single instance is kept in memory.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractParserProcedure()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
callProcedure(Object[] params)
Gets called from the parser.protected abstract String
check(Object[] params)
Performs some checks on the input parameters.protected abstract void
doCallProcedure(Object[] params)
Gets called from the parser.abstract String
getProcedureHelp()
Returns the help string for the procedure.abstract String
getProcedureName()
Returns the procedure name.static String[]
getProcedures()
Returns a list with classnames of procedures.abstract String
getProcedureSignature()
Returns the signature of the procedure.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
getProcedureName
public abstract String getProcedureName()
Returns the procedure name. Can only consist of letters, underscores, numbers.- Specified by:
getProcedureName
in interfaceParserProcedure
- Returns:
- the name of the procedure
-
getProcedureSignature
public abstract String getProcedureSignature()
Returns the signature of the procedure.- Specified by:
getProcedureSignature
in interfaceParserProcedure
- Returns:
- the signature
-
getProcedureHelp
public abstract String getProcedureHelp()
Returns the help string for the procedure.- Specified by:
getProcedureHelp
in interfaceParserProcedure
- Returns:
- the help string
-
check
protected abstract String check(Object[] params)
Performs some checks on the input parameters.- Parameters:
params
- the input parameters- Returns:
- null if OK, otherwise error message
-
doCallProcedure
protected abstract void doCallProcedure(Object[] params)
Gets called from the parser.- Parameters:
params
- the parameters obtained through the parser
-
callProcedure
public void callProcedure(Object[] params)
Gets called from the parser.- Specified by:
callProcedure
in interfaceParserProcedure
- Parameters:
params
- the parameters obtained through the parser
-
getProcedures
public static String[] getProcedures()
Returns a list with classnames of procedures.- Returns:
- the filter classnames
-
-