thredds.cataloggen.datasetenhancer
Class RegExpAndDurationTimeCoverageEnhancer

java.lang.Object
  extended by 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.

  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

Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 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.


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.