The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Repository::Simple::Type::Property - Types for repository properties

SYNOPSIS

See "SYNOPSIS" in Repository::Simple::Type::Node.

DESCRIPTION

Property types are used to determine information about what kind of information is acceptable for a property and how it may be updated. This class provides a flexible way of describing the possible values, a method for marshalling and unmarshalling those values to and from a scalar for storage, and other metadata about possible values.

METHODS

$type = Repository::Simple::Type::Property->new(%args)

Creates a new property type with the given arguments, %args.

The following arguments are used:

engine (required)

This is a reference to the storage engine owning this property type.

name (required)

This is a short identifying name for the type. This should be a fully qualified name, e.g., "ns:name".

auto_created

This property should be set to true if the creation of a node containing a property of this type triggers the creation of a property of this type.

By default, this value is false.

updatable

This property should be set to true if the value stored in the property cannot be changed.

By default, this value is false.

removable

When this property is set to a true value, this property may not be set to undef or deleted.

By default, this value is false.

value_type

This property should be set to an instance of Repository::Simple::Type::Value for the type of value that is stored in it.

By default, this is set to an instance of Repository::Simple::Type::Value::Scalar.

$name = $type->name

This method returns the name of the type.

$auto_created = $type->auto_created

Returns a true value if the property is automatically created with the parent.

$updatable = $type->updatable

Returns a true value if the value may be changed.

$removable = $type->removable

Returns a true value if the value may be removed from it's parent node.

$value_type = $type->value_type

Returns the value type of the properties value.

AUTHOR

Andrew Sterling Hanenkamp, <hanenkamp@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2005 Andrew Sterling Hanenkamp <hanenkamp@cpan.org>. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.