Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
ConfigurationOptions.java
1 package org.bukkit.configuration;
2 
3 /**
4  * Various settings for controlling the input and output of a {@link
5  * Configuration}
6  */
7 public class ConfigurationOptions {
8  private char pathSeparator = '.';
9  private boolean copyDefaults = false;
10  private final Configuration configuration;
11 
12  protected ConfigurationOptions(Configuration configuration) {
13  this.configuration = configuration;
14  }
15 
16  /**
17  * Returns the {@link Configuration} that this object is responsible for.
18  *
19  * @return Parent configuration
20  */
22  return configuration;
23  }
24 
25  /**
26  * Gets the char that will be used to separate {@link
27  * ConfigurationSection}s
28  * <p>
29  * This value does not affect how the {@link Configuration} is stored,
30  * only in how you access the data. The default value is '.'.
31  *
32  * @return Path separator
33  */
34  public char pathSeparator() {
35  return pathSeparator;
36  }
37 
38  /**
39  * Sets the char that will be used to separate {@link
40  * ConfigurationSection}s
41  * <p>
42  * This value does not affect how the {@link Configuration} is stored,
43  * only in how you access the data. The default value is '.'.
44  *
45  * @param value Path separator
46  * @return This object, for chaining
47  */
48  public ConfigurationOptions pathSeparator(char value) {
49  this.pathSeparator = value;
50  return this;
51  }
52 
53  /**
54  * Checks if the {@link Configuration} should copy values from its default
55  * {@link Configuration} directly.
56  * <p>
57  * If this is true, all values in the default Configuration will be
58  * directly copied, making it impossible to distinguish between values
59  * that were set and values that are provided by default. As a result,
60  * {@link ConfigurationSection#contains(java.lang.String)} will always
61  * return the same value as {@link
62  * ConfigurationSection#isSet(java.lang.String)}. The default value is
63  * false.
64  *
65  * @return Whether or not defaults are directly copied
66  */
67  public boolean copyDefaults() {
68  return copyDefaults;
69  }
70 
71  /**
72  * Sets if the {@link Configuration} should copy values from its default
73  * {@link Configuration} directly.
74  * <p>
75  * If this is true, all values in the default Configuration will be
76  * directly copied, making it impossible to distinguish between values
77  * that were set and values that are provided by default. As a result,
78  * {@link ConfigurationSection#contains(java.lang.String)} will always
79  * return the same value as {@link
80  * ConfigurationSection#isSet(java.lang.String)}. The default value is
81  * false.
82  *
83  * @param value Whether or not defaults are directly copied
84  * @return This object, for chaining
85  */
86  public ConfigurationOptions copyDefaults(boolean value) {
87  this.copyDefaults = value;
88  return this;
89  }
90 }
ConfigurationOptions pathSeparator(char value)
ConfigurationOptions copyDefaults(boolean value)