org.nuxeo.ecm.webengine.model.impl
Class AbstractResource<T extends ResourceType>
java.lang.Object
org.nuxeo.ecm.webengine.model.impl.AbstractResource<T>
- All Implemented Interfaces:
- Resource, Adaptable
- Direct Known Subclasses:
- DefaultAdapter, DefaultObject
public abstract class AbstractResource<T extends ResourceType>
- extends Object
- implements Resource
- Author:
- Bogdan Stefanescu
AbstractResource
public AbstractResource()
initialize
public Resource initialize(WebContext ctx,
ResourceType type,
Object... args)
- Specified by:
initialize
in interface Resource
isAdapter
public boolean isAdapter()
- Specified by:
isAdapter
in interface Resource
isRoot
public boolean isRoot()
- Specified by:
isRoot
in interface Resource
setRoot
public void setRoot(boolean isRoot)
- Specified by:
setRoot
in interface Resource
isInstanceOf
public boolean isInstanceOf(String type)
- Specified by:
isInstanceOf
in interface Resource
redirect
public Response redirect(String uri)
- Specified by:
redirect
in interface Resource
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 interface Resource
- Returns:
- the service instance or null
dispose
public void dispose()
- Specified by:
dispose
in interface Resource
getFacets
public Set<String> getFacets()
- Specified by:
getFacets
in interface Resource
hasFacet
public boolean hasFacet(String facet)
- Specified by:
hasFacet
in interface Resource
getType
public T getType()
- Specified by:
getType
in interface Resource
getContext
public WebContext getContext()
- Specified by:
getContext
in interface Resource
getModule
public Module getModule()
- Specified by:
getModule
in interface Resource
getNext
public Resource getNext()
- Specified by:
getNext
in interface Resource
setNext
public void setNext(Resource next)
- Specified by:
setNext
in interface Resource
getPrevious
public Resource getPrevious()
- Specified by:
getPrevious
in interface Resource
setPrevious
public void setPrevious(Resource previous)
- Specified by:
setPrevious
in interface Resource
getName
public String getName()
- Specified by:
getName
in interface Resource
getPath
public String getPath()
- Specified by:
getPath
in interface Resource
getTrailingPath
public String getTrailingPath()
- Specified by:
getTrailingPath
in interface Resource
getNextSegment
public String getNextSegment()
- Specified by:
getNextSegment
in interface Resource
getURL
public String getURL()
- Specified by:
getURL
in interface Resource
getLinks
public List<LinkDescriptor> getLinks(String category)
- Specified by:
getLinks
in interface Resource
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. Returns
null
if
no such object can be found.
- Specified by:
getAdapter
in interface Adaptable
- 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
newObject
public Resource newObject(String type,
Object... args)
- Specified by:
newObject
in interface Resource
newAdapter
public AdapterResource newAdapter(String type,
Object... args)
- Specified by:
newAdapter
in interface Resource
getView
public Template getView(String viewId)
- Specified by:
getView
in interface Resource
getTemplate
public Template getTemplate(String fileName)
- Specified by:
getTemplate
in interface Resource
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 interface Resource
- Throws:
ParseException
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2011 Nuxeo SAS. All Rights Reserved.