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::Attributeobject.OPT_HASH_REFis a hash reference used to pass initialization options.OPT_HASH_REFis mandatory. On error an exceptionError::Simpleis thrown.Options for
OPT_HASH_REFmay include:- allow_empty
-
Passed to "setAllowEmpty ()". Defaults to 1.
- allow_isa
-
Passed to "setAllowIsa ()". Must be an
ARRAYreference. - allow_ref
-
Passed to "setAllowRef ()". Must be an
ARRAYreference. - allow_value
-
Passed to "setAllowValue ()". Must be an
ARRAYreference. - 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.
VALUEis the value. Default value at initialization is1. On error an exceptionError::Simpleis thrown. - isAllowEmpty ()
-
Returns whether the attribute is allowed to be empty or not.
- setAllowIsa (ARRAY)
-
Set the list of allowed classes absolutely.
ARRAYis 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 exceptionError::Simpleis thrown. - addAllowIsa (ARRAY)
-
Add additional values on the list of allowed classes.
ARRAYis 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 exceptionError::Simpleis thrown. - deleteAllowIsa (ARRAY)
-
Delete elements from the list of allowed classes. Returns the number of deleted elements. On error an exception
Error::Simpleis thrown. - hasAllowIsa (ARRAY)
-
Returns the count of items in
ARRAYthat are in the list of allowed classes. - getAllowIsa ()
-
Returns an
ARRAYcontaining the list of allowed classes. - setAllowRef (ARRAY)
-
Set the list of allowed references absolutely.
ARRAYis 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 exceptionError::Simpleis thrown. - addAllowRef (ARRAY)
-
Add additional values on the list of allowed references.
ARRAYis 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 exceptionError::Simpleis thrown. - deleteAllowRef (ARRAY)
-
Delete elements from the list of allowed references. Returns the number of deleted elements. On error an exception
Error::Simpleis thrown. - hasAllowRef (ARRAY)
-
Returns the count of items in
ARRAYthat are in the list of allowed references. - getAllowRef ()
-
Returns an
ARRAYcontaining the list of allowed references. - setAllowValue (ARRAY)
-
Set the list of allowed values absolutely.
ARRAYis 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 exceptionError::Simpleis thrown. - addAllowValue (ARRAY)
-
Add additional values on the list of allowed values.
ARRAYis 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 exceptionError::Simpleis thrown. - deleteAllowValue (ARRAY)
-
Delete elements from the list of allowed values. Returns the number of deleted elements. On error an exception
Error::Simpleis thrown. - hasAllowValue (ARRAY)
-
Returns the count of items in
ARRAYthat are in the list of allowed values. - getAllowValue ()
-
Returns an
ARRAYcontaining the list of allowed values. - setAttributeName (VALUE)
-
Set attribute's name.
VALUEis the value.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - getAttributeName ()
-
Returns attribute's name.
- setDefaultValue (VALUE)
-
Set attribute's default value.
VALUEis the value. On error an exceptionError::Simpleis thrown. - getDefaultValue ()
-
Returns attribute's default value.
- setExceptionClass (VALUE)
-
Set class to throw when exception occurs.
VALUEis the value. Default value at initialization isError::Simple.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - getExceptionClass ()
-
Returns class to throw when exception occurs.
- setMandatory (VALUE)
-
State that the attribute is mandatory.
VALUEis the value. Default value at initialization is0. On error an exceptionError::Simpleis thrown. - isMandatory ()
-
Returns whether the attribute is mandatory or not.
- setMethodBase (VALUE)
-
Set method base name.
VALUEis the value. On error an exceptionError::Simpleis thrown. - getMethodBase ()
-
Returns method base name.
- setPackage (VALUE)
-
Set package name.
VALUEis the value. Default value at initialization ismain.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - getPackage ()
-
Returns package name.
- getPackageUS ()
-
Returns package name with
:+replaces by C <_>. - setShortDescription (VALUE)
-
Set attribute description.
VALUEis the value. On error an exceptionError::Simpleis thrown. - getShortDescription ()
-
Returns attribute description.
- writeAllowIsa (FILEHANDLE)
-
Write
%ALLOW_ISAline for the attribute.FILEHANDLEis anIO::Handleobject. - writeAllowRef (FILEHANDLE)
-
Write
%ALLOW_REFline for the attribute.FILEHANDLEis anIO::Handleobject. - writeAllowValue (FILEHANDLE)
-
Write
%ALLOW_VALUEline for the attribute.FILEHANDLEis anIO::Handleobject. - writeDefaultValue (FILEHANDLE)
-
Write
%DEFAULT_VALUEline for the attribute.FILEHANDLEis anIO::Handleobject. - writeOptInit (FILEHANDLE)
-
Write
_initialize ()option parsing code for the attribute.FILEHANDLEis anIO::Handleobject. - writeDocInit (FILEHANDLE)
-
Write documentation for
_initialize ()for the attribute.FILEHANDLEis anIO::Handleobject. - writeMethods (FILEHANDLE)
-
Write the access methods for the attribute.
FILEHANDLEis anIO::Handleobject. - writeDocMethods (FILEHANDLE)
-
Write documentation for the access methods for the attribute.
FILEHANDLEis anIO::Handleobject.
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