Skip to content

Commit

Permalink
Fixed validator reference in json
Browse files Browse the repository at this point in the history
  • Loading branch information
hylkevds committed Aug 13, 2024
1 parent 359efdc commit e7f6e88
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static class NamedValidator {

@ConfigurableField(editor = EditorSubclass.class,
label = "validator", description = "The implementation class of the validator.")
@EditorSubclass.EdOptsSubclass(iface = EntityValidator.class)
@EditorSubclass.EdOptsSubclass(iface = EntityValidator.class, merge = true, nameField = "@class", shortenClassNames = true)
public EntityValidator validator;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ private PersistenceManagerFactory(CoreSettings settings) {
throw new IllegalArgumentException("settings must be non-null");
}
this.settings = settings;
String pmiClsName = settings.getPersistenceSettings().getPersistenceManagerImplementationClass();
try {
String pmiClsName = settings.getPersistenceSettings().getPersistenceManagerImplementationClass();
Class<?> clazz = Class.forName(pmiClsName, false, getClass().getClassLoader());
if (PersistenceManager.class.isAssignableFrom(clazz)) {
persistenceManagerClass = (Class<PersistenceManager>) clazz;
} else {
throw new IllegalArgumentException("Class " + pmiClsName + " does not implement the interface PersistenceManager");
}
} catch (ClassNotFoundException ex) {
throw new IllegalArgumentException(ERROR_MSG + "Class '" + settings.getPersistenceSettings().getPersistenceManagerImplementationClass() + "' could not be found", ex);
throw new IllegalArgumentException(ERROR_MSG + "Class '" + pmiClsName + "' could not be found", ex);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
import java.util.Map;

/**
*
* @author scf
* Wrapper for JSON values in the database.
*/
public class JsonValue {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
{
"name": "AC-Task-CrationTime",
"validator": {
"className": "de.fraunhofer.iosb.ilt.frostserver.plugin.actuation.CreateTimeValidator"
"@class": "de.fraunhofer.iosb.ilt.frostserver.plugin.actuation.CreateTimeValidator"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
{
"name": "CM-ObsPhenTime",
"validator": {
"className": "de.fraunhofer.iosb.ilt.frostserver.plugin.coremodel.PhenomenonTimeValidator"
"@class": "de.fraunhofer.iosb.ilt.frostserver.plugin.coremodel.PhenomenonTimeValidator"
}
}
],
Expand Down

0 comments on commit e7f6e88

Please sign in to comment.