NAME

CodeGen::PerlBean::Attribute - contains bean attribute information

SYNOPSIS

None. This is an abstract class.

ABSTRACT

Abstract bean attribute information

DESCRIPTION

CodeGen::PerlBean::Attribute abstract class for bean attribute information. Attribute access methods are implemented. Code and documentation generation interface methods are defined.

CONSTRUCTOR

new (OPT_HASH_REF)

Creates a new CodeGen::PerlBean::Attribute object. OPT_HASH_REF is a hash reference used to pass initialization options. OPT_HASH_REF is mandatory. On error an exception Error::Simple is thrown.

Options for OPT_HASH_REF may include:

allow_empty

Passed to "setAllowEmpty ()". Defaults to 1.

allow_isa

Passed to "setAllowIsa ()". Must be an ARRAY reference.

allow_ref

Passed to "setAllowRef ()". Must be an ARRAY reference.

allow_value

Passed to "setAllowValue ()". Must be an ARRAY reference.

attribute_name

Passed to "setAttributeName ()". Mandatory option.

default_value

Passed to "setDefaultValue ()".

exception_class

Passed to "setExceptionClass ()". Defaults to Error::Simple.

mandatory

Passed to "setMandatory ()". Defaults to 0.

method_base

Passed to "setMethodBase ()".

package

Passed to "setPackage ()". Defaults to main.

short_description

Passed to "setShortDescription ()".

METHODS

setAllowEmpty (VALUE)

State that the attribute is allowed to be empty. VALUE is the value. Default value at initialization is 1. On error an exception Error::Simple is thrown.

isAllowEmpty ()

Returns whether the attribute is allowed to be empty or not.

setAllowIsa (ARRAY)

Set the list of allowed classes absolutely. ARRAY is the list value. Each element in the list is allowed to occur only once. Multiple occurences of the same element yield in the last occuring element to be inserted and the rest to be ignored. On error an exception Error::Simple is thrown.

addAllowIsa (ARRAY)

Add additional values on the list of allowed classes. ARRAY is the list value. The addition may not yield to multiple identical elements in the list. Hence, Multiple occurences of the same element cause the last occurence to be inserted. On error an exception Error::Simple is thrown.

deleteAllowIsa (ARRAY)

Delete elements from the list of allowed classes. Returns the number of deleted elements. On error an exception Error::Simple is thrown.

hasAllowIsa (ARRAY)

Returns the count of items in ARRAY that are in the list of allowed classes.

getAllowIsa ()

Returns an ARRAY containing the list of allowed classes.

setAllowRef (ARRAY)

Set the list of allowed references absolutely. ARRAY is the list value. Each element in the list is allowed to occur only once. Multiple occurences of the same element yield in the last occuring element to be inserted and the rest to be ignored. On error an exception Error::Simple is thrown.

addAllowRef (ARRAY)

Add additional values on the list of allowed references. ARRAY is the list value. The addition may not yield to multiple identical elements in the list. Hence, Multiple occurences of the same element cause the last occurence to be inserted. On error an exception Error::Simple is thrown.

deleteAllowRef (ARRAY)

Delete elements from the list of allowed references. Returns the number of deleted elements. On error an exception Error::Simple is thrown.

hasAllowRef (ARRAY)

Returns the count of items in ARRAY that are in the list of allowed references.

getAllowRef ()

Returns an ARRAY containing the list of allowed references.

setAllowValue (ARRAY)

Set the list of allowed values absolutely. ARRAY is the list value. Each element in the list is allowed to occur only once. Multiple occurences of the same element yield in the last occuring element to be inserted and the rest to be ignored. On error an exception Error::Simple is thrown.

addAllowValue (ARRAY)

Add additional values on the list of allowed values. ARRAY is the list value. The addition may not yield to multiple identical elements in the list. Hence, Multiple occurences of the same element cause the last occurence to be inserted. On error an exception Error::Simple is thrown.

deleteAllowValue (ARRAY)

Delete elements from the list of allowed values. Returns the number of deleted elements. On error an exception Error::Simple is thrown.

hasAllowValue (ARRAY)

Returns the count of items in ARRAY that are in the list of allowed values.

getAllowValue ()

Returns an ARRAY containing the list of allowed values.

setAttributeName (VALUE)

Set attribute's name. VALUE is the value. VALUE may not be undef. On error an exception Error::Simple is thrown.

getAttributeName ()

Returns attribute's name.

setDefaultValue (VALUE)

Set attribute's default value. VALUE is the value. On error an exception Error::Simple is thrown.

getDefaultValue ()

Returns attribute's default value.

setExceptionClass (VALUE)

Set class to throw when exception occurs. VALUE is the value. Default value at initialization is Error::Simple. VALUE may not be undef. On error an exception Error::Simple is thrown.

getExceptionClass ()

Returns class to throw when exception occurs.

setMandatory (VALUE)

State that the attribute is mandatory. VALUE is the value. Default value at initialization is 0. On error an exception Error::Simple is thrown.

isMandatory ()

Returns whether the attribute is mandatory or not.

setMethodBase (VALUE)

Set method base name. VALUE is the value. On error an exception Error::Simple is thrown.

getMethodBase ()

Returns method base name.

setPackage (VALUE)

Set package name. VALUE is the value. Default value at initialization is main. VALUE may not be undef. On error an exception Error::Simple is thrown.

getPackage ()

Returns package name.

getPackageUS ()

Returns package name with :+ replaces by C <_>.

setShortDescription (VALUE)

Set attribute description. VALUE is the value. On error an exception Error::Simple is thrown.

getShortDescription ()

Returns attribute description.

writeAllowIsa (FILEHANDLE)

Write %ALLOW_ISA line for the attribute. FILEHANDLE is an IO::Handle object.

writeAllowRef (FILEHANDLE)

Write %ALLOW_REF line for the attribute. FILEHANDLE is an IO::Handle object.

writeAllowValue (FILEHANDLE)

Write %ALLOW_VALUE line for the attribute. FILEHANDLE is an IO::Handle object.

writeDefaultValue (FILEHANDLE)

Write %DEFAULT_VALUE line for the attribute. FILEHANDLE is an IO::Handle object.

writeOptInit (FILEHANDLE)

Write _initialize () option parsing code for the attribute. FILEHANDLE is an IO::Handle object.

writeDocInit (FILEHANDLE)

Write documentation for _initialize () for the attribute. FILEHANDLE is an IO::Handle object.

writeMethods (FILEHANDLE)

Write the access methods for the attribute. FILEHANDLE is an IO::Handle object.

writeDocMethods (FILEHANDLE)

Write documentation for the access methods for the attribute. FILEHANDLE is an IO::Handle object.

SEE ALSO

CodeGen::PerlBean::Attribute::Boolean CodeGen::PerlBean::Attribute::Factory 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

Vincent Zocca

COPYRIGHT

Copyright 2002 by Vincent 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