Package adams.data.idextraction
Class ReportFieldRegExp
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,IDExtractor,Serializable
public class ReportFieldRegExp extends ReportField
Returns the value of the specified field after passing it through the find/replace pair.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseRegExpm_Findthe string to find.protected Patternm_FindPatternthe pattern to find.protected booleanm_RemoveFileExtwhether to remove any file extension before applying the regexp.protected Stringm_Replacethe replacement string.-
Fields inherited from class adams.data.idextraction.ReportField
m_Field
-
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 ReportFieldRegExp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected StringdoExtractID(Object obj)Extracts the ID from a object.StringfindTipText()Returns the tip text for this property.BaseRegExpgetFind()Returns the string to find (regular expression).booleangetRemoveFileExt()Returns whether to remove any file extension before applying the regular expression.StringgetReplace()Returns the string to replace the occurences with.StringglobalInfo()Returns a string describing the object.booleanhandles(Object obj)Checks whether the data type is handled.StringremoveFileExtTipText()Returns the tip text for this property.StringreplaceTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.voidsetFind(BaseRegExp value)Sets the string to find (regular expression).voidsetRemoveFileExt(boolean value)Sets whether to remove any file extension before applying the regular expression.voidsetReplace(String value)Sets the string to replace the occurrences with.-
Methods inherited from class adams.data.idextraction.ReportField
fieldTipText, getField, getQuickInfo, setField
-
Methods inherited from class adams.data.idextraction.AbstractIDExtractor
check, extractID
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, 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.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Find
protected BaseRegExp m_Find
the string to find.
-
m_Replace
protected String m_Replace
the replacement string.
-
m_RemoveFileExt
protected boolean m_RemoveFileExt
whether to remove any file extension before applying the regexp.
-
m_FindPattern
protected transient Pattern m_FindPattern
the pattern to find.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Overrides:
globalInfoin classReportField- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classReportField
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
setFind
public void setFind(BaseRegExp value)
Sets the string to find (regular expression).- Parameters:
value- the string
-
getFind
public BaseRegExp getFind()
Returns the string to find (regular expression).- Returns:
- the string
-
findTipText
public String findTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setReplace
public void setReplace(String value)
Sets the string to replace the occurrences with.- Parameters:
value- the string
-
getReplace
public String getReplace()
Returns the string to replace the occurences with.- Returns:
- the string
-
replaceTipText
public String replaceTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRemoveFileExt
public void setRemoveFileExt(boolean value)
Sets whether to remove any file extension before applying the regular expression.- Parameters:
value- true if to remove
-
getRemoveFileExt
public boolean getRemoveFileExt()
Returns whether to remove any file extension before applying the regular expression.- Returns:
- true if to remove
-
removeFileExtTipText
public String removeFileExtTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
handles
public boolean handles(Object obj)
Checks whether the data type is handled.- Specified by:
handlesin interfaceIDExtractor- Overrides:
handlesin classReportField- Parameters:
obj- the object to check- Returns:
- true if handled
-
doExtractID
protected String doExtractID(Object obj)
Extracts the ID from a object.- Overrides:
doExtractIDin classReportField- Parameters:
obj- the object to process- Returns:
- the extracted ID, null if failed to extract or not handled
-
-