DAIA::Object - Abstract base class of all DAIA classes
version 0.43
This package implements just another Perl meta-class framework. Just ignore it unless you have a clue what "meta-class framework" could mean. Some concepts are borrowed from the mighty Moose object system but this framework is much smaller. Maybe you should better have a look at Moose and stop reading now.
In a nutshell DAIA::Object handles all method calls via AUTOLOAD. Each derived package must provide a %PROPERTIES hash that defines an object's attributes. Each property is defined by a hash that must either contain a type value pointing to a class name (typed property), or a filter value containing a plain value, or a filter method (untyped property).
DAIA::Object
%PROPERTIES
type
filter
Constructs a new DAIA object of the derived type. Unknown properties are ignored. In addition the following special properties are stored as hidden properties, that will not be copied to other objects, but only used for serializing the object: to, format, cgi, header, xmlheader, xmlns, xslt, pi, callback, exitif.
to
format
cgi
header
xmlheader
xmlns
xslt
pi
callback
exitif
Adds typed properties to an object.
A DAIA object can be serialized by the following methods:
Returns the object in DAIA/XML. With the xmlns as parameter you can specify that a namespace declaration is added (disabled by default unless you enable xslt or header). With xslt you can add an XSLT processing instruction and with pi any other processing instructions. If you enable header, an XML-header is prepended.
All TODO
Returns the object as unblessed Perl data structure. If you specify a true parameter, only boolean values will be kept as blessed JSON::Boolean objects (see JSON). The label property will only be included unless it is not the empty string.
JSON::Boolean
label
Returns the object in DAIA/JSON, optionally wrapped by a JavaScript callback function call. Invalid callback names are ignored without warning. The hidden property callback is used if no callback parameter is provided, use undef to fully disable the callback.
undef
Returns the object as hashref representing an RDF structure. This hashref structure is compatible with RDF/JSON and with the ARC2 library for PHP You can directly pass it the method add_hashref of RDF::Trine::Model.
add_hashref
Serialize in some required format (xml, json, rdfjson plus possibly more RDF serialization forms). A list of supported formats is returned by DAIA::formats.
xml
json
rdfjson
DAIA::formats
Returns the URI of this object, which is either an URI (the id property), or a blank node identifier, that starts with "_:".
id
_:
The following methods are only used internally; don't directly call or modify them unless you want to damage data integrity or to fix a bug!
Called if an unknown method is called. Almost all method calls go through this magic method. Thanks, AUTOLOAD, thanks Perl.
Simple, adopted XMLOut replacement with support of element order and special treatment of label elements.
Escape special XML characters.
Returns a property-value hash of constructor parameters.
Enrich a hash with hidden properties.
Enable :encoding(UTF-8) layer for a given filehandle unless it or some other encoding has already been enabled.
Jakob Voß
This software is copyright (c) 2013 by Jakob Voß.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install DAIA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DAIA
CPAN shell
perl -MCPAN -e shell install DAIA
For more information on module installation, please visit the detailed CPAN module installation guide.