|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.scripting.core.impl.SlingScriptAdapterFactory
public class SlingScriptAdapterFactory
AdapterFactory that adapts Resources to the DefaultSlingScript servlet, which executes the Resources as scripts.
Field Summary |
---|
Fields inherited from interface org.apache.sling.api.adapter.AdapterFactory |
---|
ADAPTABLE_CLASSES, ADAPTER_CLASSES, SERVICE_NAME |
Constructor Summary | |
---|---|
SlingScriptAdapterFactory()
|
Method Summary | ||
---|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context)
|
|
protected void |
deactivate(org.osgi.service.component.ComponentContext context)
|
|
|
getAdapter(Object adaptable,
Class<AdapterType> type)
Adapt the given object to the adaptable type. |
|
String |
getExtension(String mimeType)
Returns the first extension entry of the supported extensions of a ScriptEngineFactory which is registered for the given MIME type. |
|
String |
getMimeType(String name)
Returns the first MIME type entry of the supported MIME types of a ScriptEngineFactory which is registered for the extension of the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SlingScriptAdapterFactory()
Method Detail |
---|
public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type)
AdapterFactory
AdapterFactory.ADAPTABLE_CLASSES
services registration property. The type
parameter is on of the classes listed in the AdapterFactory.ADAPTER_CLASSES
service registration properties.
This method may return null
if the adaptable object may not
be adapted to the adapter (target) type for any reason. In this case, the
implementation should log a message to the log facility noting the cause
for not being able to adapt.
Note that the adaptable
object is not required to implement
the Adaptable
interface, though most of the time this method
is called by means of calling the Adaptable.adaptTo(Class)
method.
getAdapter
in interface AdapterFactory
AdapterType
- The generic type of the adapter (target) type.adaptable
- The object to adapt to the adapter type.type
- The type to which the object is to be adapted.
null
if this factory instance
cannot adapt the object.public String getMimeType(String name)
null
.
getMimeType
in interface MimeTypeProvider
name
- The name whose extension is to be mapped to a MIME type. The
extension is the string after the last dot in the name. If the
name contains no dot, the entire name is considered the
extension.
name
is
null
, null
is returned.MimeTypeProvider.getExtension(String)
public String getExtension(String mimeType)
null
.
getExtension
in interface MimeTypeProvider
mimeType
- The MIME type to be mapped to an extension.
null
if no such mapping exists.MimeTypeProvider.getMimeType(String)
protected void activate(org.osgi.service.component.ComponentContext context)
protected void deactivate(org.osgi.service.component.ComponentContext context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |