public class PathProperties extends Object implements FetchPath
It provides a way of parsing a string representation of nested path properties and applying that to both what to fetch (ORM query) and what to render (JAX-RS JSON / XML).
Modifier and Type | Class and Description |
---|---|
static class |
PathProperties.Props |
Constructor and Description |
---|
PathProperties()
Construct an empty PathProperties.
|
Modifier and Type | Method and Description |
---|---|
void |
addNested(String prefix,
PathProperties pathProps) |
void |
addToPath(String path,
String property) |
<T> void |
apply(Query<T> query)
Apply these path properties as fetch paths to the query.
|
Collection<PathProperties.Props> |
getPathProps() |
Set<String> |
getProperties(String path)
Get the properties for a given path.
|
protected PathProperties.Props |
getRootProperties() |
boolean |
hasPath(String path)
Return true if the path is defined and has properties.
|
boolean |
includesPath(String path)
Return true if the fetch path is included in the PathProperties.
|
boolean |
includesPath(String prefix,
String name)
Return true if the path is included using a prefix.
|
boolean |
includesProperty(String name)
Return true if the property (dot notation) is included in the PathProperties.
|
boolean |
includesProperty(String prefix,
String name)
Return true if the property is included using a prefix.
|
static PathProperties |
parse(String source)
Parse and return a PathProperties from nested string format like
(a,b,c(d,e),f(g)) where "c" is a path containing "d" and "e" and "f" is a
path containing "g" and the root path contains "a","b","c" and "f".
|
String |
toString() |
public PathProperties()
public static PathProperties parse(String source)
public Set<String> getProperties(String path)
getProperties
in interface FetchPath
public void addNested(String prefix, PathProperties pathProps)
public Collection<PathProperties.Props> getPathProps()
public <T> void apply(Query<T> query)
protected PathProperties.Props getRootProperties()
public boolean includesProperty(String name)
public boolean includesProperty(String prefix, String name)
public boolean includesPath(String path)
The fetch path is a OneToMany or ManyToMany path in dot notation.
public boolean includesPath(String prefix, String name)
Copyright © 2016. All rights reserved.