Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.project
Class ProjectPath

    java.lang.Object
      org.apache.cayenne.project.ProjectPath

    public class ProjectPath

extends Object

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)`
`
`<T> T`
` | `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

### EMPTY_PATH

    public static final Object[] EMPTY_PATH

### path

    protected Object[] path

Constructor Detail

### ProjectPath

    public ProjectPath()

### ProjectPath

    public ProjectPath(Object object)

  Constructor for ProjectPath.

### ProjectPath

    public ProjectPath(Object[] path)

  Constructor for ProjectPath.

Method Detail

### getPath

    public Object[] getPath()

### isEmpty

    public boolean isEmpty()

### firstInstanceOf

    public <T> T firstInstanceOf(Class<T> aClass)

  Scans path, looking for the first element that is an instanceof `aClass`.

### appendToPath

    public ProjectPath appendToPath(Object object)

  Returns an instance of the path, expanding this one by appending an object at the end.

### subpathWithSize

    public ProjectPath subpathWithSize(int subpathSize)

  Since:
    1.1

### subpathOfObject

    public ProjectPath subpathOfObject(Object object)

  Returns a subpath to the first occurance of an object.

  Since:
    1.1

### getRoot

    public Object getRoot()

  Returns the root or starting object of the path.

### getObject

    public Object getObject()

  Returns the last object in the path.

### getObjectParent

    public Object getObjectParent()

  Returns an object corresponding to the parent node of the node represented by the path. This is the object next to last object in the path.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### equals

    public boolean equals(Object object)

  Overrides:
    `equals` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.