Implemented ebeans

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2011-04-01 16:04:43 +01:00
parent 41bcf14b27
commit 0373e53844
6 changed files with 82 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ public final class PluginDescriptionFile {
private String description = null;
private ArrayList<String> authors = new ArrayList<String>();
private String website = null;
private boolean database = false;
@SuppressWarnings("unchecked")
public PluginDescriptionFile(final InputStream stream) throws InvalidDescriptionException {
@@ -120,6 +121,14 @@ public final class PluginDescriptionFile {
return website;
}
public boolean isDatabaseEnabled() {
return database;
}
public void setDatabaseEnabled(boolean database) {
this.database = database;
}
private void loadMap(Map<String, Object> map) throws InvalidDescriptionException {
try {
name = map.get("name").toString();
@@ -164,6 +173,14 @@ public final class PluginDescriptionFile {
}
}
if (map.containsKey("database")) {
try {
database = (Boolean)map.get("database");
} catch (ClassCastException ex) {
throw new InvalidDescriptionException(ex, "database is of wrong type");
}
}
if (map.containsKey("website")) {
try {
website = (String)map.get("website");
@@ -204,6 +221,7 @@ public final class PluginDescriptionFile {
map.put("name", name);
map.put("main", main);
map.put("version", version);
map.put("database", database);
if (commands != null) map.put("command", commands);
if (depend != null) map.put("depend", depend);