|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.server.model.RuntimeResource
public class RuntimeResource
Runtime resource is a group of resources with the same path
regular expression. Runtime resource is constructed from resources creating
the resource model.
@Path("{foo}")
public class TemplateResourceFoo {
@GET
@Path("child")
public String getFoo() {...}
@Path("{x}")
@GET
public String getX() {...}
@Path("{y}")
@POST
public String postY(String entity) {...}
}
@Path("{bar}")
public class TemplateResourceBar {
@Path("{z}")
@PUT
public String putZ(String entity) {...}
}
Will be represented by RuntimeResources:
| line | RuntimeResource regex | Grouped Resources (paths) | Parent RuntimeResource (line) |
|---|---|---|---|
| 1 | "/([^/]+?)" | Resource("{foo}"), Resource("{bar}") | no parent |
| 2 | "child" | Child Resource("child") | 1 |
| 3 | "/([^/]+?)" | Child Resource("{x}"), Child Resource("{y}"), Child Resource("{z}") | 1 |
| Field Summary | |
|---|---|
static Comparator<RuntimeResource> |
COMPARATOR
Comparator of RuntimeResources based on rules respecting resource matching algorithm. |
| Method Summary | |
|---|---|
void |
accept(ResourceModelVisitor visitor)
A component should call the visitor back with an appropriate visitor interface method to give it a chance to process. |
List<RuntimeResource> |
getChildRuntimeResources()
Get child runtime resources of this resource. |
List<? extends ResourceModelComponent> |
getComponents()
Should return all existing resource model sub-components. |
Resource |
getFirstParentResource(Resource resource)
Deprecated. Please use Resource.getParent() directly instead. |
String |
getFullPathRegex()
Get full regular expression of this runtime resource prefixed by regular expression of parent if present. |
RuntimeResource |
getParent()
Get parent of this runtime resource. |
List<Resource> |
getParentResources()
Return parent resources of resources from this runtime resource. |
PathPattern |
getPathPattern()
Get path pattern for matching purposes. |
String |
getRegex()
Get regular expression of path pattern of this runtime resource. |
ResourceMethod |
getResourceLocator()
Return the resource locator of this resource. |
List<ResourceMethod> |
getResourceLocators()
Get resource locators of all resources of this runtime resource. |
List<ResourceMethod> |
getResourceMethods()
Get resource methods (excluding resource locators) of all resources of this runtime resource. |
List<Resource> |
getResources()
Get resources creating this runtime resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Comparator<RuntimeResource> COMPARATOR
| Method Detail |
|---|
public List<RuntimeResource> getChildRuntimeResources()
public String getRegex()
public List<ResourceMethod> getResourceMethods()
resources of this runtime resource.
public List<ResourceMethod> getResourceLocators()
resources of this runtime resource.
Note that valid RuntimeResource should have only one resource locator. This method is used for validation purposes.
public ResourceMethod getResourceLocator()
public RuntimeResource getParent()
public PathPattern getPathPattern()
public String getFullPathRegex()
public List<Resource> getParentResources()
resources of resources from this runtime resource. The returned list
is ordered so that the position of the parent resource in the returned list is the same as position of its child resource
in list returned by getResources(). Simply said the order of lists returned
from getParentResources() and getResources() from parent-child point of view is the same. If the resource
has no parent then the element null is in the list.
null elements if
this runtime resource is the parent resource.@Deprecated public Resource getFirstParentResource(Resource resource)
Resource.getParent() directly instead.
resource of the resource which is grouped in this runtime resource.
If a resource is present in getResources() more than one time the parent of this first resource
will be returned.
resource - Resource whose parent should be returned.
IllegalArgumentException - when resource is not in this RuntimeResource.public List<Resource> getResources()
public void accept(ResourceModelVisitor visitor)
ResourceModelComponent
accept in interface ResourceModelComponentvisitor - resource model visitor.public List<? extends ResourceModelComponent> getComponents()
ResourceModelComponent
getComponents in interface ResourceModelComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||