/** * Constructor for Config instance with undefined file object * * @param type - Config type */ public Config(int type) { this.type = type; this.correct = true; this.config = new ConfigSection(); }
/** * Constructor for Config (YAML) instance with undefined file object */ public Config() { this(Config.YAML); }
public Config(String file) { this(file, Config.DETECT); }
public Config(File file) { this(file.toString(), Config.DETECT); }
public Config(String file, int type) { this(file, type, new ConfigSection()); }
public Config(File file, int type) { this(file.toString(), type, new ConfigSection()); }
file为文件名称,默认路径为nukkit的根目录
type为类型,主要使用的类型是
Config.java
1 2 3 4 5 6 7 8 9 10 11
public static final int DETECT = -1; //Detect by file extension public static final int PROPERTIES = 0; // .properties public static final int CNF = Config.PROPERTIES; // .cnf public static final int JSON = 1; // .js, .json public static final int YAML = 2; // .yml, .yaml //public static final int EXPORT = 3; // .export, .xport //public static final int SERIALIZED = 4; // .sl public static final int ENUM = 5; // .txt, .list, .enum public static final int ENUMERATION = Config.ENUM;