thredds.cataloggen.datasetenhancer
Class RegExpAndDurationTimeCoverageEnhancer

java.lang.Object
  extended by thredds.cataloggen.datasetenhancer.RegExpAndDurationTimeCoverageEnhancer
All Implemented Interfaces:
DatasetEnhancer

public class RegExpAndDurationTimeCoverageEnhancer
extends java.lang.Object
implements DatasetEnhancer

Try to add timeCoverage to the InvDataset using a regular expression match, capturing group replacement, and a duration string.

  1. Look for a match to the given matchPattern in the CrawlableDataset name.
  2. Substitute all replacment patterns ("$n") in the substitionPattern with the capturing groups from the regular expression match.
  3. 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
Author:
edavis

Constructor Summary
RegExpAndDurationTimeCoverageEnhancer(java.lang.String matchPattern, java.lang.String substitutionPattern, java.lang.String duration)
          Constructor
 
Method Summary
 boolean addMetadata(InvDataset dataset, CrawlableDataset crDataset)
          Add metadata to the given InvDataset possibly using information from the corresponding CrawlableDataset.
 java.lang.Object getConfigObject()
          Return the configuration object.
 java.lang.String getDuration()
           
 java.lang.String getMatchPattern()
           
 java.lang.String getSubstitutionPattern()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegExpAndDurationTimeCoverageEnhancer

public RegExpAndDurationTimeCoverageEnhancer(java.lang.String matchPattern,
                                             java.lang.String substitutionPattern,
                                             java.lang.String duration)
Constructor

Parameters:
matchPattern - a regular expression used to match against the CrawlableDataset name.
substitutionPattern - used, after substitution with the regular expression capturing groups, as the start time for a time coverage.
duration - used as the duration string for a time coverage.
Method Detail

getMatchPattern

public java.lang.String getMatchPattern()

getSubstitutionPattern

public java.lang.String getSubstitutionPattern()

getDuration

public java.lang.String getDuration()

getConfigObject

public java.lang.Object getConfigObject()
Description copied from interface: DatasetEnhancer
Return the configuration object.

Specified by:
getConfigObject in interface DatasetEnhancer
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 interface DatasetEnhancer
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.