2 # This is a stub class for more complex JS*ArrayParser objects.
3 # It's new() method usually does _not_ return an object of
4 # type videosite::JSArrayParser, but rather a child object of itself
5 # which is able to do some actual work. The only time new() retuns
6 # an videosite::JSArrayParser onject is when no child objects are
10 package videosite::JSArrayParser;
19 if ($class ne __PACKAGE__) {
20 # We were called from a child object. Return ourselves.
21 return bless($self, $class);
24 # Try to find a child object which is available and return that.
26 # See if videosite::JSLexArrayParser is available
28 require videosite::JSLexArrayParser;
32 # Available. Return a JSLexArrayParser object
33 return videosite::JSLexArrayParser->new(%params);
36 # See if JSSimleArrayParser is available
38 require videosite::JSSimpleArrayParser;
42 # Available. Return a JSSimpleArrayParser object
43 return videosite::JSSimpleArrayParser->new(%params);
46 # Nothing available. Return ourselves.
47 return bless($self, $class);
53 # No functionality here