com.citytechinc.aem.bedrock.api.components
Interface Component

All Superinterfaces:
Accessible, BasicNode, ComponentNode, ImageSource, Inheritable, Linkable, Traversable<ComponentNode>, io.sightly.java.api.Use

public interface Component
extends ComponentNode, io.sightly.java.api.Use


Method Summary
<T extends Component>
T
getComponent(ComponentNode componentNode, Class<T> type)
          Get a component instance for the given component node.
<T extends Component>
Optional<T>
getComponent(String path, Class<T> type)
          Get a component instance for the given path.
 ComponentRequest getComponentRequest()
          Get the component request.
 PageDecorator getCurrentPage()
          Get the current page.
<T> T
getService(Class<T> serviceType)
          Get an OSGi service.
<T> List<T>
getServices(Class<T> serviceType, String filter)
          Get one or more OSGi services.
 
Methods inherited from interface com.citytechinc.aem.bedrock.api.node.ComponentNode
getComponentNode, getComponentNodes, getComponentNodes, getComponentNodes, getComponentNodes, getComponentNodes, getDesignNode, getNodeInherited, getNodesInherited, getParent
 
Methods inherited from interface com.citytechinc.aem.bedrock.api.node.BasicNode
getId, getIndex, getIndex, getNode, getPath, getProperties, getResource
 
Methods inherited from interface com.citytechinc.aem.bedrock.api.Linkable
getHref, getHref, getLink, getLink, getLinkBuilder, getLinkBuilder
 
Methods inherited from interface com.citytechinc.aem.bedrock.api.ImageSource
getImageSource, getImageSource, getImageSource, getImageSource, isHasImage, isHasImage
 
Methods inherited from interface com.citytechinc.aem.bedrock.api.Accessible
asMap, get, get, getAsHref, getAsHref, getAsHref, getAsLink, getAsLink, getAsLink, getAsList, getAsPage, getAsType, getImageReference, getImageReference, getImageRendition, getImageRendition
 
Methods inherited from interface com.citytechinc.aem.bedrock.api.Inheritable
getAsHrefInherited, getAsHrefInherited, getAsHrefInherited, getAsLinkInherited, getAsLinkInherited, getAsLinkInherited, getAsListInherited, getAsPageInherited, getAsTypeInherited, getImageReferenceInherited, getImageReferenceInherited, getImageSourceInherited, getImageSourceInherited, getImageSourceInherited, getImageSourceInherited, getInherited, getInherited
 
Methods inherited from interface com.citytechinc.aem.bedrock.api.Traversable
findAncestor, findAncestorWithProperty, findAncestorWithPropertyValue, findDescendants
 
Methods inherited from interface io.sightly.java.api.Use
init
 

Method Detail

getComponent

<T extends Component> Optional<T> getComponent(String path,
                                               Class<T> type)
Get a component instance for the given path.

Parameters:
path - absolute JCR path to the resource of the component
type - component class type
Returns:
component instance or absent Optional if path does not resolve to a resource

getComponent

<T extends Component> T getComponent(ComponentNode componentNode,
                                     Class<T> type)
Get a component instance for the given component node.

Parameters:
componentNode - component node representing resource of desired component
type - component class type
Returns:
component instance or null if an error occurs

getComponentRequest

ComponentRequest getComponentRequest()
Get the component request.

Returns:
component request

getCurrentPage

PageDecorator getCurrentPage()
Get the current page.

Returns:
current page

getService

<T> T getService(Class<T> serviceType)
Get an OSGi service.

Type Parameters:
T - type
Parameters:
serviceType - the type (class) of the service
Returns:
the service instance, or null if it is not available

getServices

<T> List<T> getServices(Class<T> serviceType,
                        String filter)
Get one or more OSGi services.

Type Parameters:
T - type
Parameters:
serviceType - the type (class) of the service
filter - optional filter, see OSGi spec for syntax details
Returns:
one or more service instances, or null if none are found


Copyright © 2015 CITYTECH, Inc.. All rights reserved.