Package org.apache.sling.cms.core.internal.models

## Class ComponentManagerImpl

- java.lang.Object
- - org.apache.sling.cms.core.internal.models.ComponentManagerImpl

All Implemented Interfaces:
  `ComponentManager`

    @Model(adaptables=org.apache.sling.api.resource.ResourceResolver.class,
           adapters=org.apache.sling.cms.ComponentManager.class)
    public class ComponentManagerImpl
    extends Object
    implements ComponentManager

A model for managing sling:Components

### Constructor Summary

Constructors
`ComponentManagerImpl​(org.apache.sling.api.resource.Resource resource)`
`ComponentManagerImpl​(org.apache.sling.api.resource.ResourceResolver resolver)`

### Method Summary

All Methods Instance Methods Concrete Methods
`List<Component>` `getAllComponents()` Returns all of the components in Sling CMS with a component type specified.
`Map<String,​List<Component>>` `getComponentsByType()` Returns a Map of the components with a component type specified with the key of the map being the component type and the value being the list of components for that type.
`List<String>` `getComponentTypes()` Returns a list of all of the registered component types

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ComponentManagerImpl

    public ComponentManagerImpl​(org.apache.sling.api.resource.Resource resource)

#### ComponentManagerImpl

    public ComponentManagerImpl​(org.apache.sling.api.resource.ResourceResolver resolver)

### Method Detail

#### getAllComponents

    public List<Component> getAllComponents()

Returns all of the components in Sling CMS with a component type specified.

Specified by:
  `getAllComponents` in interface `ComponentManager`
Returns:
  a list of the components

#### getComponentsByType

    public Map<String,​List<Component>> getComponentsByType()

Returns a Map of the components with a component type specified with the key of the map being the component type and the value being the list of components for that type.

Specified by:
  `getComponentsByType` in interface `ComponentManager`
Returns:
  the components organized by componentType

#### getComponentTypes

    public List<String> getComponentTypes()

Returns a list of all of the registered component types

Specified by:
  `getComponentTypes` in interface `ComponentManager`
Returns:
  the list of component types