Class PathFactoryImpl

  • All Implemented Interfaces:
    PathFactory

    public class PathFactoryImpl
    extends java.lang.Object
    implements PathFactory
    PathFactoryImpl...
    • Method Detail

      • getInstance

        public static PathFactory getInstance()
      • create

        public Path create​(Path parent,
                           Path relPath,
                           boolean normalize)
                    throws java.lang.IllegalArgumentException,
                           javax.jcr.RepositoryException
        Description copied from interface: PathFactory
        Return a new Path out of the given parent path and the given relative path. If normalize is true, the returned path will be normalized (or canonicalized, if the parent path is absolute).
        Specified by:
        create in interface PathFactory
        Returns:
        Throws:
        java.lang.IllegalArgumentException - if relPath is absolute.
        javax.jcr.RepositoryException - If the normalized is true and the resulting path cannot be normalized.
        See Also:
        PathFactory.create(Path, Path, boolean)
      • create

        public Path create​(Path parent,
                           Name name,
                           boolean normalize)
                    throws javax.jcr.RepositoryException
        Description copied from interface: PathFactory
        Creates a new Path out of the given parent path and the give name. If normalize is true, the returned path will be normalized (or canonicalized, if the parent path is absolute). Use PathFactory.create(Path, Name, int, boolean) in order to build a Path having an index with his name element.
        Specified by:
        create in interface PathFactory
        Parameters:
        parent - the parent path
        name - the name of the new path element.
        normalize - If true the Path is normalized before being returned.
        Returns:
        Throws:
        javax.jcr.RepositoryException - If the normalized is true and the resulting path cannot be normalized.
        See Also:
        PathFactory.create(Path, Name, boolean)
      • create

        public Path create​(Path parent,
                           Name name,
                           int index,
                           boolean normalize)
                    throws java.lang.IllegalArgumentException,
                           javax.jcr.RepositoryException
        Description copied from interface: PathFactory
        Creates a new Path out of the given parent path and the give name and normalized index. See also PathFactory.create(Path, Name, boolean).
        Specified by:
        create in interface PathFactory
        Parameters:
        parent - the parent path.
        name - the name of the new path element.
        index - the index of the new path element.
        normalize - If true the Path is normalized before being returned.
        Returns:
        Throws:
        java.lang.IllegalArgumentException - If the given index is lower than Path.INDEX_UNDEFINED.
        javax.jcr.RepositoryException - If the normalized is true and the resulting path cannot be normalized.
        See Also:
        PathFactory.create(Path, Name, int, boolean)
      • create

        public Path create​(Name name)
                    throws java.lang.IllegalArgumentException
        Description copied from interface: PathFactory
        Creates a relative path based on a Name.
        Specified by:
        create in interface PathFactory
        Parameters:
        name - single Name for this relative path.
        Returns:
        the relative path created from name.
        Throws:
        java.lang.IllegalArgumentException - if the name is null.
        See Also:
        PathFactory.create(Name)
      • create

        public Path create​(Name name,
                           int index)
                    throws java.lang.IllegalArgumentException
        Description copied from interface: PathFactory
        Creates a relative path based on a Name and a normalized index. Same as PathFactory.create(Name) but allows to explicitly specify an index.
        Specified by:
        create in interface PathFactory
        Parameters:
        name - single Name for this relative path.
        index - index of the single name element.
        Returns:
        the relative path created from name and normalizedIndex.
        Throws:
        java.lang.IllegalArgumentException - if index is lower than Path.INDEX_UNDEFINED or if the name is not valid.
        See Also:
        PathFactory.create(Name, int)
      • create

        public Path create​(Path.Element element)
        Description copied from interface: PathFactory
        Creates a path from the given element.
        Specified by:
        create in interface PathFactory
        Parameters:
        element - path element
        Returns:
        the created path
      • create

        public Path create​(java.lang.String pathString)
                    throws java.lang.IllegalArgumentException
        Description copied from interface: PathFactory
        Returns a Path holding the value of the specified string. The string must be in the format returned by the Path.getString() method.
        Specified by:
        create in interface PathFactory
        Parameters:
        pathString - a String containing the Path representation to be parsed.
        Returns:
        the Path represented by the argument
        Throws:
        java.lang.IllegalArgumentException - if the specified string can not be parsed as a Path.
        See Also:
        PathFactory.create(String)
      • createElement

        public Path.Element createElement​(java.lang.String identifier)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: PathFactory
        Creates a path element from the given identifier.
        Specified by:
        createElement in interface PathFactory
        Parameters:
        identifier - Node identifier for which the path element should be created.
        Returns:
        a path element.
        Throws:
        java.lang.IllegalArgumentException - If the identifier is null.