public interface BasicNode extends Linkable, ImageSource, Accessible
Many methods return an Optional type where a null instance would otherwise be returned (e.g. when a descendant node is requested for a path that does not exist in the repository).
| Modifier and Type | Method and Description | 
|---|---|
String | 
getId()
Get the unique ID for this resource based on the path. 
 | 
int | 
getIndex()
Get the index of this resource in relation to sibling nodes. 
 | 
int | 
getIndex(String resourceType)
Get the index of this node in relation to sibling nodes, ignoring resource types that do not match the specified
 value. 
 | 
com.google.common.base.Optional<Node> | 
getNode()
Get the JCR node for this instance. 
 | 
String | 
getPath()
Shortcut for getting the current resource path. 
 | 
List<Property> | 
getProperties(com.google.common.base.Predicate<Property> predicate)
Get a list of properties that apply for the given predicate. 
 | 
org.apache.sling.api.resource.Resource | 
getResource()
Get the underlying resource for this instance. 
 | 
getHref, getHref, getLink, getLink, getLinkBuilder, getLinkBuildergetImageSource, getImageSource, getImageSource, getImageSource, isHasImage, isHasImageasMap, get, get, getAsHref, getAsHref, getAsHref, getAsLink, getAsLink, getAsLink, getAsList, getAsPage, getAsType, getImageReference, getImageReference, getImageReference, getImageRendition, getImageRenditionString getId()
int getIndex()
int getIndex(String resourceType)
resourceType - sling:resourceType to filter oncom.google.common.base.Optional<Node> getNode()
Optional if the underlying resource
 for this instance is synthetic or non-existent.Optional node for this resourceString getPath()
List<Property> getProperties(com.google.common.base.Predicate<Property> predicate) throws RepositoryException
predicate - predicate to applyRepositoryException - if error occurs reading node propertiesorg.apache.sling.api.resource.Resource getResource()
Copyright © 2019 ICF Next. All rights reserved.