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

## org.modeshape.graph.connector.federation
Class Projection.PathRule

    java.lang.Object
      org.modeshape.graph.connector.federation.Projection.Rule
          org.modeshape.graph.connector.federation.Projection.PathRule

All Implemented Interfaces:
  Comparable<Projection.Rule>

Enclosing class:
  Projection

    @Immutable
    public static class Projection.PathRule

extends Projection.Rule

A rule that is defined with a single `path in source` and a single `path in repository`, and which has a set of `path exceptions` (relative paths below the path in source).

Author:
  Randall Hauch

Constructor Summary
`Projection.PathRule(Path repositoryPath, Path sourcePath)`
`Projection.PathRule(Path repositoryPath, Path sourcePath, List<Path> exceptions)`
`Projection.PathRule(Path repositoryPath, Path sourcePath, Path... exceptions)`

Method Summary
`int` | `compareTo(Projection.Rule other)`
`boolean` | `equals(Object obj)`
`List<Path>` | `getExceptionsToRule()` Get the paths that define the exceptions to this rule.
`Path` | `getPathInRepository()` The path where the content is to be placed ("projected") into the repository.
`Path` | `getPathInRepository(Path pathInSource, PathFactory factory)` Get the path in repository that is projected from the supplied source path, or null if the supplied source path is not projected into the repository.
`Path` | `getPathInSource()` The path of the content as known to the source
`Path` | `getPathInSource(Path pathInRepository, PathFactory factory)` Get the path in source that is projected from the supplied repository path, or null if the supplied repository path is not projected into the source.
`String` | `getString()`
`String` | `getString(NamespaceRegistry registry, TextEncoder encoder)`
`String` | `getString(TextEncoder encoder)`
`List<Path>` | `getTopLevelPathsInRepository(PathFactory factory)` Get the paths in the repository that serve as top-level nodes exposed by this rule.
`boolean` | `hasExceptionsToRule()` Get whether this rule has any exceptions.
`int` | `hashCode()`
`protected boolean` | `includes(Path pathInSource)`
`boolean` | `isTopLevelPath(Path path)` Determine if the supplied path is the same as one of the top-level nodes exposed by this rule.
`protected Path` | `projectPathInRepositoryToPathInSource(Path pathInRepository, PathFactory factory)` Convert a path defined in the repository system into an equivalent path in the source system.
`protected Path` | `projectPathInSourceToPathInRepository(Path pathInSource, PathFactory factory)` Convert a path defined in the source system into an equivalent path in the repository system.
`String` | `toString()`

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

Constructor Detail

### Projection.PathRule

    public Projection.PathRule(Path repositoryPath,
                               Path sourcePath)

### Projection.PathRule

    public Projection.PathRule(Path repositoryPath,
                               Path sourcePath,
                               Path... exceptions)

### Projection.PathRule

    public Projection.PathRule(Path repositoryPath,
                               Path sourcePath,
                               List<Path> exceptions)

Method Detail

### getPathInRepository

    public Path getPathInRepository()

  The path where the content is to be placed ("projected") into the repository.

  Returns:
    the projected path of the content in the repository; never null

### getPathInSource

    public Path getPathInSource()

  The path of the content as known to the source

  Returns:
    the source-specific path of the content; never null

### hasExceptionsToRule

    public boolean hasExceptionsToRule()

  Get whether this rule has any exceptions.

  Returns:
    true if this rule has exceptions, or false if it has none.

### getExceptionsToRule

    public List<Path> getExceptionsToRule()

  Get the paths that define the exceptions to this rule. These paths are always relative to the `path in source`.

  Returns:
    the unmodifiable exception paths; never null but possibly empty

### includes

    protected boolean includes(Path pathInSource)

  Parameters:
    `pathInSource` -
  Returns:
    true if the source path is included by this rule

### getTopLevelPathsInRepository

    public List<Path> getTopLevelPathsInRepository(PathFactory factory)

  Get the paths in the repository that serve as top-level nodes exposed by this rule.

  Specified by:
    `getTopLevelPathsInRepository` in class `Projection.Rule`
  Parameters:
    `factory` - the path factory that can be used to create new paths; may not be null
  Returns:
    the list of top-level paths, which are ordered and which must be unique; never null
  See Also:
    `Projection.Rule.getTopLevelPathsInRepository(org.modeshape.graph.property.PathFactory)`

### isTopLevelPath

    public boolean isTopLevelPath(Path path)

  Determine if the supplied path is the same as one of the top-level nodes exposed by this rule.

  Specified by:
    `isTopLevelPath` in class `Projection.Rule`
  Parameters:
    `path` - the path; may not be null
  Returns:
    true if the supplied path is also one of the `top-level paths` , or false otherwise
  See Also:
    `Projection.Rule.isTopLevelPath(org.modeshape.graph.property.Path)`

### getPathInSource

    public Path getPathInSource(Path pathInRepository,
                                PathFactory factory)

  Get the path in source that is projected from the supplied repository path, or null if the supplied repository path is not projected into the source.

  This method considers a path that is at or below the rule's `source path` to be included, except if there are `exceptions` that explicitly disallow the path.

  Specified by:
    `getPathInSource` in class `Projection.Rule`
  Parameters:
    `pathInRepository` - the path in the repository; may not be null
    `factory` - the path factory; may not be null
  Returns:
    the path in source if it is projected by this rule, or null otherwise
  See Also:
    `Projection.Rule.getPathInSource(Path, PathFactory)`

### getPathInRepository

    public Path getPathInRepository(Path pathInSource,
                                    PathFactory factory)

  Get the path in repository that is projected from the supplied source path, or null if the supplied source path is not projected into the repository.

  Specified by:
    `getPathInRepository` in class `Projection.Rule`
  Parameters:
    `pathInSource` - the path in the source; may not be null
    `factory` - the path factory; may not be null
  Returns:
    the path in repository if it is projected by this rule, or null otherwise
  See Also:
    `Projection.Rule.getPathInRepository(org.modeshape.graph.property.Path, org.modeshape.graph.property.PathFactory)`

### projectPathInSourceToPathInRepository

    protected Path projectPathInSourceToPathInRepository(Path pathInSource,
                                                         PathFactory factory)

  Convert a path defined in the source system into an equivalent path in the repository system.

  Parameters:
    `pathInSource` - the path in the source system, which may include the `getPathInSource()`
    `factory` - the path factory; may not be null
  Returns:
    the path in the repository system, which will be normalized and absolute (including the `getPathInRepository()`), or null if the path is not at or under the `getPathInSource()`

### projectPathInRepositoryToPathInSource

    protected Path projectPathInRepositoryToPathInSource(Path pathInRepository,
                                                         PathFactory factory)

  Convert a path defined in the repository system into an equivalent path in the source system.

  Parameters:
    `pathInRepository` - the path in the repository system, which may include the `getPathInRepository()`
    `factory` - the path factory; may not be null
  Returns:
    the path in the source system, which will be normalized and absolute (including the `getPathInSource()` ), or null if the path is not at or under the `getPathInRepository()`

### getString

    public String getString(NamespaceRegistry registry,
                            TextEncoder encoder)

  Specified by:
    `getString` in class `Projection.Rule`

### getString

    public String getString(TextEncoder encoder)

  Specified by:
    `getString` in class `Projection.Rule`
  See Also:
    `Projection.Rule.getString(org.modeshape.common.text.TextEncoder)`

### getString

    public String getString()

  Specified by:
    `getString` in class `Projection.Rule`
  See Also:
    `Projection.Rule.getString()`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`
  See Also:
    `Object.hashCode()`

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`
  See Also:
    `Object.equals(java.lang.Object)`

### compareTo

    public int compareTo(Projection.Rule other)

  See Also:
    `Comparable.compareTo(java.lang.Object)`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`
  See Also:
    `Object.toString()`

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

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