org.modeshape.jcr.query

## Class RowExtractors

- java.lang.Object
- - org.modeshape.jcr.query.RowExtractors

-     public class RowExtractors
      extends Object

  Standard `RowExtractors.ExtractFromRow` implementations.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `RowExtractors.ExtractFromRow` An operation that extracts a single value from the current row in a given `NodeSequence.Batch`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RowExtractors.ExtractFromRow` | `convert(RowExtractors.ExtractFromRow extractor, TypeSystem.TypeFactory<?> newType)` Obtain a new `RowExtractors.ExtractFromRow` instance that uses the supplied row extractor but converts the value to the supplied type.
    `static RowExtractors.ExtractFromRow` | `extractFullText(int indexInRow, NodeCache cache, Name propertyName, TypeSystem types, BinaryStore binaries)` Obtain a new `RowExtractors.ExtractFromRow` instance that will extract the full text for a single property of a node.
    `static RowExtractors.ExtractFromRow` | `extractFullText(int indexInRow, NodeCache cache, TypeSystem types, BinaryStore binaries)` Obtain a new `RowExtractors.ExtractFromRow` instance that will extract the full text for a node.
    `static void` | `extractFullTextFrom(Object propertyValue, TypeSystem.TypeFactory<String> type, BinaryStore binaries, StringBuilder fullTextString)`
    `protected static void` | `extractFullTextFrom(Property property, TypeSystem.TypeFactory<String> type, StringBuilder fullTextString, BinaryStore binaries, CachedNode node, NodeCache cache)`
    `static RowExtractors.ExtractFromRow` | `extractLocalName(int indexInRow, NodeCache cache, TypeSystem types)` Create an extractor that extracts the name from the node at the given position in the row.
    `static RowExtractors.ExtractFromRow` | `extractName(int indexInRow, NodeCache cache, TypeSystem types)` Create an extractor that extracts the name from the node at the given position in the row.
    `static RowExtractors.ExtractFromRow` | `extractNodeKey(int indexInRow, NodeCache cache, TypeSystem types)` Create an extractor that extracts the `NodeKey` from the node at the given position in the row.
    `static RowExtractors.ExtractFromRow` | `extractorWith(Collection<RowExtractors.ExtractFromRow> extractors)` Obtain an extractor of a tuple containing each of the values from the supplied extractors.
    `static RowExtractors.ExtractFromRow` | `extractorWith(RowExtractors.ExtractFromRow extractor, Order order, NullOrder nullOrder)` Create an extractor that has a `type factory` with a `comparator` that sorts according to the specified order and null-order behavior.
    `static RowExtractors.ExtractFromRow` | `extractorWith(RowExtractors.ExtractFromRow first, RowExtractors.ExtractFromRow second)` Obtain an extractor of a tuple containing each of the values from the supplied extractors.
    `static RowExtractors.ExtractFromRow` | `extractorWith(RowExtractors.ExtractFromRow first, RowExtractors.ExtractFromRow second, RowExtractors.ExtractFromRow third)` Obtain an extractor of a tuple containing each of the values from the supplied extractors.
    `static RowExtractors.ExtractFromRow` | `extractorWith(RowExtractors.ExtractFromRow first, RowExtractors.ExtractFromRow second, RowExtractors.ExtractFromRow third, RowExtractors.ExtractFromRow fourth)` Obtain an extractor of a tuple containing each of the values from the supplied extractors.
    `static RowExtractors.ExtractFromRow` | `extractParentNodeKey(int indexInRow, NodeCache cache, TypeSystem types)` Create an extractor that extracts the parent's `NodeKey` from the node at the given position in the row.
    `static RowExtractors.ExtractFromRow` | `extractParentPath(int indexInRow, NodeCache cache, TypeSystem types)` Create an extractor that extracts the parent path from the node at the given position in the row.
    `static RowExtractors.ExtractFromRow` | `extractPath(int indexInRow, NodeCache cache, TypeSystem types)` Create an extractor that extracts the path from the node at the given position in the row.
    `static RowExtractors.ExtractFromRow` | `extractPropertyValue(Name propertyName, int indexInRow, NodeCache cache, TypeSystem.TypeFactory<?> desiredType)` Create an extractor that extracts the property value from the node at the given position in the row.
    `static RowExtractors.ExtractFromRow` | `extractRelativePath(int indexInRow, Path relativePath, NodeCache cache, TypeSystem types)` Create an extractor that extracts the path from the node at the given position in the row and applies the relative path.
    `static RowExtractors.ExtractFromRow` | `extractUniqueKey(int rowWidth, TypeSystem types)` Create an extractor that extracts an object that uniquely identifies the row.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### convert

          public static RowExtractors.ExtractFromRow convert(RowExtractors.ExtractFromRow extractor,
                                             TypeSystem.TypeFactory<?> newType)

      Obtain a new `RowExtractors.ExtractFromRow` instance that uses the supplied row extractor but converts the value to the supplied type.
      Parameters:
        `extractor` - the extractor that obtains a value from the row; may not be null
        `newType` - the factory for the desired type; may not be null
      Returns:
        the converting row extractor instance; never null

    - #### extractFullText

          public static RowExtractors.ExtractFromRow extractFullText(int indexInRow,
                                                     NodeCache cache,
                                                     TypeSystem types,
                                                     BinaryStore binaries)

      Obtain a new `RowExtractors.ExtractFromRow` instance that will extract the full text for a node.

      Note that if the node is null at the specified index in the row, the extractor's `ExtractFromRow#getValueInRow(RowAccessor)` will return null.

      Parameters:
        `indexInRow` - the index of the selector in the row; presumed to be valid
        `cache` - the node cache; may not be null
        `types` - the system of types; may not be null
        `binaries` - the binary store; may not be null
      Returns:
        the object that extracts a value from the row; never null

    - #### extractFullText

          public static RowExtractors.ExtractFromRow extractFullText(int indexInRow,
                                                     NodeCache cache,
                                                     Name propertyName,
                                                     TypeSystem types,
                                                     BinaryStore binaries)

      Obtain a new `RowExtractors.ExtractFromRow` instance that will extract the full text for a single property of a node.

      Note that if the named property does not exist on a node or the node is null at the specified index in the row, the extractor's `ExtractFromRow#getValueInRow(RowAccessor)` will return null.

      Parameters:
        `indexInRow` - the index of the selector in the row; presumed to be valid
        `cache` - the node cache; may not be null
        `propertyName` - the name of the property from which the full text is to be extracted; may not be null
        `types` - the system of types; may not be null
        `binaries` - the binary store; may not be null
      Returns:
        the object that extracts a value from the row; never null

    - #### extractFullTextFrom

          protected static void extractFullTextFrom(Property property,
                                 TypeSystem.TypeFactory<String> type,
                                 StringBuilder fullTextString,
                                 BinaryStore binaries,
                                 CachedNode node,
                                 NodeCache cache)

    - #### extractFullTextFrom

          public static void extractFullTextFrom(Object propertyValue,
                                 TypeSystem.TypeFactory<String> type,
                                 BinaryStore binaries,
                                 StringBuilder fullTextString)

    - #### extractNodeKey

          public static RowExtractors.ExtractFromRow extractNodeKey(int indexInRow,
                                                    NodeCache cache,
                                                    TypeSystem types)

      Create an extractor that extracts the `NodeKey` from the node at the given position in the row.
      Parameters:
        `indexInRow` - the index of the node in the rows; must be valid
        `cache` - the cache containing the nodes; may not be null
        `types` - the type system; may not be null
      Returns:
        the node key extractor; never null

    - #### extractParentNodeKey

          public static RowExtractors.ExtractFromRow extractParentNodeKey(int indexInRow,
                                                          NodeCache cache,
                                                          TypeSystem types)

      Create an extractor that extracts the parent's `NodeKey` from the node at the given position in the row.
      Parameters:
        `indexInRow` - the index of the node in the rows; must be valid
        `cache` - the cache containing the nodes; may not be null
        `types` - the type system; may not be null
      Returns:
        the node key extractor; never null

    - #### extractPath

          public static RowExtractors.ExtractFromRow extractPath(int indexInRow,
                                                 NodeCache cache,
                                                 TypeSystem types)

      Create an extractor that extracts the path from the node at the given position in the row.
      Parameters:
        `indexInRow` - the index of the node in the rows; must be valid
        `cache` - the cache containing the nodes; may not be null
        `types` - the type system; may not be null
      Returns:
        the path extractor; never null

    - #### extractParentPath

          public static RowExtractors.ExtractFromRow extractParentPath(int indexInRow,
                                                       NodeCache cache,
                                                       TypeSystem types)

      Create an extractor that extracts the parent path from the node at the given position in the row.
      Parameters:
        `indexInRow` - the index of the node in the rows; must be valid
        `cache` - the cache containing the nodes; may not be null
        `types` - the type system; may not be null
      Returns:
        the path extractor; never null

    - #### extractRelativePath

          public static RowExtractors.ExtractFromRow extractRelativePath(int indexInRow,
                                                         Path relativePath,
                                                         NodeCache cache,
                                                         TypeSystem types)

      Create an extractor that extracts the path from the node at the given position in the row and applies the relative path.
      Parameters:
        `indexInRow` - the index of the node in the rows; must be valid
        `relativePath` - the relative path that should be applied to the nodes' path; may not be null and must be a valid relative path
        `cache` - the cache containing the nodes; may not be null
        `types` - the type system; may not be null
      Returns:
        the path extractor; never null

    - #### extractName

          public static RowExtractors.ExtractFromRow extractName(int indexInRow,
                                                 NodeCache cache,
                                                 TypeSystem types)

      Create an extractor that extracts the name from the node at the given position in the row.
      Parameters:
        `indexInRow` - the index of the node in the rows; must be valid
        `cache` - the cache containing the nodes; may not be null
        `types` - the type system; may not be null
      Returns:
        the path extractor; never null

    - #### extractLocalName

          public static RowExtractors.ExtractFromRow extractLocalName(int indexInRow,
                                                      NodeCache cache,
                                                      TypeSystem types)

      Create an extractor that extracts the name from the node at the given position in the row.
      Parameters:
        `indexInRow` - the index of the node in the rows; must be valid
        `cache` - the cache containing the nodes; may not be null
        `types` - the type system; may not be null
      Returns:
        the path extractor; never null

    - #### extractUniqueKey

          public static RowExtractors.ExtractFromRow extractUniqueKey(int rowWidth,
                                                      TypeSystem types)

      Create an extractor that extracts an object that uniquely identifies the row. The object will be either a `NodeKey` (if rowWidth is 1), or a `tuple` containing each of the `NodeKey`s of the nodes in the row. Note that any of the node keys can be null, but this extractor will never return a null object.
      Parameters:
        `rowWidth` - the number of nodes in each row; must be positive
        `types` - the types system; may not be null
      Returns:
        the extractor; never null

    - #### extractPropertyValue

          public static RowExtractors.ExtractFromRow extractPropertyValue(Name propertyName,
                                                          int indexInRow,
                                                          NodeCache cache,
                                                          TypeSystem.TypeFactory<?> desiredType)

      Create an extractor that extracts the property value from the node at the given position in the row.
      Parameters:
        `propertyName` - the name of the property; may not be null
        `indexInRow` - the index of the node in the rows; must be valid
        `cache` - the cache containing the nodes; may not be null
        `desiredType` - the desired type, which should be converted from the actual value; may not be null
      Returns:
        the path extractor; never null

    - #### extractorWith

          public static RowExtractors.ExtractFromRow extractorWith(RowExtractors.ExtractFromRow first,
                                                   RowExtractors.ExtractFromRow second)

      Obtain an extractor of a tuple containing each of the values from the supplied extractors.
      Parameters:
        `first` - the first extractor; may not be null
        `second` - the second extractor; may not be null
      Returns:
        the tuple extractor

    - #### extractorWith

          public static RowExtractors.ExtractFromRow extractorWith(RowExtractors.ExtractFromRow first,
                                                   RowExtractors.ExtractFromRow second,
                                                   RowExtractors.ExtractFromRow third)

      Obtain an extractor of a tuple containing each of the values from the supplied extractors.
      Parameters:
        `first` - the first extractor; may not be null
        `second` - the second extractor; may not be null
        `third` - the third extractor; may not be null
      Returns:
        the tuple extractor

    - #### extractorWith

          public static RowExtractors.ExtractFromRow extractorWith(RowExtractors.ExtractFromRow first,
                                                   RowExtractors.ExtractFromRow second,
                                                   RowExtractors.ExtractFromRow third,
                                                   RowExtractors.ExtractFromRow fourth)

      Obtain an extractor of a tuple containing each of the values from the supplied extractors.
      Parameters:
        `first` - the first extractor; may not be null
        `second` - the second extractor; may not be null
        `third` - the third extractor; may not be null
        `fourth` - the fourth extractor; may not be null
      Returns:
        the tuple extractor

    - #### extractorWith

          public static RowExtractors.ExtractFromRow extractorWith(Collection<RowExtractors.ExtractFromRow> extractors)

      Obtain an extractor of a tuple containing each of the values from the supplied extractors.
      Parameters:
        `extractors` - the extractors; may not be null or empty
      Returns:
        the tuple extractor

    - #### extractorWith

          public static RowExtractors.ExtractFromRow extractorWith(RowExtractors.ExtractFromRow extractor,
                                                   Order order,
                                                   NullOrder nullOrder)

      Create an extractor that has a `type factory` with a `comparator` that sorts according to the specified order and null-order behavior.
      Parameters:
        `extractor` - the original extractor; may not be null
        `order` - the specification of whether the comparator should order ascending or descending; may not be null
        `nullOrder` - the specification of whether null values should appear first or last; may not be null
      Returns:
        the extractor that is identical except that it has an inverted comparator; never null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.