Class BasicTagPath

    • Field Detail

      • EMPTY_LIST

        protected static final java.util.List<java.lang.String> EMPTY_LIST
      • pathParts

        protected java.util.List<java.lang.String> pathParts
      • source

        protected java.lang.String source
      • parent

        protected transient TagPath parent
    • Constructor Detail

      • BasicTagPath

        public BasicTagPath​(java.lang.String source,
                            java.util.List<java.lang.String> pathParts,
                            Property<?> prop)
        Creates a tag path to a tag's property
      • BasicTagPath

        public BasicTagPath​(java.lang.String source,
                            java.util.List<java.lang.String> pathParts)
        Creates a tag path to a folder. System will be null.
      • BasicTagPath

        public BasicTagPath​(java.lang.String source)
    • Method Detail

      • renameParentFolder

        public static BasicTagPath renameParentFolder​(TagPath path,
                                                      TagPath newParent)
        Creates a path equal to the original, but with the new name specified by newParent. The parent cannot change length, it can only be renamed.
      • append

        public static TagPath append​(@Nullable
                                     TagPath root,
                                     TagPath other)
        Takes a folder path, and appends the second tag path on to it. The returned tag will have the source and system of the root path, unless the root path source/system are null (not just empty string).
      • append

        public static TagPath append​(TagPath root,
                                     java.lang.String name)
        Extends the tag path by the given name. Similar to getChildPath, however this static version will accept a null value for parent, and will generate a new path with just the name if necessary.
      • subPath

        public static BasicTagPath subPath​(TagPath path,
                                           int start,
                                           int len)
        Returns a sub portion of the path. If the specified length covers the last component, the source path's property will be included in the resulting path as well. Does NOT include the source, because this is now intended to be a relative path to the original one.
      • subPath

        public static BasicTagPath subPath​(TagPath parent,
                                           TagPath child)
        Returns a sub portion of the child path that extends beyond the parent path. Source will be empty, and the property will only be included if set on the child.
      • setPathParts

        protected void setPathParts​(java.util.List<java.lang.String> parts)
      • getItemName

        public java.lang.String getItemName()
        Description copied from interface: TagPath
        Returns the name of the item at the end of the path that this path points to. This will be a tag name or a folder name.
        Specified by:
        getItemName in interface TagPath
      • getLastPathComponent

        public java.lang.String getLastPathComponent()
        Description copied from interface: Path
        Convenience function to return the last path element.
        Specified by:
        getLastPathComponent in interface Path
      • setParent

        protected void setParent​(TagPath value)
      • getProperty

        public Property<?> getProperty()
        Description copied from interface: TagPath
        Returns the type of property in the tag that this path is referencing.
        Specified by:
        getProperty in interface TagPath
      • getSource

        public java.lang.String getSource()
        Description copied from interface: TagPath
        Returns the source for this tag path. Some tag paths don't have a source, indicating that they may be a relative, or they may wish to use a default source.
        Specified by:
        getSource in interface TagPath
      • getPathComponent

        public java.lang.String getPathComponent​(int i)
        Description copied from interface: Path
        Returns the path element at the specified location.
        Specified by:
        getPathComponent in interface Path
      • getPathLength

        public int getPathLength()
        Description copied from interface: Path
        Returns the number of elements in the path, which can be retrieved through getPathComponent().
        Specified by:
        getPathLength in interface Path
      • getChildPath

        public TagPath getChildPath​(java.lang.String nextId)
        Description copied from interface: TagPath
        Returns a path below the current path.
        Specified by:
        getChildPath in interface TagPath
      • createDerivedTagPath

        protected TagPath createDerivedTagPath​(TagPath parent,
                                               java.lang.String source,
                                               java.util.List<java.lang.String> parts,
                                               Property<?> prop)