Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Spring Data Commons
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.data.repository.query.parser
Class PartTree

    java.lang.Object
      org.springframework.data.repository.query.parser.PartTree

All Implemented Interfaces:
  Iterable<PartTree.OrPart>

    public class PartTree

extends Object
implements Iterable<PartTree.OrPart>

Class to parse a `String` into a tree or `PartTree.OrPart`s consisting of simple `PartTree.OrPart` instances in turn. Takes a domain class as well to validate that each of the `PartTree.OrPart`s are refering to a property of the domain class. The `PartTree` can then be used to build queries based on its API instead of parsing the method name for each query execution.

Author:
  Oliver Gierke

Nested Class Summary
`static class` | `PartTree.OrPart` A part of the parsed source that results from splitting up the resource ar Or keywords.

Constructor Summary
`PartTree(String source, Class<?> domainClass)` Creates a new `PartTree` by parsing the given `String`

Method Summary
`Iterable<Part>` | `getParts()` Returns an `Iterable` of all parts contained in the `PartTree`.
`Sort` | `getSort()` Returns the `Sort` specification parsed from the source.
`boolean` | `isDistinct()` Returns whether we indicate distinct lookup of entities.
`Iterator<PartTree.OrPart>` | `iterator()`
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### PartTree

    public PartTree(String source,
                    Class<?> domainClass)

  Creates a new `PartTree` by parsing the given `String`

  Parameters:
    `source` - the `String` to parse
    `domainClass` - the domain class to check indiviual parts against to ensure they refer to a property of the class

Method Detail

### iterator

    public Iterator<PartTree.OrPart> iterator()

  Specified by:
    `iterator` in interface `Iterable<PartTree.OrPart>`

### getSort

    public Sort getSort()

  Returns the `Sort` specification parsed from the source.

  Returns:

### isDistinct

    public boolean isDistinct()

  Returns whether we indicate distinct lookup of entities.

  Returns:

### getParts

    public Iterable<Part> getParts()

  Returns an `Iterable` of all parts contained in the `PartTree`.

  Returns:

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Spring Data Commons
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011. All Rights Reserved.