Class TagPathUtils


  • public class TagPathUtils
    extends java.lang.Object
    Created by colby.clegg on 7/14/2015.
    • Constructor Detail

      • TagPathUtils

        public TagPathUtils()
    • Method Detail

      • downgrade

        @Deprecated
        public static TagPath downgrade​(TagPath path)
        Deprecated.
      • downgrade

        @Deprecated
        public static java.util.List<TagPath> downgrade​(java.util.List<TagPath> paths)
        Deprecated.
      • upgrade

        public static java.util.List<TagPath> upgrade​(java.util.List<TagPath> paths)
      • upgradeToList

        public static java.util.List<TagPath> upgradeToList​(java.util.Collection<TagPath> paths)
      • upgrade

        public static java.util.Set<TagPath> upgrade​(java.util.Set<TagPath> paths)
      • getNonArrayPath

        @Deprecated
        public static TagPath getNonArrayPath​(TagPath path)
        Deprecated.
        use getNonSubIndexPath going forward.
        Given a path, returns a version that does not include array subset information. Works fine if the source path is not an array path to begin with.
      • getNonSubIndexPath

        public static TagPath getNonSubIndexPath​(TagPath path)
      • getArrayPath

        public static TagPath getArrayPath​(TagPath tagPath,
                                           ArrayIndex arrayIndex)
        Given a path and an ArrayIndex, returns a version that contains the array's row index appended to the end. Returns an unchanged path if the path already contains an array index, or the array's row index is not set.
      • isArrayPath

        public static boolean isArrayPath​(TagPath path)
        Returns whether the tag path is sub indexed into an array.
        Important: The broader concept of "SubIndex" was introduced in 8.1. In most cases, those functions should be used (isSubIndexPath, getSubIndex), as they will be more flexible. Some areas of the code specifically want to only deal with ArrayIndex, so these still exist, and have been updated to ONLY support array indexes.
      • getSubIndexString

        protected static java.lang.String getSubIndexString​(TagPath path)
      • isSubIndexPath

        public static boolean isSubIndexPath​(TagPath path)
      • getArrayIndex

        public static ArrayIndex getArrayIndex​(TagPath path)
        Returns the array index contained in the tag, or null if it's not an array path.
      • getSubIndex

        public static java.util.Optional<SubIndex> getSubIndex​(TagPath path)
                                                        throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • isWildcardPath

        public static boolean isWildcardPath​(TagPath path)
      • sanitizeName

        public static java.lang.String sanitizeName​(java.lang.String tagName)
        This function removes any characters from a tag name that might cause problems as part of a full path.
      • isValueOrNullProp

        public static boolean isValueOrNullProp​(TagPath path)
      • valuePropIfNull

        public static Property<?> valuePropIfNull​(TagPath path)