Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

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

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

NAME
HTML::Mason::ComponentSource - represents information about an component SYNOPSIS
my $info = $resolver->get_info($comp_path); DESCRIPTION
Mason uses the ComponentSource class to store information about a source component, one that has yet to be compiled. METHODS
new This method takes the following arguments: o comp_path The component's component path. o last_modified This is the last modificatoin time for the component, in Unix time (seconds since the epoch). o comp_id This is a unique id for the component used to distinguish two components with the same name in different component roots. If your resolver does not support multiple component roots, this can simply be the same as the "comp_path" key or it can be any other id you wish. This value will be used when constructing filesystem paths so it needs to be something that works on different filesystems. If it contains forward slashes, these will be converted to the appropriate filesystem-specific path separator. In fact, we encourage you to make sure that your component ids have some forward slashes in them or also all of your generated object files will end up in a single directory, which could affect performance. o comp_class The component class into which this particular component should be blessed when it is created. This must be a subclass of "HTML::Mason::Component", which is the default. o friendly_name This is used when displaying error messages related to the component, like parsing errors. This should be something that will help whoever sees the message identify the component. For example, for component stored on the filesystem, this should be the absolute path to the component. o source_callback This is a subroutine reference which, when called, returns the component source. The reasoning behind using this parameter is that it helps avoid a profusion of tiny little "HTML::Mason::ComponentSource" subclasses that don't do very much. o extra This optional parameter should be a hash reference. It is used to pass information from the resolver to the component class. This is needed since a "HTML::Mason::Resolver" subclass and a "HTML::Mason::Component" subclass can be rather tightly coupled, but they must communicate with each through the interpreter (this may change in the future). comp_path last_modified comp_id comp_class friendly_name extra These are all simple accessors that return the value given to the constructor. comp_source Returns the source of the component. object_code ( compiler => $compiler ) Given a compiler, this method returns the object code for the component. HTML::Mason, HTML::Mason::Admin, HTML::Mason::Component perl v5.14.2 2012-02-04 HTML::Mason::ComponentSource(3pm)

Check Out this Related Man Page

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

NAME
HTML::Mason::Exceptions - Exception objects thrown by Mason SYNOPSIS
use HTML::Mason::Exceptions ( abbr => [ qw(system_error) ] ); open FH, 'foo' or system_error "cannot open foo: $!"; DESCRIPTION
This module creates the hierarchy of exception objects used by Mason, and provides some extra methods for them beyond those provided by "Exception::Class" IMPORT
When this module is imported, it is possible to specify a list of abbreviated function names that you want to use to throw exceptions. In the SYNOPSIS example, we use the "system_error" function to throw a "HTML::Mason::Exception::System" exception. These abbreviated functions do not allow you to set additional fields in the exception, only the message. EXCEPTIONS
HTML::Mason::Exception This is the parent class for all exceptions thrown by Mason. Mason sometimes throws exceptions in this class when we could not find a better category for the message. Abbreviated as "error" HTML::Mason::Exception::Abort The "$m->abort" method was called. Exceptions in this class contain the field "aborted_value". HTML::Mason::Exception::Decline The "$m->decline" method was called. Exceptions in this class contain the field "declined_value". HTML::Mason::Exception::Compilation An exception occurred when attempting to "eval" an existing object file. Exceptions in this class have the field "filename", which indicates what file contained the code that caused the error. Abbreviated as "compilation_error". HTML::Mason::Exception::Compiler The compiler threw an exception because it received incorrect input. For example, this would be thrown if the lexer told the compiler to initialize compilation while it was in the middle of compiling another component. Abbreviated as "compiler_error". HTML::Mason::Exception::Compilation::IncompatibleCompiler A component was compiled by a compiler or lexer with incompatible options. This is used to tell Mason to recompile a component. Abbreviated as "wrong_compiler_error". HTML::Mason::Exception::Params Invalid parameters were passed to a method or function. Abbreviated as "param_error". HTML::Mason::Exception::Syntax This exception indicates that a component contained invalid syntax. Exceptions in this class have the fields "source_line", which is the actual source where the error was found, "comp_name", and "line_number". Abbreviated as "syntax_error". HTML::Mason::Exception::System A system call of some sort, such as a file open, failed. Abbreviated as "system_error". HTML::Mason::Exception::TopLevelNotFound The requested top level component could not be found. Abbreviated as "top_level_not_found_error". HTML::Mason::VirtualMethod Some piece of code attempted to call a virtual method which was not overridden. Abbreviated as "virtual_error" FIELDS
Some of the exceptions mentioned above have additional fields, which are available via accessors. For example, to get the line number of an "HTML::Mason::Exception::Syntax" exception, you call the "line_number" method on the exception object. EXCEPTION METHODS
All of the Mason exceptions implement the following methods: as_brief This simply returns the exception message, without any trace information. as_line This returns the exception message and its trace information, all on a single line with tabs between the message and each frame of the stack trace. as_text This returns the exception message and stack information, with each frame on a separate line. as_html This returns the exception message and stack as an HTML page. Each of these methods corresponds to a valid error_format parameter for the Request object such as "text" or "html". You can create your own method in the "HTML::Mason::Exception" namespace, such as "as_you_wish", in which case you could set this parameter to "you_wish". This method will receive a single argument, the exception object, and is expected to return some sort of string containing the formatted error message. EXCEPTION CLASS CHECKING
This module also exports the "isa_mason_exception" function. This function takes the exception object and an optional string parameter indicating what subclass to check for. So it can be called either as: if ( isa_mason_exception($@) ) { ... } or if ( isa_mason_exception($@, 'Syntax') ) { ... } Note that when specifying a subclass you should not include the leading "HTML::Mason::Exception::" portion of the class name. perl v5.14.2 2012-02-04 HTML::Mason::Exceptions(3pm)
Man Page