Klasse PathResolver<T>

java.lang.Object
org.xbib.net.path.simple.PathResolver<T>
Typparameter:
T - type
Alle implementierten Schnittstellen:
PathResolver<T>

public class PathResolver<T> extends Object implements PathResolver<T>
A simple resolver that maps pairs of method names and parameterized paths to arbitrary data. Each node in the tree is a path segment. For example, given a path "discovery/v1/apis", the data would be stored in the node path represented by "discovery" -> "v1" -> "apis". A path is considered parameterized if one or more segments is of the form "{name}". When a parameterized path is resolved, a map from parameter names to raw String values is returned as part of the result. Null values are not acceptable values. Parameter names can only contain alphanumeric characters or underscores, and cannot start with a numeric.
  • Methodendetails

    • resolve

      public void resolve(String method, String path, PathResolver.ResultListener<T> resultListener) throws org.xbib.net.ParameterException
      Attempts to resolve a path. Resolution prefers literal paths over path parameters. The result includes the object to which the path mapped, as well a map from parameter names to values. If the path cannot be resolved, null is returned.
      Angegeben von:
      resolve in Schnittstelle PathResolver<T>
      Parameter:
      method - method
      path - path
      resultListener - result listener
      Löst aus:
      org.xbib.net.ParameterException
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • builder

      public static <T> PathResolver.Builder<T> builder()
      Returns a new, path conflict validating PathResolver.Builder.
      Typparameter:
      T - the type that the resolver will be storing
      Gibt zurück:
      the builder
    • builder

      public static <T> PathResolver.Builder<T> builder(boolean throwOnConflict)
      Returns a new PathResolver.Builder.
      Typparameter:
      T - the type that the resolver will be storing
      Parameter:
      throwOnConflict - whether or not to throw an exception on path conflicts
      Gibt zurück:
      the builder