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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAllows added security by allowing only certain classes to be deserialized for securitystatic enumstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionSpecifies which classes it can deserialize for security.Used to provide custom error handling -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallowedDeserialize(String name) Default algorithm which allows classes to be deserialized.protected voidcheckBeforeDeserialize(Class type) protected voidcheckBeforeDeserialize(String name) static org.yaml.snakeyaml.Yamlprotected voiddeserialize(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()
-