369 lines
11 KiB
HTML
369 lines
11 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Net::DBus::Binding::Introspector</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Net::DBus::Binding::Introspector</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-12-26<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Net::DBus::Binding::Introspector - Handler for object introspection data
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
# Create an object populating with info from an
|
|
# XML doc containing introspection data.
|
|
|
|
my $ins = Net::DBus::Binding::Introspector->new(xml => $data);
|
|
|
|
# Create an object, defining introspection data
|
|
# programmatically
|
|
my $ins = Net::DBus::Binding::Introspector->new(object_path => $object->get_object_path);
|
|
$ins->add_method("DoSomething", ["string"], [], "org.example.MyObject");
|
|
$ins->add_method("TestSomething", ["int32"], [], "org.example.MyObject");
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
This class is responsible for managing introspection data, and
|
|
answering questions about it. This is not intended for use by
|
|
application developers, whom should instead consult the higher
|
|
level <FONT SIZE="-1">API</FONT> in Net::DBus::Exporter.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>METHODS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">my $ins = Net::DBus::Binding::Introspector->new(object_path => $object_path, xml => $xml);<DD>
|
|
|
|
|
|
|
|
|
|
Creates a new introspection data manager for the object registered
|
|
at the path specified for the <TT>"object_path"</TT> parameter. The optional
|
|
<TT>"xml"</TT> parameter can be used to pre-load the manager with introspection
|
|
metadata from an <FONT SIZE="-1">XML</FONT> document.
|
|
<DT id="2">$ins->add_interface($name)<DD>
|
|
|
|
|
|
|
|
|
|
Register the object as providing an interface with the name <TT>$name</TT>
|
|
<DT id="3">my $bool = $ins->has_interface($name)<DD>
|
|
|
|
|
|
|
|
|
|
Return a true value if the object is registered as providing
|
|
an interface with the name <TT>$name</TT>; returns false otherwise.
|
|
<DT id="4">my @interfaces = $ins->has_method($name, [$interface])<DD>
|
|
|
|
|
|
|
|
|
|
Return a list of all interfaces provided by the object, which
|
|
contain a method called <TT>$name</TT>. This may be an empty list.
|
|
The optional <TT>$interface</TT> parameter can restrict the check to
|
|
just that one interface.
|
|
<DT id="5">my $boolean = $ins->is_method_allowed($name[, $interface])<DD>
|
|
|
|
|
|
|
|
|
|
Checks according to whether the remote caller is allowed to invoke
|
|
the method <TT>$name</TT> on the object associated with this introspector.
|
|
If this object has 'strict exports' enabled, then only explicitly
|
|
exported methods will be allowed. The optional <TT>$interface</TT> parameter
|
|
can restrict the check to just that one interface. Returns a non-zero
|
|
value if the method should be allowed.
|
|
<DT id="6">my @interfaces = $ins->has_signal($name)<DD>
|
|
|
|
|
|
|
|
|
|
Return a list of all interfaces provided by the object, which
|
|
contain a signal called <TT>$name</TT>. This may be an empty list.
|
|
<DT id="7">my @interfaces = $ins->has_property($name)<DD>
|
|
|
|
|
|
|
|
|
|
Return a list of all interfaces provided by the object, which
|
|
contain a property called <TT>$name</TT>. This may be an empty list.
|
|
The optional <TT>$interface</TT> parameter can restrict the check to
|
|
just that one interface.
|
|
<DT id="8">$ins->add_method($name, $params, $returns, $interface, $attributes, $paramnames, $returnnames);<DD>
|
|
|
|
|
|
|
|
|
|
Register the object as providing a method called <TT>$name</TT> accepting parameters
|
|
whose types are declared by <TT>$params</TT> and returning values whose type
|
|
are declared by <TT>$returns</TT>. The method will be scoped to the interface
|
|
named by <TT>$interface</TT>. The <TT>$attributes</TT> parameter is a hash reference
|
|
for annotating the method. The <TT>$paramnames</TT> and <TT>$returnames</TT> parameters
|
|
are a list of argument and return value names.
|
|
<DT id="9">$ins->add_signal($name, $params, $interface, $attributes);<DD>
|
|
|
|
|
|
|
|
|
|
Register the object as providing a signal called <TT>$name</TT> with parameters
|
|
whose types are declared by <TT>$params</TT>. The signal will be scoped to the interface
|
|
named by <TT>$interface</TT>. The <TT>$attributes</TT> parameter is a hash reference
|
|
for annotating the signal.
|
|
<DT id="10">$ins->add_property($name, $type, $access, $interface, $attributes);<DD>
|
|
|
|
|
|
|
|
|
|
Register the object as providing a property called <TT>$name</TT> with a type
|
|
of <TT>$type</TT>. The <TT>$access</TT> parameter can be one of <TT>"read"</TT>, <TT>"write"</TT>,
|
|
or <TT>"readwrite"</TT>. The property will be scoped to the interface
|
|
named by <TT>$interface</TT>. The <TT>$attributes</TT> parameter is a hash reference
|
|
for annotating the signal.
|
|
<DT id="11">my $boolean = $ins->is_method_deprecated($name, $interface)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a true value if the method called <TT>$name</TT> in the interface
|
|
<TT>$interface</TT> is marked as deprecated
|
|
<DT id="12">my $boolean = $ins->is_signal_deprecated($name, $interface)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a true value if the signal called <TT>$name</TT> in the interface
|
|
<TT>$interface</TT> is marked as deprecated
|
|
<DT id="13">my $boolean = $ins->is_property_deprecated($name, $interface)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a true value if the property called <TT>$name</TT> in the interface
|
|
<TT>$interface</TT> is marked as deprecated
|
|
<DT id="14">my $boolean = $ins->does_method_reply($name, $interface)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a true value if the method called <TT>$name</TT> in the interface
|
|
<TT>$interface</TT> will generate a reply. Returns a false value otherwise.
|
|
<DT id="15">my $boolean = $ins->method_has_strict_exceptions($name, $interface)<DD>
|
|
|
|
|
|
|
|
|
|
Returns true if the method called <TT>$name</TT> in the interface <TT>$interface</TT> has
|
|
the strict_exceptions attribute; that is any exceptions which aren't
|
|
Net::DBus::Error objects should not be caught and allowed to travel up the
|
|
stack.
|
|
<DT id="16">my @names = $ins->list_interfaces<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of all interfaces registered as being provided
|
|
by the object.
|
|
<DT id="17">my @names = $ins->list_methods($interface)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of all methods registered as being provided
|
|
by the object, within the interface <TT>$interface</TT>.
|
|
<DT id="18">my @names = $ins->list_signals($interface)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of all signals registered as being provided
|
|
by the object, within the interface <TT>$interface</TT>.
|
|
<DT id="19">my @names = $ins->list_properties($interface)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of all properties registered as being provided
|
|
by the object, within the interface <TT>$interface</TT>.
|
|
<DT id="20">my @paths = $self->list_children;<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of object paths representing all the children
|
|
of this node.
|
|
<DT id="21">my $path = $ins->get_object_path<DD>
|
|
|
|
|
|
|
|
|
|
Returns the path of the object associated with this introspection
|
|
data
|
|
<DT id="22">my @types = $ins->get_method_params($interface, $name)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of declared data types for parameters of the
|
|
method called <TT>$name</TT> within the interface <TT>$interface</TT>.
|
|
<DT id="23">my @types = $ins->get_method_param_names($interface, $name)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of declared names for parameters of the
|
|
method called <TT>$name</TT> within the interface <TT>$interface</TT>.
|
|
<DT id="24">my @types = $ins->get_method_returns($interface, $name)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of declared data types for return values of the
|
|
method called <TT>$name</TT> within the interface <TT>$interface</TT>.
|
|
<DT id="25">my @types = $ins->get_method_return_names($interface, $name)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of declared names for return values of the
|
|
method called <TT>$name</TT> within the interface <TT>$interface</TT>.
|
|
<DT id="26">my @types = $ins->get_signal_params($interface, $name)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of declared data types for values associated with the
|
|
signal called <TT>$name</TT> within the interface <TT>$interface</TT>.
|
|
<DT id="27">my @types = $ins->get_signal_param_names($interface, $name)<DD>
|
|
|
|
|
|
|
|
|
|
Returns a list of declared names for values associated with the
|
|
signal called <TT>$name</TT> within the interface <TT>$interface</TT>.
|
|
<DT id="28">my $type = $ins->get_property_type($interface, $name)<DD>
|
|
|
|
|
|
|
|
|
|
Returns the declared data type for property called <TT>$name</TT> within
|
|
the interface <TT>$interface</TT>.
|
|
<DT id="29">my $bool = $ins->is_property_readable($interface, $name);<DD>
|
|
|
|
|
|
|
|
|
|
Returns a true value if the property called <TT>$name</TT> within the
|
|
interface <TT>$interface</TT> can have its value read.
|
|
<DT id="30">my $bool = $ins->is_property_writable($interface, $name);<DD>
|
|
|
|
|
|
|
|
|
|
Returns a true value if the property called <TT>$name</TT> within the
|
|
interface <TT>$interface</TT> can have its value written to.
|
|
<DT id="31">my $xml = $ins->format([$obj])<DD>
|
|
|
|
|
|
|
|
|
|
Return a string containing an <FONT SIZE="-1">XML</FONT> document representing the
|
|
state of the introspection data. The optional <TT>$obj</TT> parameter
|
|
can be an instance of Net::DBus::Object to include object
|
|
specific information in the <FONT SIZE="-1">XML</FONT> (eg child nodes).
|
|
<DT id="32">my $xml_fragment = $ins->to_xml<DD>
|
|
|
|
|
|
|
|
|
|
Returns a string containing an <FONT SIZE="-1">XML</FONT> fragment representing the
|
|
state of the introspection data. This is basically the same
|
|
as the <TT>"format"</TT> method, but without the leading doctype
|
|
declaration.
|
|
<DT id="33">$type = $ins->to_xml_type($type)<DD>
|
|
|
|
|
|
|
|
|
|
Takes a text-based representation of a data type and returns
|
|
the compact representation used in <FONT SIZE="-1">XML</FONT> introspection data.
|
|
<DT id="34">$ins->encode($message, $type, $name, $direction, @args)<DD>
|
|
|
|
|
|
|
|
|
|
Append a set of values <@args> to a message object <TT>$message</TT>.
|
|
The <TT>$type</TT> parameter is either <TT>"signal"</TT> or <TT>"method"</TT> and
|
|
<TT>$direction</TT> is either <TT>"params"</TT> or <TT>"returns"</TT>. The introspection
|
|
data will be queried to obtain the declared data types & the
|
|
argument marshalling accordingly.
|
|
<DT id="35">my @args = $ins->decode($message, $type, $name, $direction)<DD>
|
|
|
|
|
|
|
|
|
|
Unmarshalls the contents of a message object <TT>$message</TT>.
|
|
The <TT>$type</TT> parameter is either <TT>"signal"</TT> or <TT>"method"</TT> and
|
|
<TT>$direction</TT> is either <TT>"params"</TT> or <TT>"returns"</TT>. The introspection
|
|
data will be queried to obtain the declared data types & the
|
|
arguments unmarshalled accordingly.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
|
|
|
|
Daniel P. Berrange
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright (C) 2004-2011 Daniel P. Berrange
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
Net::DBus::Exporter, Net::DBus::Binding::Message
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="36"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="37"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="38"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="39"><A HREF="#lbAE">METHODS</A><DD>
|
|
<DT id="40"><A HREF="#lbAF">AUTHOR</A><DD>
|
|
<DT id="41"><A HREF="#lbAG">COPYRIGHT</A><DD>
|
|
<DT id="42"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:48 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|