@Service(value=org.apache.sling.models.factory.ModelFactory.class) @Reference(name="injector",referenceInterface=org.apache.sling.models.spi.Injector.class,cardinality=OPTIONAL_MULTIPLE,policy=DYNAMIC) @Reference(name="viaProvider",referenceInterface=org.apache.sling.models.spi.ViaProvider.class,cardinality=OPTIONAL_MULTIPLE,policy=DYNAMIC) public class ModelAdapterFactory extends Object implements org.apache.sling.api.adapter.AdapterFactory, Runnable, org.apache.sling.models.factory.ModelFactory
Constructor and Description |
---|
ModelAdapterFactory() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext ctx) |
protected void |
bindImplementationPicker(org.apache.sling.models.spi.ImplementationPicker implementationPicker,
Map<String,Object> props) |
protected void |
bindInjectAnnotationProcessorFactory(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory factory,
Map<String,Object> props) |
protected void |
bindInjectAnnotationProcessorFactory2(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory2 factory,
Map<String,Object> props) |
protected void |
bindInjector(org.apache.sling.models.spi.Injector injector,
Map<String,Object> props) |
protected void |
bindModelExporter(org.apache.sling.models.export.spi.ModelExporter s,
Map<String,Object> props) |
protected void |
bindStaticInjectAnnotationProcessorFactory(org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory factory,
Map<String,Object> props) |
protected void |
bindViaProvider(org.apache.sling.models.spi.ViaProvider viaProvider,
Map<String,Object> props) |
boolean |
canCreateFromAdaptable(Object adaptable,
Class<?> modelClass) |
<ModelType> |
createModel(Object adaptable,
Class<ModelType> type) |
protected void |
deactivate() |
<T> T |
exportModel(Object model,
String name,
Class<T> targetClass,
Map<String,String> options) |
<T> T |
exportModelForRequest(org.apache.sling.api.SlingHttpServletRequest request,
String name,
Class<T> targetClass,
Map<String,String> options) |
<T> T |
exportModelForResource(org.apache.sling.api.resource.Resource resource,
String name,
Class<T> targetClass,
Map<String,String> options) |
<AdapterType> |
getAdapter(Object adaptable,
Class<AdapterType> type) |
Object |
getModelFromRequest(org.apache.sling.api.SlingHttpServletRequest request) |
Object |
getModelFromResource(org.apache.sling.api.resource.Resource resource) |
boolean |
isModelAvailableForRequest(org.apache.sling.api.SlingHttpServletRequest request) |
boolean |
isModelAvailableForResource(org.apache.sling.api.resource.Resource resource) |
boolean |
isModelClass(Class<?> type) |
boolean |
isModelClass(Object adaptable,
Class<?> requestedType)
Deprecated.
|
void |
run() |
protected void |
unbindImplementationPicker(org.apache.sling.models.spi.ImplementationPicker implementationPicker,
Map<String,Object> props) |
protected void |
unbindInjectAnnotationProcessorFactory(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory factory,
Map<String,Object> props) |
protected void |
unbindInjectAnnotationProcessorFactory2(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory2 factory,
Map<String,Object> props) |
protected void |
unbindInjector(org.apache.sling.models.spi.Injector injector,
Map<String,Object> props) |
protected void |
unbindModelExporter(org.apache.sling.models.export.spi.ModelExporter s,
Map<String,Object> props) |
protected void |
unbindStaticInjectAnnotationProcessorFactory(org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory factory,
Map<String,Object> props) |
protected void |
unbindViaProvider(org.apache.sling.models.spi.ViaProvider viaProvider,
Map<String,Object> props) |
public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type)
getAdapter
in interface org.apache.sling.api.adapter.AdapterFactory
@Nonnull public <ModelType> ModelType createModel(@Nonnull Object adaptable, @Nonnull Class<ModelType> type) throws org.apache.sling.models.factory.MissingElementsException, org.apache.sling.models.factory.InvalidAdaptableException, org.apache.sling.models.factory.ValidationException, org.apache.sling.models.factory.InvalidModelException
createModel
in interface org.apache.sling.models.factory.ModelFactory
org.apache.sling.models.factory.MissingElementsException
org.apache.sling.models.factory.InvalidAdaptableException
org.apache.sling.models.factory.ValidationException
org.apache.sling.models.factory.InvalidModelException
public boolean canCreateFromAdaptable(@Nonnull Object adaptable, @Nonnull Class<?> modelClass) throws org.apache.sling.models.factory.ModelClassException
canCreateFromAdaptable
in interface org.apache.sling.models.factory.ModelFactory
org.apache.sling.models.factory.ModelClassException
@Deprecated public boolean isModelClass(@Nonnull Object adaptable, @Nonnull Class<?> requestedType)
isModelClass
in interface org.apache.sling.models.factory.ModelFactory
public boolean isModelClass(@Nonnull Class<?> type)
isModelClass
in interface org.apache.sling.models.factory.ModelFactory
@Activate protected void activate(org.osgi.service.component.ComponentContext ctx)
@Deactivate protected void deactivate()
protected void bindInjector(org.apache.sling.models.spi.Injector injector, Map<String,Object> props)
protected void unbindInjector(org.apache.sling.models.spi.Injector injector, Map<String,Object> props)
protected void bindInjectAnnotationProcessorFactory(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory factory, Map<String,Object> props)
protected void unbindInjectAnnotationProcessorFactory(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory factory, Map<String,Object> props)
protected void bindInjectAnnotationProcessorFactory2(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory2 factory, Map<String,Object> props)
protected void unbindInjectAnnotationProcessorFactory2(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory2 factory, Map<String,Object> props)
protected void bindStaticInjectAnnotationProcessorFactory(org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory factory, Map<String,Object> props)
protected void unbindStaticInjectAnnotationProcessorFactory(org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory factory, Map<String,Object> props)
protected void bindImplementationPicker(org.apache.sling.models.spi.ImplementationPicker implementationPicker, Map<String,Object> props)
protected void unbindImplementationPicker(org.apache.sling.models.spi.ImplementationPicker implementationPicker, Map<String,Object> props)
protected void bindModelExporter(org.apache.sling.models.export.spi.ModelExporter s, Map<String,Object> props)
protected void unbindModelExporter(org.apache.sling.models.export.spi.ModelExporter s, Map<String,Object> props)
protected void bindViaProvider(org.apache.sling.models.spi.ViaProvider viaProvider, Map<String,Object> props)
protected void unbindViaProvider(org.apache.sling.models.spi.ViaProvider viaProvider, Map<String,Object> props)
public boolean isModelAvailableForRequest(@Nonnull org.apache.sling.api.SlingHttpServletRequest request)
isModelAvailableForRequest
in interface org.apache.sling.models.factory.ModelFactory
public boolean isModelAvailableForResource(@Nonnull org.apache.sling.api.resource.Resource resource)
isModelAvailableForResource
in interface org.apache.sling.models.factory.ModelFactory
public Object getModelFromResource(org.apache.sling.api.resource.Resource resource)
getModelFromResource
in interface org.apache.sling.models.factory.ModelFactory
public Object getModelFromRequest(org.apache.sling.api.SlingHttpServletRequest request)
getModelFromRequest
in interface org.apache.sling.models.factory.ModelFactory
public <T> T exportModel(Object model, String name, Class<T> targetClass, Map<String,String> options) throws org.apache.sling.models.factory.ExportException, org.apache.sling.models.factory.MissingExporterException
exportModel
in interface org.apache.sling.models.factory.ModelFactory
org.apache.sling.models.factory.ExportException
org.apache.sling.models.factory.MissingExporterException
public <T> T exportModelForResource(org.apache.sling.api.resource.Resource resource, String name, Class<T> targetClass, Map<String,String> options) throws org.apache.sling.models.factory.ExportException, org.apache.sling.models.factory.MissingExporterException
exportModelForResource
in interface org.apache.sling.models.factory.ModelFactory
org.apache.sling.models.factory.ExportException
org.apache.sling.models.factory.MissingExporterException
public <T> T exportModelForRequest(org.apache.sling.api.SlingHttpServletRequest request, String name, Class<T> targetClass, Map<String,String> options) throws org.apache.sling.models.factory.ExportException, org.apache.sling.models.factory.MissingExporterException
exportModelForRequest
in interface org.apache.sling.models.factory.ModelFactory
org.apache.sling.models.factory.ExportException
org.apache.sling.models.factory.MissingExporterException
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.