| 1 | # -*- Mode: Perl; indent-tabs-mode: nil; -*- | ||
| 2 | |||
| 3 | package Wombat::Util::XmlAction; | ||
| 4 | |||
| 5 | =pod | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Wombat::Util::XmlAction - xml parser event handler | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | my $mapper = Wombat::Util::XmlAction->new(); | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | Represents an action to take when a specific rule is matched by an XmlMapper. | ||
| 18 | |||
| 19 | =cut | ||
| 20 | |||
| 21 | use fields qw(); | ||
| 22 | |||
| 23 | =pod | ||
| 24 | |||
| 25 | =head1 CONSTRUCTOR | ||
| 26 | |||
| 27 | =over | ||
| 28 | |||
| 29 | =item new() | ||
| 30 | |||
| 31 | Create and return an instance, initializing fields to default values. | ||
| 32 | |||
| 33 | =back | ||
| 34 | |||
| 35 | =cut | ||
| 36 | |||
| 37 | sub new { | ||
| 38 | my $self = shift; | ||
| 39 | |||
| 40 | $self = fields::new($self) unless ref $self; | ||
| 41 | |||
| 42 | return $self; | ||
| 43 | } | ||
| 44 | |||
| 45 | =pod | ||
| 46 | |||
| 47 | =head1 PUBLIC METHODS | ||
| 48 | |||
| 49 | =over | ||
| 50 | |||
| 51 | =cut | ||
| 52 | |||
| 53 | sub start {} | ||
| 54 | |||
| 55 | sub end {} | ||
| 56 | |||
| 57 | sub cleanup {} | ||
| 58 | |||
| 59 | sub trim { | ||
| 60 | my $self = shift; | ||
| 61 | my $str = shift or | ||
| 62 | return ""; | ||
| 63 | |||
| 64 | $str =~ s/^\s*//; | ||
| 65 | $str =~ s/\s*$//; | ||
| 66 | |||
| 67 | return $str; | ||
| 68 | } | ||
| 69 | |||
| 70 | =pod | ||
| 71 | |||
| 72 | =back | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | 1; | ||
| 77 | __END__ |