Package helma.framework.core
Class RequestPath
java.lang.Object
helma.framework.core.RequestPath
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an item to the end of the path.int
Deprecated.get
(int idx) Gets an object in the path by index.getByPrototypeName
(String typeName) Gets an object in the path by prototype name.Returns the string representation of this path usable for links.int
Checks if the given object is contained in the request path.int
size()
Returns the number of objects in the request path.toString()
Return a string representation of the Request Path
-
Constructor Details
-
RequestPath
Creates a new RequestPath object.- Parameters:
app
- the application we're running in
-
-
Method Details
-
add
Adds an item to the end of the path.- Parameters:
id
- the item id representing the path in the URLobj
- the object to which the id resolves
-
size
public int size()Returns the number of objects in the request path. -
get
Gets an object in the path by index.- Parameters:
idx
- the index of the object in the request path
-
getByPrototypeName
Gets an object in the path by prototype name.- Parameters:
typeName
- the prototype name of the object in the request path
-
href
Returns the string representation of this path usable for links.- Throws:
UnsupportedEncodingException
-
contains
Deprecated.useindexOf(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
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
Return a string representation of the Request Path
-
indexOf(Object)
instead.