org.apache.sling.api.resource
Interface AttributableResourceProvider
- All Superinterfaces:
- ResourceProvider
public interface AttributableResourceProvider
- extends ResourceProvider
The attributes provider is an extensions of a ResourceProvider
.
It allows to add attributes to the set of available attributes from a
resource resolver.
This extension is supported for services directly implementing the
ResourceProvider
interface and ResourceProvider
s
returned through a ResourceProviderFactory
.
- Since:
- 2.2
- See Also:
ResourceResolver.getAttribute(String)
,
ResourceResolver.getAttributeNames()
getAttributeNames
java.util.Collection<java.lang.String> getAttributeNames(ResourceResolver resolver)
- Returns a collection of attribute names whose value can be retrieved
calling the
getAttribute(ResourceResolver, String)
method.
- Returns:
- A collection of attribute names or
null
- Throws:
java.lang.IllegalStateException
- if this resource provider has already been
closed.
getAttribute
java.lang.Object getAttribute(ResourceResolver resolver,
java.lang.String name)
- Returns the value of the given resource provider attribute or
null
if the attribute is not set or not visible (as e.g. security
sensitive attributes).
- Parameters:
name
- The name of the attribute to access
- Returns:
- The value of the attribute or
null
if the attribute
is not set or not accessible.
- Throws:
java.lang.NullPointerException
- if name
is null
.
java.lang.IllegalStateException
- if this resource provider has already been closed.
Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.