|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.project.ProjectPath
public class ProjectPath
Immutable holder of a selection path within a Cayenne project. Mostly used by various tools (CayenneModeler comes to mind) to navigate Cayenne projects. Contains a number of convenience methods to access path elements.
For instance, given a path Project -> DataMap -> ObjEntity -> ObjAttribute
,
getObject
will return ObjAttribute, getObjectParent
-
ObjEntity, getRoot
- Project.
Field Summary | |
---|---|
static Object[] |
EMPTY_PATH
|
protected Object[] |
path
|
Constructor Summary | |
---|---|
ProjectPath()
|
|
ProjectPath(Object object)
Constructor for ProjectPath. |
|
ProjectPath(Object[] path)
Constructor for ProjectPath. |
Method Summary | ||
---|---|---|
ProjectPath |
appendToPath(Object object)
Returns an instance of the path, expanding this one by appending an object at the end. |
|
boolean |
equals(Object object)
|
|
|
firstInstanceOf(Class<T> aClass)
Scans path, looking for the first element that is an instanceof aClass . |
|
Object |
getObject()
Returns the last object in the path. |
|
Object |
getObjectParent()
Returns an object corresponding to the parent node of the node represented by the path. |
|
Object[] |
getPath()
|
|
Object |
getRoot()
Returns the root or starting object of the path. |
|
boolean |
isEmpty()
|
|
ProjectPath |
subpathOfObject(Object object)
Returns a subpath to the first occurance of an object. |
|
ProjectPath |
subpathWithSize(int subpathSize)
|
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Object[] EMPTY_PATH
protected Object[] path
Constructor Detail |
---|
public ProjectPath()
public ProjectPath(Object object)
public ProjectPath(Object[] path)
Method Detail |
---|
public Object[] getPath()
public boolean isEmpty()
public <T> T firstInstanceOf(Class<T> aClass)
aClass
.
public ProjectPath appendToPath(Object object)
public ProjectPath subpathWithSize(int subpathSize)
public ProjectPath subpathOfObject(Object object)
public Object getRoot()
public Object getObject()
public Object getObjectParent()
public String toString()
toString
in class Object
public boolean equals(Object object)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |