Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

html::mason::methodmaker(3pm) [debian man page]

HTML::Mason::MethodMaker(3pm)				User Contributed Perl Documentation			     HTML::Mason::MethodMaker(3pm)

NAME
HTML::Mason::MethodMaker - Used to create simple get & get/set methods in other classes SYNOPSIS
use HTML::Mason::MethodMaker ( read_only => 'foo', read_write => [ [ bar => { type => SCALAR } ], [ baz => { isa => 'HTML::Mason::Baz' } ], 'quux', # no validation ], read_write_contained => { other_object => [ [ 'thing1' => { isa => 'Thing1' } ], 'thing2', # no validation ] }, ); DESCRIPTION
This automates the creation of simple accessor methods. USAGE
This module creates methods when it is "use"'d by another module. There are three types of methods: 'read_only', 'read_write', 'read_write_contained'. Attributes specified as 'read_only' get an accessor that only returns the value of the attribute. Presumably, these attributes are set via more complicated methods in the class or as a side effect of one of its methods. Attributes specified as 'read_write' will take a single optional parameter. If given, this parameter will become the new value of the attribute. This value is then returned from the method. If no parameter is given, then the current value is returned. If you want the accessor to use "Params::Validate" to validate any values passed to the accessor (and you _do_), then the the accessor specification should be an array reference containing two elements. The first element is the accessor name and the second is the validation spec. The 'read_write_contained' parameter is used to create accessor for delayed contained objects. A delayed contained object is one that is not created in the containing object's accessor, but rather at some point after the containing object is constructed. For example, the Interpreter object creates Request objects after the Interpreter itself has been created. The value of the 'read_write_contained' parameter should be a hash reference. The keys are the internal name of the contained object, such as "request" or "compiler". The values for the keys are the same as the parameters given for 'read_write' accessors. SEE ALSO
HTML::Mason perl v5.14.2 2012-02-04 HTML::Mason::MethodMaker(3pm)

Check Out this Related Man Page

HTML::Mason::Lexer(3pm) 				User Contributed Perl Documentation				   HTML::Mason::Lexer(3pm)

NAME
HTML::Mason::Lexer - Generates events based on component source lexing SYNOPSIS
my $lexer = HTML::Mason::Lexer->new; $lexer->lex( comp_source => $source, name => $comp_name, compiler => $compiler ); DESCRIPTION
The Lexer works in tandem with the Compiler to turn Mason component source into something else, generally Perl code. As the lexer finds component elements, like a tag or block, it calls the appropriate event methods in the compiler object it was given. It has only a few public methods. You can replace this lexer with one of your own simply by telling the Compiler to use a different lexer class. Your lexer class simply needs to call the appropriate methods in the Component Class's API as it scans the source. METHODS
The lexer has very few public methods. new This method creates a new Lexer object. This methods takes no parameters. lex ( comp_source => ..., name => ..., compiler => ... ) This method tells the lexer to start scanning the given component source. All of these parameters are required. The "name" parameter will be used in any error messages generated during lexing. The "compiler" object must be an object that implements the Mason Component API. line_number The current line number that the lexer has reached. name The name of the component currently being lexed. throw_syntax_error ($error) This throws an "HTML::Mason::Exception::Syntax" error with the given error message as well as additional information about the component source. This method is used by both the Lexer and the Compiler. SUBCLASSING
Any subclass of the lexer should declare itself to be a subclass of "HTML::Mason::Lexer", even if it plans to override all of its public methods. If you want your subclass to work with the existing Compiler classes in Mason, you must implement the methods listed above. If you plan to use a custom Compiler class that you're writing, you can do whatever you want. We recommend that any parameters you add to Lexer be read-only, because the compiler object_id is only computed once on creation and would not reflect any changes to Lexer parameters. perl v5.14.2 2012-02-04 HTML::Mason::Lexer(3pm)
Man Page