|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.support.utils.service.Path
public class Path
Helper class to build property paths in a service request. Property Paths are the routes from the root service concept to the arguments of the requests, through the ontology concepts. This class adds an additional help level to using Request and Profile. Following the example in Profile, thanks to Path it could be:
Example: Calling a Lighting service that controls LightSources of type ElectricLight, find the light with URI "desiredURI" and turn it off (set to brightness 0)
Request req=new Request(new Lighting(null));
req.put(Path.at(Lighting.PROP_CONTROLS).to(LightSource.PROP_HAS_TYPE), Arg.type(ElectricLight.MY_URI));
req.put(Path.at(Lighting.PROP_CONTROLS), Arg.in(new LightSource(desiredURI)));
req.put(Path.at(Lighting.PROP_CONTROLS).to(LightSource.PROP_SOURCE_BRIGHTNESS), Arg.change(new Integer(0)));
caller.call(req);
Field Summary | |
---|---|
String[] |
path
Holds the value of the path. |
Constructor Summary | |
---|---|
Path(String path)
Main constructor. |
|
Path(String[] path)
Additional constructor if you already have a property path but want to turn it into a Path object. |
Method Summary | |
---|---|
static Path |
at(String to)
Return a new instance of Path starting its branch path at parameter to. |
static Path |
parse(String path)
Get a Path object with the given property path. |
static Path |
parse(String[] path)
Get a Path object with the given property path. |
static Path |
start(String to)
Deprecated. |
Path |
to(String to)
Puts a new step (a new property) in the branch path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public String[] path
Constructor Detail |
---|
public Path(String path)
new Path(firstproperty)...
instead of
Path.at(firstproperty)...
path
- The first property of the path, coming from the service rootpublic Path(String[] path)
path
- The property path, coming from the service rootMethod Detail |
---|
@Deprecated public static Path start(String to)
to
- The first property of the path, coming from the service root
public static Path at(String to)
to
- The first property of the path, coming from the service root
public Path to(String to)
to
- The next property in the path, coming from a previous call to
.start
public static Path parse(String[] path)
path
- The property path
public static Path parse(String path)
path
- The single step property path
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |