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 WebContextctxprotected AbstractResource<?>nextprotected Stringpathprotected AbstractResource<?>prevprotected Ttype
-
Constructor Summary
Constructors Constructor Description AbstractResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckGuard(String guard)Checks the given guard expression in the context of this resource.voiddispose()AdapterResourcegetActiveAdapter()Returns the active Adapter on this object if any in the current request.<A> AgetAdapter(Class<A> adapter)Returns an object which is an instance of the given class associated with this object.WebContextgetContext()Set<String>getFacets()List<LinkDescriptor>getLinks(String category)ModulegetModule()StringgetName()ResourcegetNext()StringgetNextSegment()StringgetPath()ResourcegetPrevious()TemplategetTemplate(String fileName)StringgetTrailingPath()TgetType()StringgetURL()TemplategetView(String viewId)booleanhasFacet(String facet)protected voidinitialize(Object... args)Resourceinitialize(WebContext ctx, ResourceType type, Object... args)booleanisAdapter()booleanisInstanceOf(String type)booleanisRoot()AdapterResourcenewAdapter(String type, Object... args)ResourcenewObject(String type, Object... args)javax.ws.rs.core.Responseredirect(String uri)voidsetNext(Resource next)voidsetPrevious(Resource previous)voidsetRoot(boolean isRoot)StringtoString()
-
-
-
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:
initializein interfaceResource
-
initialize
protected void initialize(Object... args)
-
isInstanceOf
public boolean isInstanceOf(String type)
- Specified by:
isInstanceOfin interfaceResource
-
redirect
public javax.ws.rs.core.Response redirect(String uri)
-
getActiveAdapter
public AdapterResource getActiveAdapter()
Description copied from interface:ResourceReturns the active Adapter on this object if any in the current request.- Specified by:
getActiveAdapterin interfaceResource- Returns:
- the service instance or null
-
getContext
public WebContext getContext()
- Specified by:
getContextin interfaceResource
-
getPrevious
public Resource getPrevious()
- Specified by:
getPreviousin interfaceResource
-
setPrevious
public void setPrevious(Resource previous)
- Specified by:
setPreviousin interfaceResource
-
getTrailingPath
public String getTrailingPath()
- Specified by:
getTrailingPathin interfaceResource
-
getNextSegment
public String getNextSegment()
- Specified by:
getNextSegmentin interfaceResource
-
getLinks
public List<LinkDescriptor> getLinks(String category)
-
getAdapter
public <A> A getAdapter(Class<A> adapter)
Description copied from interface:AdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.- Specified by:
getAdapterin interfaceAdaptable- Parameters:
adapter- the adapter class to look up- Returns:
- a object castable to the given class, or
nullif this object does not have an adapter for the given class
-
newAdapter
public AdapterResource newAdapter(String type, Object... args)
- Specified by:
newAdapterin interfaceResource
-
getTemplate
public Template getTemplate(String fileName)
- Specified by:
getTemplatein interfaceResource
-
checkGuard
public boolean checkGuard(String guard) throws ParseException
Description copied from interface:ResourceChecks the given guard expression in the context of this resource.- Specified by:
checkGuardin interfaceResource- Throws:
ParseException
-
-