NAME

CodeGen::PerlBean::Attribute::Factory - Factory class to generate CodeGen::PerlBean::Attribute objects.

SYNOPSIS

See CodeGen::PerlBean.

ABSTRACT

CodeGen::PerlBean::Attribute object factory

DESCRIPTION

Instanciates CodeGen::PerlBean::Attribute.

CONSTRUCTOR

None.

METHODS

attribute (OPT_HASH_REF)

Returns CodeGen::PerlBean::Attribute objects based on OPT_HASH_REF. OPT_HASH_REF is a hash reference used to pass initialization options. The selected subclass of CodeGen::PerlBean::Attribute is initialized using OPT_HASH_REF. On error an exception Error::Simple is thrown.

Options for OPT_HASH_REF used by this method may include:

ordered

Boolean flag. Attribute to return must be an ordered list. Defaults to 0. Only makes sense if type is MULTI.

type

If type is BOOLEAN a CodeGen::PerlBean::Attribute::Boolean, on SINGLE a CodeGen::PerlBean::Attribute::Single and on MULTI a CodeGen::PerlBean::Attribute::Multi is returned. Defaults to SINGLE. NOTE: type has precedence over ordered and unique.

unique

Boolean flag. Items in list must be unique. Defaults to 0. Only makes sense if type is MULTI.

Options for OPT_HASH_REF used by the constructors of CodeGen::PerlBean::Attribute classes may include:

allow_empty

Boolean flag. Allowed the attribute to be empty. Defaults to 1. Doesn't make sense if type is BOOLEAN.

allow_isa

List of allowed classes. Must be an ARRAY reference. Doesn't make sense if type is BOOLEAN.

allow_ref

List of allowed references. Must be an ARRAY reference. Doesn't make sense if type is BOOLEAN.

allow_value

List of allowed values. Must be an ARRAY reference. Doesn't make sense if type is BOOLEAN.

attribute_name

Attribute's name. Mandatory option.

default_value

Attribute's default value.

exception_class

Class to throw when exception occurs. Defaults to Error::Simple.

mandatory

Boolean flag. States that the attribute is mandatory. Defaults to 0.

method_base

Set alternative method base name.

package

Package name. Defaults to main.

short_description

Short attribute description.

SEE ALSO

CodeGen::PerlBean CodeGen::PerlBean::Attribute CodeGen::PerlBean::Attribute::Boolean CodeGen::PerlBean::Attribute::Multi CodeGen::PerlBean::Attribute::Multi::Ordered CodeGen::PerlBean::Attribute::Multi::Unique CodeGen::PerlBean::Attribute::Multi::Unique::Ordered CodeGen::PerlBean::Attribute::Single

BUGS

None known (yet.)

HISTORY

First development: November 2002

AUTHOR

Vincenzo Zocca

COPYRIGHT

Copyright 2002 by Vincenzo Zocca

LICENSE

This file is part of the CodeGen::PerlBean module hierarchy for Perl by Vincenzo Zocca.

The CodeGen::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 CodeGen::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 CodeGen::PerlBean module hierarchy; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA