Package jadex.publishservice.publish
Class PathManager<T>
java.lang.Object
jadex.publishservice.publish.PathManager<T>
The path manager helps resolving elements (handlers) for path with variables, e.g. a/{varb}/c.
Using getBindings() one can get the concrete variable bindings for a given path/handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe exactly added paths of elements.protected List
<Map<String, Collection<T>>> The list with maps per level. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPathElement
(String path, T elem) Adds a new info.getBindingsForPath
(String path) Get the variable bindings for path variables.getElementForPath
(String path) Get the element for a path.Get the added elements.getElementsForPath
(String path) Get the element for a path.int
getPathDepth
(String path) Get the path depth of an element.int
getPathDepth
(T elem) Get the path depth of an element.getPathForElement
(T elem) Get the path for an element.protected Map
<String, Collection<T>> getPathPartMap
(int level, boolean add) Get a path part map for a level.static void
Main for testing.void
removeElementForPath
(String path) int
size()
Get the number of added paths.
-
Field Details
-
pathparts
The list with maps per level. Each level has a map for looking up suitable elements. The results must be cut set. -
addedpaths
The exactly added paths of elements.
-
-
Constructor Details
-
PathManager
public PathManager()Create a new info.
-
-
Method Details
-
addPathElement
Adds a new info.- Parameters:
path
- The path.elem
- The element.
-
getElementForPath
Get the element for a path.- Parameters:
path
- The path.- Returns:
- The element.
-
getElementsForPath
Get the element for a path.- Parameters:
path
- The path.- Returns:
- The element.
-
removeElementForPath
- Parameters:
path
- Path being handled.vhost
- Virtual host specification.
-
getBindingsForPath
Get the variable bindings for path variables.- Parameters:
path
- The path.- Returns:
- The variables for the path.
-
getPathPartMap
Get a path part map for a level.- Parameters:
level
- The level.- Returns:
- The map or null.
-
getPathDepth
Get the path depth of an element.- Parameters:
path
- The path.- Returns:
- The path depth.
-
getPathDepth
Get the path depth of an element.- Parameters:
elem
- The element.- Returns:
- The path depth.
-
getPathForElement
Get the path for an element.- Parameters:
elem
- The element.- Returns:
- The added path.
-
size
public int size()Get the number of added paths.- Returns:
- The number of added paths.
-
getElements
Get the added elements. -
main
Main for testing.
-