View Javadoc

1   package org.asteriskjava.config.dialplan;
2   
3   import java.util.Arrays;
4   
5   import org.asteriskjava.config.ConfigElement;
6   
7   /**
8    * Represents the dial plan extension as a specific kind of configuration
9    * directive This class makes no interpretation of syntax checking of names,
10   * priorities, or application (for now).
11   * 
12   * @author martins
13   */
14  public class ConfigExtension extends ConfigElement
15  {
16      String name, priority;
17      
18      /**
19       * Holds the application in the first element, and arguments in all subsequent elements. Similar to command line arguments array. 
20       */
21      String [] application;
22      
23      public ConfigExtension(String filename, int lineno, String name, String priority, String [] application)
24      {
25          super(filename,lineno);
26          this.name = name;
27          this.priority = priority;
28          this.application = application;
29      }
30  
31      @Override
32      protected StringBuilder rawFormat(StringBuilder sb)
33      {
34          return sb.append(toString());
35      }
36      
37      @Override
38      public String toString()
39      {
40          return "exten => " + name + "," + priority + "," + Arrays.asList(application);   
41      }
42  
43      public String getName()
44      {
45          return name;
46      }
47  
48      public String getPriority()
49      {
50          return priority;
51      }
52  
53      public String[] getApplication()
54      {
55          return application;
56      }
57  
58  }