mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 19:55:17 +01:00
Prepared handling of the other ConfigEntry fields for Config loading
This commit is contained in:
parent
cfbf3df1c3
commit
7f0dc2f6d3
@ -101,7 +101,6 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Creates a list of <T>s filled with values from the provided ResultSet
|
* Creates a list of <T>s filled with values from the provided ResultSet
|
||||||
*
|
*
|
||||||
* @param config - YAML config file
|
* @param config - YAML config file
|
||||||
@ -117,12 +116,19 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
PropertyDescriptor propertyDescriptor = new PropertyDescriptor(field.getName(), dataObject);
|
PropertyDescriptor propertyDescriptor = new PropertyDescriptor(field.getName(), dataObject);
|
||||||
// Get the write method
|
// Get the write method
|
||||||
Method method = propertyDescriptor.getWriteMethod();
|
Method method = propertyDescriptor.getWriteMethod();
|
||||||
|
|
||||||
|
// Information about the field
|
||||||
String storageLocation = field.getName();
|
String storageLocation = field.getName();
|
||||||
|
boolean overrideOnChange, experimental, needsReset = false;
|
||||||
|
|
||||||
// Check if there is an annotation on the field
|
// Check if there is an annotation on the field
|
||||||
ConfigEntry configEntry = field.getAnnotation(ConfigEntry.class);
|
ConfigEntry configEntry = field.getAnnotation(ConfigEntry.class);
|
||||||
// If there is a config annotation then do something
|
// If there is a config annotation then do something
|
||||||
if (configEntry != null && !configEntry.path().isEmpty()) {
|
if (configEntry != null && !configEntry.path().isEmpty()) {
|
||||||
storageLocation = configEntry.path();
|
storageLocation = configEntry.path();
|
||||||
|
overrideOnChange = configEntry.overrideOnChange();
|
||||||
|
experimental = configEntry.experimental();
|
||||||
|
needsReset = configEntry.needsReset();
|
||||||
}
|
}
|
||||||
Adapter adapterNotation = field.getAnnotation(Adapter.class);
|
Adapter adapterNotation = field.getAnnotation(Adapter.class);
|
||||||
if (adapterNotation != null && AdapterInterface.class.isAssignableFrom(adapterNotation.value())) {
|
if (adapterNotation != null && AdapterInterface.class.isAssignableFrom(adapterNotation.value())) {
|
||||||
@ -488,6 +494,5 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
// Not used
|
// Not used
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user