---
name: "Config::Model::Itself::BackendDetector"
section: "3pm"
platform: "linux"
package: "libconfig-model-itself-perl"
version: "2.025-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Config::Model::Itself::BackendDetector"
---

# Config::Model::Itself::BackendDetector(3pm)

Detect available read/write backends usable by config models

## NAME

Config::Model::Itself::BackendDetector - Detect available read/write backends usable by config models

## VERSION

version 2.025

## SYNOPSIS

```
 # this class should be referenced in a configuration model and
 # created only by Config::Model::Node
 my $model = Config::Model->new() ;
 $model ->create_config_class
  (
   name => "Test",
   'element'
   => [
       'backend' => { type => 'leaf',
                      class => 'Config::Model::Itself::BackendDetector' ,
                      value_type => 'enum',
                      # specify backends built in Config::Model
                      choice => [qw/cds_file perl_file ini_file custom/],
                      help => {
                               cds_file => "file ...",
                               ini_file => "Ini file ...",
                               perl_file => "file  perl",
                               custom => "Custom format",
                              }
                    }
      ],
  );
  my $root = $model->instance(root_class_name => 'Test') -> config_root ;
  my $backend = $root->fetch_element('backend') ;
  my @choices = $backend->get_choice ;
```

## DESCRIPTION

This class is derived from Config::Model::Value. It is designed to be used in a 'enum' value where the choice (the available backends) are the backend built in Config::Model and all the plugin backends. The plugin backends are all the `"Config::Model::Backend::*"` classes.

This module will detect available plugin backend and query their pod documentation to provide a contextual help for config-model graphical editor.

## SEE ALSO

Config::Model, Config::Model::Node, Config::Model::Value

## AUTHOR

Dominique Dumont

## COPYRIGHT AND LICENSE

This software is Copyright (c) 2007-2019 by Dominique Dumont.

This is free software, licensed under:

```
  The GNU Lesser General Public License, Version 2.1, February 1999
```
