| App-Context documentation | view source | Contained in the App-Context distribution. |
App::Serializer::Properties - Interface for serialization and deserialization
use App;
$context = App->context();
$serializer = $context->service("Serializer"); # or ...
$serializer = $context->serializer();
$data = {
an => 'arbitrary',
collection => [ 'of', 'data', ],
of => {
arbitrary => 'depth',
},
};
$propdata = $serializer->serialize($data);
$data = $serializer->deserialize($propdata);
print $serializer->dump($data), "\n";
A Serializer allows you to serialize a structure of data of arbitrary depth to a scalar and deserialize it back to the structure.
The Properties serializer reads and writes data which conforms to the standards of Java properties files.
* Throws: App::Exception::Serializer * Since: 0.01
The class is entirely made up of static (class) methods. However, they are each intended to be called as methods on the instance itself.
The constructor is inherited from
App::Service|App::Service/"new()".
* Signature: $propdata = $serializer->serialize($data);
* Param: $data ref
* Return: $propdata text
* Throws: App::Exception::Serializer
* Since: 0.01
Sample Usage:
$context = App->context();
$serializer = $context->service("Serializer"); # or ...
$serializer = $context->serializer();
$data = {
an => 'arbitrary',
collection => [ 'of', 'data', ],
of => {
arbitrary => 'depth',
},
};
$propdata = $serializer->serialize($data);
* Signature: $data = $serializer->deserialize($propdata);
* Signature: $data = App::Serializer->deserialize($propdata);
* Param: $data ref
* Return: $propdata text
* Throws: App::Exception::Serializer
* Since: 0.01
Sample Usage:
$context = App->context();
$serializer = $context->service("Serializer"); # or ...
$serializer = $context->serializer();
$data = $serializer->deserialize($propdata);
print $serializer->dump($data), "\n";
The constructor is inherited from
App::Serializer|App::Serializer/"dump()".
* Author: Stephen Adkins <spadkins@gmail.com> * License: This is free software. It is licensed under the same terms as Perl itself.
App::Context|App::Context,
App::Service|App::Service
| App-Context documentation | view source | Contained in the App-Context distribution. |