Class: DefaultProviderByScanning

DefaultProviderByScanning

new DefaultProviderByScanning(files, options)

Loads filters, intentHandlers, sessionHandlers, and responses by scanning all of the passed in files for the method signatures that define each of the types. This model allows one object to handle all types (except responses). As responses are pure JSON, they cannot be detected by function signatures and have to be detected by filename signature. The internal data structure that is made available via getItem() is:
Parameters:
Name Type Description
files String The files to scan
options Object.<String, Object> Options for scanning
Properties
Name Type Attributes Default Description
responseFilenameFormatter FilenameFormatter <optional>
DefaultFilenameFormatter The filename formatter to use to detect responses names from the file name
intentFilenameFormatter FilenameFormatter <optional>
DefaultFilenameFormatter As intents are not required to have a getIntentsList, and instead can be derived from filename, a @{link FilenameFormatter} is required to determine the intent name from the file name
responseBuilder ResponseBuilder <optional>
DefaultResponseBuilder The ResponseBuilder to use when building responses. Defaults to DefaultResponseBuilder
fileEncoding String <optional>
utf8 The file encoding to use when reading files
Implements:
Source:
See:
Example
{
		sessionHandlers : {
			start : [],
			end : []
		},
		filters : {
			pre : [],
			post : []
		},
		intentHandlers : {},
		responses : {}
};

Methods

getItem(itemId) → {Object}

Returns the item stored under the itemId. May be null
Parameters:
Name Type Description
itemId String The Id of the item to return
Implements:
Source:
Returns:
The item corresponding to the itemId
Type
Object

getItems() → {Object}

Returns all of the items stored. May be null
Implements:
Source:
Returns:
All the items being managed by they provider
Type
Object