Class RegExpAndDurationTimeCoverageEnhancer
- java.lang.Object
-
- thredds.cataloggen.datasetenhancer.RegExpAndDurationTimeCoverageEnhancer
-
- All Implemented Interfaces:
DatasetEnhancer
public class RegExpAndDurationTimeCoverageEnhancer extends Object implements DatasetEnhancer
Try to add timeCoverage to the InvDataset using a regular expression match, capturing group replacement, and a duration string.- Look for a match to the given matchPattern in the CrawlableDataset name.
- Substitute all replacment patterns ("$n") in the substitionPattern with the capturing groups from the regular expression match.
- Use the string obtained from the substitution as the start time and the given duration string to form a timeCoverage element for the InvDataset.
- Since:
- Dec 6, 2005 10:59:21 AM
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addMetadata(InvDataset dataset, CrawlableDataset crDataset)
Add metadata to the given InvDataset possibly using information from the corresponding CrawlableDataset.Object
getConfigObject()
Return the configuration object.String
getDuration()
static RegExpAndDurationTimeCoverageEnhancer
getInstanceToMatchOnDatasetName(String matchPattern, String substitutionPattern, String duration)
Factory method that returns a RegExpAndDurationTimeCoverageEnhancer instance that will apply the match pattern to the dataset name.static RegExpAndDurationTimeCoverageEnhancer
getInstanceToMatchOnDatasetPath(String matchPattern, String substitutionPattern, String duration)
Factory method that returns a RegExpAndDurationTimeCoverageEnhancer instance that will apply the match pattern to the dataset path.String
getMatchPattern()
thredds.cataloggen.datasetenhancer.RegExpAndDurationTimeCoverageEnhancer.MatchTarget
getMatchTarget()
String
getSubstitutionPattern()
-
-
-
Method Detail
-
getInstanceToMatchOnDatasetName
public static RegExpAndDurationTimeCoverageEnhancer getInstanceToMatchOnDatasetName(String matchPattern, String substitutionPattern, String duration)
Factory method that returns a RegExpAndDurationTimeCoverageEnhancer instance that will apply the match pattern to the dataset name.- Parameters:
matchPattern
- a regular expression used to match against the CrawlableDataset name.substitutionPattern
- the time coverage start time (which may contain regular expression capturing group substitution strings).duration
- the time coverage duration string.- Returns:
- a RegExpAndDurationTimeCoverageEnhancer that will apply the match pattern to the dataset name.
-
getInstanceToMatchOnDatasetPath
public static RegExpAndDurationTimeCoverageEnhancer getInstanceToMatchOnDatasetPath(String matchPattern, String substitutionPattern, String duration)
Factory method that returns a RegExpAndDurationTimeCoverageEnhancer instance that will apply the match pattern to the dataset path.- Parameters:
matchPattern
- a regular expression used to match against the CrawlableDataset path.substitutionPattern
- the time coverage start time (which may contain regular expression capturing group substitution strings).duration
- the time coverage duration string.- Returns:
- a RegExpAndDurationTimeCoverageEnhancer that will apply the match pattern to the dataset path.
-
getMatchTarget
public thredds.cataloggen.datasetenhancer.RegExpAndDurationTimeCoverageEnhancer.MatchTarget getMatchTarget()
-
getMatchPattern
public String getMatchPattern()
-
getSubstitutionPattern
public String getSubstitutionPattern()
-
getDuration
public String getDuration()
-
getConfigObject
public Object getConfigObject()
Description copied from interface:DatasetEnhancer
Return the configuration object.- Specified by:
getConfigObject
in interfaceDatasetEnhancer
- Returns:
- the configuration Object (may be null).
-
addMetadata
public boolean addMetadata(InvDataset dataset, CrawlableDataset crDataset)
Description copied from interface:DatasetEnhancer
Add metadata to the given InvDataset possibly using information from the corresponding CrawlableDataset.- Specified by:
addMetadata
in interfaceDatasetEnhancer
- Parameters:
dataset
- the InvDataset to enhance with additional metadata.crDataset
- the CrawlableDataset that corresponds with the given InvDataset, possibly used to gather information not available from the InvDataset.- Returns:
- true if the InvDataset is successfully enhanced, otherwise false.
-
-