Package 

Interface PathFormat

  • All Implemented Interfaces:
    icu.windea.breezeframework.core.component.Component

    
    public interface PathFormat
     implements Component
                        

    路径格式。

    路径格式用于表示查询对象在其结构中的位置,可以包含多个元路径和变量,可以用于匹配和查询。

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract String normalize(String path) 标准化指定的路径。将会去除其中的空白以及尾随的分隔符。
      abstract Boolean matches(String value, String path) 判断指定的字符串是否匹配指定的路径。
      abstract Map<String, String> resolveVariables(String value, String path) 解析路径变量。如果路径不匹配,则返回空结果。
      abstract List<String> split(String path) 将指定的字符串分隔成元路径列表,并过滤空的元路径。
      abstract Sequence<String> splitToSequence(String path) 将指定的字符串分隔成元路径序列,并过滤空的元路径。
      abstract String joinToString(Array<String> metaPaths) 将元路径数组组合成完整路径。
      abstract String joinToString(Iterable<String> metaPaths) 将元路径列表组合成完整路径。
      abstract String joinToString(Sequence<String> metaPaths) 将元路径序列组合成完整路径。
      abstract <T extends Any> List<T> query(Object value, String path) 根据指定路径查询查询对象,返回查询结果列表。 如果指定路径为空路径,则返回查询对象的单例列表。
      abstract <T extends Any> T get(Object value, String path) 根据指定路径查询查询对象,得到首个匹配的值,或者抛出异常。 如果指定路径为空路径,则返回查询对象本身。
      abstract <T extends Any> T getOrNull(Object value, String path) 根据指定路径查询查询对象,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则返回查询对象本身。
      abstract <T extends Any> T getOrDefault(Object value, String path, T defaultValue) 根据指定路径查询查询对象,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则返回查询对象本身。
      abstract <T extends Any> T getOrElse(Object value, String path, Function0<T> defaultValue) 根据指定路径查询查询对象,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则返回查询对象本身。
      PathFormat componentCopy(Map<String, Object> componentParams)
      String getComponentId()
      Map<String, Object> getComponentParams()
      • Methods inherited from class icu.windea.breezeframework.core.component.PathFormat

        componentEquals, componentHashcode, componentToString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • normalize

         abstract String normalize(String path)

        标准化指定的路径。将会去除其中的空白以及尾随的分隔符。

      • split

         abstract List<String> split(String path)

        将指定的字符串分隔成元路径列表,并过滤空的元路径。

      • query

         abstract <T extends Any> List<T> query(Object value, String path)

        根据指定路径查询查询对象,返回查询结果列表。 如果指定路径为空路径,则返回查询对象的单例列表。

      • get

         abstract <T extends Any> T get(Object value, String path)

        根据指定路径查询查询对象,得到首个匹配的值,或者抛出异常。 如果指定路径为空路径,则返回查询对象本身。

      • getOrNull

         abstract <T extends Any> T getOrNull(Object value, String path)

        根据指定路径查询查询对象,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则返回查询对象本身。

      • getOrDefault

         abstract <T extends Any> T getOrDefault(Object value, String path, T defaultValue)

        根据指定路径查询查询对象,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则返回查询对象本身。

      • getOrElse

         abstract <T extends Any> T getOrElse(Object value, String path, Function0<T> defaultValue)

        根据指定路径查询查询对象,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则返回查询对象本身。