|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Accessible
Definition of accessor methods for content resources for Node and Page instances.
| Method Summary | ||
|---|---|---|
ValueMap |
asMap()
|
|
|
get(String propertyName,
Class<T> type)
Get a property value from the current node. |
|
|
get(String propertyName,
T defaultValue)
Get a property value from the current node, returning the default value if the property does not exist. |
|
Optional<String> |
getAsHref(String propertyName)
Given a property on this resource containing the path of another resource, get an Optional
containing the href to the resource (i.e. |
|
Optional<String> |
getAsHref(String propertyName,
boolean strict)
Given a property on this resource containing the path of another resource, get an Optional
containing the href to the resource. |
|
Optional<String> |
getAsHref(String propertyName,
boolean strict,
boolean mapped)
Given a property on this resource containing the path of another resource, get an Optional
containing the href to the resource. |
|
Optional<Link> |
getAsLink(String propertyName)
Given a property on this resource containing the path of another resource, get a link to the resource. |
|
Optional<Link> |
getAsLink(String propertyName,
boolean strict)
Given a property on this resource containing the path of another resource, get a link to the resource. |
|
Optional<Link> |
getAsLink(String propertyName,
boolean strict,
boolean mapped)
Given a property on this resource containing the path of another resource, get a link to the resource. |
|
|
getAsList(String propertyName,
Class<T> type)
Get a multi-valued property from the current node as a list of the given type. |
|
Optional<PageDecorator> |
getAsPage(String propertyName)
Get a page instance from the value of the given property. |
|
|
getAsType(String propertyName,
Class<AdapterType> type)
Get an Optional type instance for a property on this resource containing the path of another
Resource in the repository. |
|
Optional<String> |
getImageReference()
Get the referenced DAM asset path for the default image (named "image") for this component. |
|
Optional<String> |
getImageReference(String name)
|
|
Optional<String> |
getImageRendition(String renditionName)
Get the DAM asset rendition path for the default image (named "image") for this component. |
|
Optional<String> |
getImageRendition(String name,
String renditionName)
|
|
| Method Detail |
|---|
ValueMap asMap()
<T> T get(String propertyName,
T defaultValue)
T - property typepropertyName - property namedefaultValue - default value
<T> Optional<T> get(String propertyName,
Class<T> type)
ValueMap
wrapped in an Optional instance instead of returning null.
T - property typepropertyName - property nametype - property type
Optional of the given type containing the property value or absent if the property does not
existOptional<String> getAsHref(String propertyName)
Optional
containing the href to the resource (i.e. the content path with ".html" appended).
propertyName - name of property containing a valid content path
Optional
Optional<String> getAsHref(String propertyName,
boolean strict)
Optional
containing the href to the resource. Use this method with a true argument when appending ".html" to
the resource path is desired only for valid CQ pages and not external paths.
propertyName - name of property containing a valid content pathstrict - if true, strict resource resolution will be applied and only valid CQ content paths will have
".html" appended
Optional
Optional<String> getAsHref(String propertyName,
boolean strict,
boolean mapped)
Optional
containing the href to the resource. Use this method with a true argument when appending ".html" to
the resource path is desired only for valid CQ pages and not external paths. Setting mapped to
true will map the path value, if it exists, through the Sling Resource Resolver.
propertyName - name of property containing a valid content pathstrict - if true, strict resource resolution will be applied and only valid CQ content paths will have
".html" appendedmapped - if true, the property value will be routed through the Resource Resolver to determine the mapped
path for the value. For example, if a mapping from "/content/" to "/" exists in the Apache Sling Resource
Resolver Factory OSGi configuration, getting the mapped href for the path "/content/citytechinc" will return
"/citytechinc.html".
OptionalOptional<Link> getAsLink(String propertyName)
propertyName - name of property containing a valid content path
Optional link object, absent if property does not contain a valid content path
Optional<Link> getAsLink(String propertyName,
boolean strict)
true argument when including an extension for the link is desired only for valid CQ
pages and not external paths.
propertyName - name of property containing a valid content pathstrict - if true, strict resource resolution will be applied and only valid CQ content paths will have an
extension
Optional link object, absent if property does not contain a valid content path
Optional<Link> getAsLink(String propertyName,
boolean strict,
boolean mapped)
true argument when including an extension for the link is desired only for valid CQ
pages and not external paths. Setting mapped to true will map the path value, if it
exists, through the Sling Resource Resolver.
propertyName - name of property containing a valid content pathstrict - if true, strict resource resolution will be applied and only valid CQ content paths will have an
extensionmapped - if true, the property value will be routed through the Resource Resolver to determine the mapped
path for the value. For example, if a mapping from "/content/" to "/" exists in the Apache Sling Resource
Resolver Factory OSGi configuration, the Link path will be "/citytechinc" rather than
"/content/citytechinc".
Optional link object, absent if property does not contain a valid content path
<T> List<T> getAsList(String propertyName,
Class<T> type)
T - property type, must be supported by ValueMappropertyName - name of multi-valued propertytype - property type
Optional<PageDecorator> getAsPage(String propertyName)
Optional if the
path value for the given property name does not resolve to a valid CQ page.
propertyName - property name
Optional page for property value
<AdapterType> Optional<AdapterType> getAsType(String propertyName,
Class<AdapterType> type)
Optional type instance for a property on this resource containing the path of another
Resource in the repository.
AdapterType - adapter class that is adaptable from ResourcepropertyName - name of property containing a resource pathtype - type to adapt from resource
Optional instance of the specified type, or absent if either the property does not exist or
the resource does not adapt to the provided typeOptional<String> getImageReference()
Optional image reference pathOptional<String> getImageReference(String name)
name - image name
Optional image reference pathOptional<String> getImageRendition(String renditionName)
renditionName - rendition name for this asset (e.g. "cq5dam.thumbnail.140.100.png")
Optional image rendition path
Optional<String> getImageRendition(String name,
String renditionName)
name - image namerenditionName - rendition name for this asset
Optional image rendition path
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||