Package 

Object PathFormats.AntPath

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

    
    public class PathFormats.AntPath
    extends AbstractPathFormat
                        

    Ant路径。

    规则:

    • /作为分隔符。

    • ? 匹配任意单个字符。

    • * 匹配除了分隔符之外的任意数量的任意字符。

    • ** 匹配任意数量的任意字符。

    • {name} 匹配任意项,并命名为name

    • index 匹配索引indexindex是整数。

    • name 匹配名字、键name

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Boolean matches(String value, String path) 判断指定的字符串是否匹配指定的路径。
      Map<String, String> resolveVariables(String value, String path) 解析路径变量。如果路径不匹配,则返回空结果。
      <T extends Any> List<T> query(Object value, String path) 根据指定路径查询查询对象,返回查询结果列表。 如果指定路径为空路径,则返回查询对象的单例列表。
      <T extends Any> T getOrNull(Object value, String path) 根据指定路径查询查询对象,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则返回查询对象本身。
      <T extends Any> T getOrElse(Object value, String path, Function0<T> defaultValue) 根据指定路径查询查询对象,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则返回查询对象本身。
      String getComponentId()
      Map<String, Object> getComponentParams()
      • Methods inherited from class icu.windea.breezeframework.core.component.PathFormats.AntPath

        equals, get, getOrDefault, hashCode, joinToString, joinToString, joinToString, normalize, split, splitToSequence, toString
      • Methods inherited from class icu.windea.breezeframework.core.component.AbstractPathFormat

        componentCopy
      • 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

      • query

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

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

      • getOrNull

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

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

      • getOrElse

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

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