org.modeshape.jcr.value

## Interface PathFactory

- All Superinterfaces:
    ValueFactory<Path>
  All Known Implementing Classes:
    PathValueFactory

      @ThreadSafe
      public interface PathFactory
      extends ValueFactory<Path>

  A factory for creating `paths`. This interface extends the `ValueFactory` generic interface and adds specific methods for creating paths (and relative paths) from a series of names, segments, or combinations.

- - ### Field Summary

    - ### Fields inherited from interface org.modeshape.jcr.value.ValueFactory

      `DEFAULT_DECODER, DEFAULT_ENCODER`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Path` | `create(Path parentPath, Iterable<Path.Segment> segments)` Create a path by appending the supplied names to the parent path.
    `Path` | `create(Path parentPath, Name... segmentNames)` Create a path by appending the supplied names to the parent path.
    `Path` | `create(Path parentPath, Name segmentName, int index)` Create a path by appending the supplied names to the parent path.
    `Path` | `create(Path parentPath, Path.Segment... segments)` Create a path by appending the supplied names to the parent path.
    `Path` | `create(Path parentPath, Path childPath)` Create a path by appending the supplied relative path to the supplied parent path.
    `Path` | `create(Path parentPath, String subpath)` Create a path by appending the supplied names to the parent path.
    `Path` | `create(Path parentPath, String segmentName, int index)` Create a path by appending the supplied names to the parent path.
    `Path` | `createAbsolutePath(Iterable<Path.Segment> segments)` Create an absolute path with the supplied segments, in order.
    `Path` | `createAbsolutePath(Name... segmentNames)` Create an absolute path with the supplied segment names, in order.
    `Path` | `createAbsolutePath(Path.Segment... segments)` Create an absolute path with the supplied segments, in order.
    `Path` | `createRelativePath()` Create an empty relative path (i.e., equivalent to `createRelativePath`( `Path.SELF_SEGMENT`)).
    `Path` | `createRelativePath(Iterable<Path.Segment> segments)` Create a relative path with the supplied segments, in order.
    `Path` | `createRelativePath(Name... segmentNames)` Create a relative path with the supplied segment names, in order.
    `Path` | `createRelativePath(Path.Segment... segments)` Create a relative path with the supplied segments, in order.
    `Path` | `createRootPath()` Create an absolute root path.
    `Path.Segment` | `createSegment(Name segmentName)` Create a path segment given the supplied segment name.
    `Path.Segment` | `createSegment(Name segmentName, int index)` Create a path segment given the supplied segment name and index.
    `Path.Segment` | `createSegment(String segmentName)` Create a path segment given the supplied segment name.
    `Path.Segment` | `createSegment(String segmentName, int index)` Create a path segment given the supplied segment name and index.
    `Path.Segment` | `createSegment(String segmentName, TextDecoder decoder)` Create a path segment given the supplied segment name.
    `PathFactory` | `with(ValueFactories valueFactories)` Return a potentially new copy of this factory that uses the supplied ValueFactories object.

    - ### Methods inherited from interface org.modeshape.jcr.value.ValueFactory

      `create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, createEmptyArray, getPropertyType`

- - ### Method Detail

    - #### with

          PathFactory with(ValueFactories valueFactories)

      Description copied from interface: `ValueFactory`
      Return a potentially new copy of this factory that uses the supplied ValueFactories object.
      Specified by:
        `with` in interface `ValueFactory<Path>`
      Parameters:
        `valueFactories` - the value factories object; may not be null
      Returns:
        the factory, which may be a new instance or may be this object if the supplied value factories is the same as used by this factory; never null

    - #### createRootPath

          Path createRootPath()

      Create an absolute root path. Subsequent calls will always return the same instance.
      Returns:
        the new path

    - #### createAbsolutePath

          Path createAbsolutePath(Name... segmentNames)

      Create an absolute path with the supplied segment names, in order. If no segments are provided, the result will be the root path.
      Parameters:
        `segmentNames` - the names of the segments
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if at least one segment name is provided and if any of the supplied segment names are null

    - #### createAbsolutePath

          Path createAbsolutePath(Path.Segment... segments)

      Create an absolute path with the supplied segments, in order. If no segments are provided, the result will be the root path.
      Parameters:
        `segments` - the segments
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if at least one segment is provided and if any of the supplied segments are null

    - #### createAbsolutePath

          Path createAbsolutePath(Iterable<Path.Segment> segments)

      Create an absolute path with the supplied segments, in order. If no segments are provided, the result will be the root path.
      Parameters:
        `segments` - the segments
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if at least one segment is provided and if any of the supplied segments are null

    - #### createRelativePath

          Path createRelativePath()

      Create an empty relative path (i.e., equivalent to `createRelativePath`( `Path.SELF_SEGMENT`)). Subsequent calls will always return the same instance.
      Returns:
        the new path

    - #### createRelativePath

          Path createRelativePath(Name... segmentNames)

      Create a relative path with the supplied segment names, in order. If no segments are provided, the result will be the root path.
      Parameters:
        `segmentNames` - the names of the segments
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if at least one segment name is provided and if any of the supplied segment names are null

    - #### createRelativePath

          Path createRelativePath(Path.Segment... segments)

      Create a relative path with the supplied segments, in order. If no segments are provided, the result will be the root path.
      Parameters:
        `segments` - the segments
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if at least one segment is provided and if any of the supplied segments are null

    - #### createRelativePath

          Path createRelativePath(Iterable<Path.Segment> segments)

      Create a relative path with the supplied segments, in order. If no segments are provided, the result will be the root path.
      Parameters:
        `segments` - the segments
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if at least one segment is provided and if any of the supplied segments are null

    - #### create

          Path create(Path parentPath,
                    Path childPath)

      Create a path by appending the supplied relative path to the supplied parent path. The resulting path will be `absolute` if the supplied parent path is absolute.
      Parameters:
        `parentPath` - the path that is to provide the basis for the new path
        `childPath` - the path that should be appended to the parent path
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if the parent path reference or the child path reference is null

    - #### create

          Path create(Path parentPath,
                    Name segmentName,
                    int index)

      Create a path by appending the supplied names to the parent path.
      Parameters:
        `parentPath` - the path that is to provide the basis for the new path
        `segmentName` - the name of the segment to be appended to the parent path
        `index` - the index for the new segment
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if the parent path reference or the segment name is null, or if the index is invalid

    - #### create

          Path create(Path parentPath,
                    String segmentName,
                    int index)

      Create a path by appending the supplied names to the parent path.
      Parameters:
        `parentPath` - the path that is to provide the basis for the new path
        `segmentName` - the name of the segment to be appended to the parent path
        `index` - the index for the new segment
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if the parent path reference or the segment name is null, or if the index is invalid

    - #### create

          Path create(Path parentPath,
                    Name... segmentNames)

      Create a path by appending the supplied names to the parent path. If no names are appended, the parent path is returned.
      Parameters:
        `parentPath` - the path that is to provide the basis for the new path
        `segmentNames` - the names of the segments that are to be appended, in order, to the parent path
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if the parent path reference is null, or if at least one segment name is provided and if any of the supplied segment names are null

    - #### create

          Path create(Path parentPath,
                    Path.Segment... segments)

      Create a path by appending the supplied names to the parent path. If no names are appended, the parent path is returned.
      Parameters:
        `parentPath` - the path that is to provide the basis for the new path
        `segments` - the segments that are to be appended, in order, to the parent path
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if the parent path reference is null, or if at least one segment name is provided and if any of the supplied segment names are null

    - #### create

          Path create(Path parentPath,
                    Iterable<Path.Segment> segments)

      Create a path by appending the supplied names to the parent path. If no names are appended, the parent path is returned.
      Parameters:
        `parentPath` - the path that is to provide the basis for the new path
        `segments` - the segments that are to be appended, in order, to the parent path
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if the parent path reference is null, or if at least one segment name is provided and if any of the supplied segment names are null

    - #### create

          Path create(Path parentPath,
                    String subpath)

      Create a path by appending the supplied names to the parent path.
      Parameters:
        `parentPath` - the path that is to provide the basis for the new path
        `subpath` - the subpath to be appended to the parent path, which must be in the form of a relative path
      Returns:
        the new path
      Throws:
        `IllegalArgumentException` - if the parent path reference or the segment name is null, or if the index is invalid

    - #### createSegment

          Path.Segment createSegment(String segmentName)

      Create a path segment given the supplied segment name. The supplied string may contain a same-name-sibling index in the form of "`[n]`" at the end of the name, where n is a positive integer. Note that the same-name-sibling index is 1-based, not zero-based.
      Parameters:
        `segmentName` - the name of the segment
      Returns:
        the segment
      Throws:
        `IllegalArgumentException` - if the segment name reference is `null` or the value could not be created from the supplied string
        `ValueFormatException` - if the same-name-sibling index is not an integer, or if the supplied string is not a valid segment name

    - #### createSegment

          Path.Segment createSegment(String segmentName,
                                   TextDecoder decoder)

      Create a path segment given the supplied segment name. The supplied string may contain a same-name-sibling index in the form of "`[n]`" at the end of the name, where n is a positive integer. Note that the same-name-sibling index is 1-based, not zero-based.
      Parameters:
        `segmentName` - the name of the segment
        `decoder` - the decoder that should be used to decode the qualified name
      Returns:
        the segment
      Throws:
        `IllegalArgumentException` - if the segment name reference is `null` or the value could not be created from the supplied string
        `ValueFormatException` - if the same-name-sibling index is not an integer, or if the supplied string is not a valid segment name

    - #### createSegment

          Path.Segment createSegment(String segmentName,
                                   int index)

      Create a path segment given the supplied segment name and index.
      Parameters:
        `segmentName` - the name of the new segment
        `index` - the index of the new segment
      Returns:
        the segment
      Throws:
        `IllegalArgumentException` - if the segment name reference is `null` or if the index is invalid
        `ValueFormatException` - if the supplied string is not a valid segment name

    - #### createSegment

          Path.Segment createSegment(Name segmentName)

      Create a path segment given the supplied segment name. The resulting segment will have no index.
      Parameters:
        `segmentName` - the name of the segment
      Returns:
        the segment
      Throws:
        `IllegalArgumentException` - if the segment name reference is null

    - #### createSegment

          Path.Segment createSegment(Name segmentName,
                                   int index)

      Create a path segment given the supplied segment name and index.
      Parameters:
        `segmentName` - the name of the new segment
        `index` - the index of the new segment
      Returns:
        the segment
      Throws:
        `IllegalArgumentException` - if the segment name reference is null or if the index is invalid

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