| 1 | package Apache::AxKit::Util::LibXSLTAddonFunction; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | |||
| 5 | sub new { | ||
| 6 | my $class = shift; | ||
| 7 | |||
| 8 | my $this = [ [ ] ]; | ||
| 9 | |||
| 10 | bless $this, $class; | ||
| 11 | |||
| 12 | $this->init(); | ||
| 13 | |||
| 14 | return $this; | ||
| 15 | } | ||
| 16 | |||
| 17 | sub init { | ||
| 18 | die "has to be implemened by derived class\n"; | ||
| 19 | } | ||
| 20 | |||
| 21 | sub addRegisteredFunction { | ||
| 22 | push @{ $_[0]->[0] }, [ $_[1], $_[2] ]; | ||
| 23 | } | ||
| 24 | |||
| 25 | sub getNamespace { | ||
| 26 | die "has to be implemented by derived class\n"; | ||
| 27 | } | ||
| 28 | |||
| 29 | sub getFunctions { | ||
| 30 | return @{ $_[0][0] }; | ||
| 31 | } | ||
| 32 | |||
| 33 | 1; | ||
| 34 | __END__ |