Package snap.util
Class JSArchiver
java.lang.Object
snap.util.JSArchiver
An archiver to read/write objects from/to JSON.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
An interface so objects can provide archival class to archiver.static interface
An interface so objects can provide archival attributes to archiver.static interface
An interface so objects can provide archival values to archiver.static interface
An interface so objects can set archival values from archiver. -
Constructor Summary
ConstructorDescriptionCreates a new archiver.JSArchiver
(String... theImports) Creates a new archiver for given import(s). -
Method Summary
Modifier and TypeMethodDescriptionAdds an import.protected Class
getClassForName
(String aClassName) Returns a class for name.protected Class
getClassForNameImpl
(String aClassName) Returns a class for name.Returns the class string.protected String
getClassPath
(Object anObj) Returns a class path for an object (shortend if in imports).protected String
getClassPathImpl
(String classPath) Returns a class path for an object (shortend if in imports).Returns the object to be loaded into (null by default).protected Object
Returns a value for a key.Read an object from JSON.readSource
(Object aSource) Read an object from JSON.readString
(String aString) Read an object from JSON.setRootObject
(Object anObj) Sets the object to be loaded into (null by default).protected void
Set a value for a key.writeObject
(Object anObj) Write an object to JSON.
-
Constructor Details
-
JSArchiver
public JSArchiver()Creates a new archiver. -
JSArchiver
Creates a new archiver for given import(s).
-
-
Method Details
-
getRootObject
Returns the object to be loaded into (null by default). -
setRootObject
Sets the object to be loaded into (null by default). -
getClassId
Returns the class string. -
readSource
Read an object from JSON. -
readString
Read an object from JSON. -
readNode
Read an object from JSON. -
writeObject
Write an object to JSON. -
getValue
Returns a value for a key. -
setValue
Set a value for a key. -
addImport
Adds an import. -
getClassPath
Returns a class path for an object (shortend if in imports). -
getClassPathImpl
Returns a class path for an object (shortend if in imports). -
getClassForName
Returns a class for name. -
getClassForNameImpl
Returns a class for name.
-