This module implements a subclass of Template::TT3::Element to represent literal tokens. It acts as a common base class for the Template::TT3::Element::Text , Template::TT3::Element::Word , Template::TT3::Element::Keyword and various other modules.
This module implements the following methods in addition to those inherited from the Template::TT3::Element , Template::TT3::Base and Badger::Base base classes.
This method is an alias to the advance() method inherited from the Template::TT3::Element base class.
This method is an alias to the advance() method inherited from the Template::TT3::Element base class.
Returns a Template::TT3::Variable object to represent the text. The variable object can be used to call dotop methods against the literal value.
Returns a canonical representation of the template source expression for this
element. It uses the sprintf()
format returned by the
SOURCE_FORMAT
constant method to render the literal text. In this base class the
SOURCE_FORMAT
is defined to be %s
, resulting in a simple pass-through of
the token text. Subclasses may redefine SOURCE_FORMAT
to render a different
representation of the element.
This module defines the following constant. Note that constants are implemented in Perl as subroutines that can be called as methods against an object.
my $format = $self->SOURCE_FORMAT;
This allows a subclass to re-define the SOURCE_FORMAT
constant method to
return a different value.
Andy Wardley http://wardley.org
Copyright (C) 1996-2009 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This module inherits methods from the Template::TT3::Element , Template::TT3::Base and Badger::Base base classes.
It is constructed using the Template::TT3::Class::Element class metaprogramming module.
It is itself the base class for the Template::TT3::Element::Text , Template::TT3::Element::Number , Template::TT3::Element::Word , Template::TT3::Element::Keyword and Template::TT3::Element::Filename modules.