org.apache.sling.jcr.resource.internal.helper.starresource
Class StarResource
java.lang.Object
org.apache.sling.api.adapter.SlingAdaptable
org.apache.sling.api.resource.AbstractResource
org.apache.sling.api.resource.SyntheticResource
org.apache.sling.jcr.resource.internal.helper.starresource.StarResource
- All Implemented Interfaces:
- Adaptable, Resource
public class StarResource
- extends SyntheticResource
Used to provide the equivalent of an empty Node for GET requests
to *.something (SLING-344)
DEFAULT_RESOURCE_TYPE
public static final String DEFAULT_RESOURCE_TYPE
- See Also:
- Constant Field Values
StarResource
public StarResource(ResourceResolver resourceResolver,
String path)
appliesTo
public static boolean appliesTo(String path)
- True if a StarResource should be used for the given request, if
a real Resource was not found
isStarResource
public static boolean isStarResource(Resource res)
- Returns true if the path of the resource ends with the
SLASH_STAR
and therefore should be considered a star
resource.
getResourceSuperType
public String getResourceSuperType()
- Calls
ResourceUtil.getResourceSuperType(ResourceResolver, String)
method
to dynamically resolve the resource super type of this star resource.
- Specified by:
getResourceSuperType
in interface Resource
- Overrides:
getResourceSuperType
in class SyntheticResource
adaptTo
public <Type> Type adaptTo(Class<Type> type)
- Description copied from interface:
Adaptable
- Adapts the adaptable to another type.
- Specified by:
adaptTo
in interface Adaptable
- Overrides:
adaptTo
in class SlingAdaptable
- Type Parameters:
Type
- The generic type to which this resource is adapted
to- Parameters:
type
- The Class object of the target type, such as
Node.class
- Returns:
- The adapter target or
null
if the resource cannot
adapt to the requested type - See Also:
Adaptable.adaptTo(java.lang.Class)
Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.