Class AbstractResource<T extends ResourceType>
- java.lang.Object
-
- org.nuxeo.ecm.webengine.model.impl.AbstractResource<T>
-
- Direct Known Subclasses:
AuthenticationTokensObject
,BatchUploadObject
,BinariesObject
,BlobsObject
,BulkObject
,ConfigurationObject
,DefaultAdapter
,DefaultObject
,DistributionObject
,ElasticsearchObject
,ExtractBinaryFulltextObject
,ManagementObject
,MigrationObject
,OAuth2Object
,PageProvidersObject
,PicturesObject
,ProbesObject
,QueryExecutor
,QueryObject
,SchedulerObject
,StreamObject
,ThumbnailsObject
,VersionsObject
,VideosObject
,WorkflowsObject
,WorkManagerObject
public abstract class AbstractResource<T extends ResourceType> extends Object implements Resource
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected WebContext
ctx
protected AbstractResource<?>
next
protected String
path
protected AbstractResource<?>
prev
protected T
type
-
Constructor Summary
Constructors Constructor Description AbstractResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkGuard(String guard)
Checks the given guard expression in the context of this resource.void
dispose()
AdapterResource
getActiveAdapter()
Returns the active Adapter on this object if any in the current request.<A> A
getAdapter(Class<A> adapter)
Returns an object which is an instance of the given class associated with this object.WebContext
getContext()
Set<String>
getFacets()
List<LinkDescriptor>
getLinks(String category)
Module
getModule()
String
getName()
Resource
getNext()
String
getNextSegment()
String
getPath()
Resource
getPrevious()
Template
getTemplate(String fileName)
String
getTrailingPath()
T
getType()
String
getURL()
Template
getView(String viewId)
boolean
hasFacet(String facet)
protected void
initialize(Object... args)
Resource
initialize(WebContext ctx, ResourceType type, Object... args)
boolean
isAdapter()
boolean
isInstanceOf(String type)
boolean
isRoot()
AdapterResource
newAdapter(String type, Object... args)
Resource
newObject(String type, Object... args)
javax.ws.rs.core.Response
redirect(String uri)
void
setNext(Resource next)
void
setPrevious(Resource previous)
void
setRoot(boolean isRoot)
String
toString()
-
-
-
Field Detail
-
ctx
protected WebContext ctx
-
next
protected AbstractResource<?> next
-
prev
protected AbstractResource<?> prev
-
path
protected String path
-
type
protected T extends ResourceType type
-
-
Method Detail
-
initialize
public Resource initialize(WebContext ctx, ResourceType type, Object... args)
- Specified by:
initialize
in interfaceResource
-
initialize
protected void initialize(Object... args)
-
isInstanceOf
public boolean isInstanceOf(String type)
- Specified by:
isInstanceOf
in interfaceResource
-
redirect
public javax.ws.rs.core.Response redirect(String uri)
-
getActiveAdapter
public AdapterResource getActiveAdapter()
Description copied from interface:Resource
Returns the active Adapter on this object if any in the current request.- Specified by:
getActiveAdapter
in interfaceResource
- Returns:
- the service instance or null
-
getContext
public WebContext getContext()
- Specified by:
getContext
in interfaceResource
-
getPrevious
public Resource getPrevious()
- Specified by:
getPrevious
in interfaceResource
-
setPrevious
public void setPrevious(Resource previous)
- Specified by:
setPrevious
in interfaceResource
-
getTrailingPath
public String getTrailingPath()
- Specified by:
getTrailingPath
in interfaceResource
-
getNextSegment
public String getNextSegment()
- Specified by:
getNextSegment
in interfaceResource
-
getLinks
public List<LinkDescriptor> getLinks(String category)
-
getAdapter
public <A> A getAdapter(Class<A> adapter)
Description copied from interface:Adaptable
Returns an object which is an instance of the given class associated with this object. Returnsnull
if no such object can be found.- Specified by:
getAdapter
in interfaceAdaptable
- Parameters:
adapter
- the adapter class to look up- Returns:
- a object castable to the given class, or
null
if this object does not have an adapter for the given class
-
newAdapter
public AdapterResource newAdapter(String type, Object... args)
- Specified by:
newAdapter
in interfaceResource
-
getTemplate
public Template getTemplate(String fileName)
- Specified by:
getTemplate
in interfaceResource
-
checkGuard
public boolean checkGuard(String guard) throws ParseException
Description copied from interface:Resource
Checks the given guard expression in the context of this resource.- Specified by:
checkGuard
in interfaceResource
- Throws:
ParseException
-
-