Package boofcv.io.serialize
Class SerializeFieldsYamlBase
java.lang.Object
boofcv.io.serialize.SerializeFieldsYamlBase
- Direct Known Subclasses:
SerializeConfigYaml
Base class for java serialization of public field variables. Custom error handling is provided by
the
errorHandler
function. By default any error will throw an exception.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Allows added security by allowing only certain classes to be deserialized for securitystatic enum
static interface
-
Field Summary
Modifier and TypeFieldDescriptionSpecifies which classes it can deserialize for security.Used to provide custom error handling -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
allowedDeserialize
(String name) Default algorithm which allows classes to be deserialized.protected void
checkBeforeDeserialize
(Class type) protected void
checkBeforeDeserialize
(String name) static org.yaml.snakeyaml.Yaml
protected void
deserialize
(Object parent, Map<String, Object> state) Serializes the specified config.
-
Field Details
-
errorHandler
Used to provide custom error handling -
allowClasses
Specifies which classes it can deserialize for security.
-
-
Constructor Details
-
SerializeFieldsYamlBase
public SerializeFieldsYamlBase()
-
-
Method Details
-
serialize
Serializes the specified config. If a 'canonical' reference is provided then only what is not identical in value to the canonical is serialized.- Parameters:
config
- Object that is to be serializedcanonical
- Canonical object.
-
deserialize
-
checkBeforeDeserialize
- Throws:
IllegalAccessException
-
checkBeforeDeserialize
- Throws:
IllegalAccessException
-
allowedDeserialize
Default algorithm which allows classes to be deserialized. A static function is provided so that the allowed list can be easily extended. This works by only allowing certain packages to load. You could by pass this by adding a jar with one of these class paths, but if that happens you're already screwed. -
createYmlObject
public static org.yaml.snakeyaml.Yaml createYmlObject()
-