Package org.apache.sling.testing.mock.sling

# Class NodeTypeDefinitionScanner

java.lang.Object
org.apache.sling.testing.mock.sling.NodeTypeDefinitionScanner

public final class NodeTypeDefinitionScanner extends Object
Singleton class that fetches all node type definitions from OSGi bundle MANIFEST.MF files with "Sling-Nodetypes" definitions in the classpath. Additionally it support registering them to a JCR repository.

## Method Summary

Modifier and Type
Method
Description
`static NodeTypeDefinitionScanner`
`get()`
`List<String>`
`getNodeTypeDefinitions()`
`void`
`register(javax.jcr.Session session, List<String> nodeTypeResources, NodeTypeMode nodeTypeMode)`
Registers node types found in classpath in JCR repository.
`void`
`register(javax.jcr.Session session, NodeTypeMode nodeTypeMode)`
Registers node types found in classpath in JCR repository.

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

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

## Method Details

### getNodeTypeDefinitions

public List<String> getNodeTypeDefinitions()

Returns:
  Node type definitions found in classpath as registered in OSGi bundle headers

### register

public void register(javax.jcr.Session session, NodeTypeMode nodeTypeMode) throws javax.jcr.RepositoryException
Registers node types found in classpath in JCR repository.

Parameters:
  `session` - Session
  `nodeTypeMode` - Node type mode
Throws:
  `javax.jcr.RepositoryException` - Repository exception

### register

public void register(javax.jcr.Session session, List<String> nodeTypeResources, NodeTypeMode nodeTypeMode) throws javax.jcr.RepositoryException
Registers node types found in classpath in JCR repository.

Parameters:
  `session` - Session
  `nodeTypeResources` - List of classpath resource URLs pointing to node type definitions
  `nodeTypeMode` - Node type mode
Throws:
  `javax.jcr.RepositoryException` - Repository exception

### get

public static NodeTypeDefinitionScanner get()

Returns:
  Instance