Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Extractors

Simple Extractor DSL.

remarks

The methods in this class are for the most part simple factory methods for various ValueExtractor classes, but in some cases provide additional type safety. They also tend to make the code more readable, especially if imported statically, so their use is strongly encouraged in lieu of direct construction of ValueExtractor classes.

Hierarchy

  • Extractors

Index

Methods

Static chained

  • Returns an extractor that extracts the specified fields or extractors where extraction occurs in a chain where the result of each field extraction is the input to the next extractor. The result returned is the result of the final extractor in the chain.

    Parameters

    • extractorsOrFields: ValueExtractor[] | string

      If extractorsOrFields is a string type, then the field names to extract (if any field name contains a dot '.' that field name is split into multiple field names delimiting on the dots. If extractorsOrFields is of ValueExtractor[] type, then the ValueExtractors are used to extract the values

    Returns ValueExtractor

    an extractor that extracts the value(s) of the specified field(s)

Static extract

  • Returns an extractor that extracts the value of the specified field.

    Parameters

    • from: string

      the name of the field or method to extract the value from.

    • Optional params: any[]

      the parameters to pass to the method.

    Returns ValueExtractor

    an extractor that extracts the value of the specified field.

Static identity

  • Returns an extractor that always returns its input argument.

    Returns ValueExtractor

    an extractor that always returns its input argument

Static identityCast

  • Returns an extractor that casts its input argument.

    Returns ValueExtractor

    an extractor that always returns its input argument

Static multi

  • Returns an extractor that extracts the specified fields and returns the extracted values in an array.

    Parameters

    • extractorOrFields: ValueExtractor[] | string

      the field names to extract

    Returns MultiExtractor

    an extractor that extracts the value(s) of the specified field(s)