PerlBean::Attribute::Factory - factory package to generate PerlBean::Attribute objects
PerlBean::Attribute
use strict; use PerlBean::Attribute::Factory; my $factory = PerlBean::Attribute::Factory->new(); my $attr = $factory->create_attribute( { type => 'BOOLEAN', method_factory_name => 'true', short_description => 'something is true', } );
PerlBean::Attribute object factory
PerlBean::Attribute::Factory objects create instances of PerlBean::Attribute objects.
PerlBean::Attribute::Factory
Creates a new PerlBean::Attribute::Factory object.
Returns PerlBean::Attribute objects based on OPT_HASH_REF. OPT_HASH_REF is a hash reference used to pass initialization options. The selected subclass of PerlBean::Attribute is initialized using OPT_HASH_REF. On error an exception Error::Simple is thrown.
OPT_HASH_REF
Error::Simple
Options for OPT_HASH_REF used by this method may include:
Boolean flag. States that the returned attribute must be unique, associative MULTI. Defaults to 0. Only makes sense if type is MULTI and unique is true.
MULTI
type
Boolean flag. States that the returned attribute must be an ordered list. Defaults to 0. Only makes sense if type is MULTI.
If type is BOOLEAN a PerlBean::Attribute::Boolean, on SINGLE a PerlBean::Attribute::Single and on MULTI a PerlBean::Attribute::Multi is returned. Defaults to 'SINGLE'. NOTE: type has precedence over ordered and unique.
PerlBean::Attribute::Boolean
PerlBean::Attribute::Single
PerlBean::Attribute::Multi
Boolean flag. States that the items in the MULTI attribute must be unique. Defaults to 0. Only makes sense if type is MULTI.
Options for OPT_HASH_REF passed to package PerlBean::Attribute may include:
default_value
Passed to set_default_value().
exception_class
Passed to set_exception_class(). Defaults to 'Error::Simple'.
mandatory
Passed to set_mandatory(). Defaults to 0.
method_base
Passed to set_method_base().
method_factory_name
Passed to set_method_factory_name(). Mandatory option.
perl_bean
Passed to set_perl_bean().
short_description
Passed to set_short_description().
Options for OPT_HASH_REF passed to package PerlBean::Attribute::Single may include:
allow_empty
Passed to set_allow_empty(). Defaults to 1.
allow_isa
Passed to set_allow_isa(). Must be an ARRAY reference.
ARRAY
allow_ref
Passed to set_allow_ref(). Must be an ARRAY reference.
allow_rx
Passed to set_allow_rx(). Must be an ARRAY reference.
allow_value
Passed to set_allow_value(). Must be an ARRAY reference.
PerlBean, PerlBean::Attribute, PerlBean::Attribute::Boolean, PerlBean::Attribute::Multi, PerlBean::Attribute::Multi::Ordered, PerlBean::Attribute::Multi::Unique, PerlBean::Attribute::Multi::Unique::Associative, PerlBean::Attribute::Multi::Unique::Associative::MethodKey, PerlBean::Attribute::Multi::Unique::Ordered, PerlBean::Attribute::Single, PerlBean::Collection, PerlBean::Dependency, PerlBean::Dependency::Import, PerlBean::Dependency::Require, PerlBean::Dependency::Use, PerlBean::Described, PerlBean::Described::ExportTag, PerlBean::Method, PerlBean::Method::Constructor, PerlBean::Method::Factory, PerlBean::Style, PerlBean::Symbol
None known (yet.)
First development: November 2002 Last update: September 2003
Vincenzo Zocca
Copyright 2002, 2003 by Vincenzo Zocca
This file is part of the PerlBean module hierarchy for Perl by Vincenzo Zocca.
PerlBean
The PerlBean module hierarchy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
The PerlBean module hierarchy 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. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the PerlBean module hierarchy; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
To install PerlBean, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PerlBean
CPAN shell
perl -MCPAN -e shell install PerlBean
For more information on module installation, please visit the detailed CPAN module installation guide.