Package helma.framework.core

# Class RequestPath

java.lang.Object
helma.framework.core.RequestPath

public class RequestPath extends Object
Represents a URI request path that has been resolved to an object path. Offers methods to access objects in the path by index and prototype names, and to render the path as URI again.

## Constructor Summary

Constructors
Constructor
Description
`RequestPath(Application app)`
Creates a new RequestPath object.

## Method Summary

Modifier and Type
Method
Description
`void`
`add(String id, Object obj)`
Adds an item to the end of the path.
`int`
`contains(Object obj)`
Deprecated.
use `indexOf(Object)` instead.
`Object`
`get(int idx)`
Gets an object in the path by index.
`Object`
`getByPrototypeName(String typeName)`
Gets an object in the path by prototype name.
`String`
`href(String action)`
Returns the string representation of this path usable for links.
`int`
`indexOf(Object obj)`
Checks if the given object is contained in the request path.
`int`
`size()`
Returns the number of objects in the request path.
`String`
`toString()`
Return a string representation of the Request Path

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### RequestPath

public RequestPath(Application app)
Creates a new RequestPath object.

Parameters:
  `app` - the application we're running in

## Method Details

### add

public void add(String id, Object obj)
Adds an item to the end of the path.

Parameters:
  `id` - the item id representing the path in the URL
  `obj` - the object to which the id resolves

### size

public int size()
Returns the number of objects in the request path.

### get

public Object get(int idx)
Gets an object in the path by index.

Parameters:
  `idx` - the index of the object in the request path

### getByPrototypeName

public Object getByPrototypeName(String typeName)
Gets an object in the path by prototype name.

Parameters:
  `typeName` - the prototype name of the object in the request path

### href

public String href(String action) throws UnsupportedEncodingException
Returns the string representation of this path usable for links.

Throws:
  `UnsupportedEncodingException`

### contains

@Deprecated public int contains(Object obj)
Deprecated.
use `indexOf(Object)` instead.
Checks if the given object is contained in the request path. Itreturns the zero-based index position, or -1 if it isn't contained.

Parameters:
  `obj` - the element to check
Returns:
  the index of the element, or -1 if it isn't contained

### indexOf

public int indexOf(Object obj)
Checks if the given object is contained in the request path. Itreturns the zero-based index position, or -1 if it isn't contained.

Parameters:
  `obj` - the element to check
Returns:
  the index of the element, or -1 if it isn't contained

### toString

public String toString()
Return a string representation of the Request Path

Overrides:
  `toString` in class `Object`