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;
18 if ($class ne __PACKAGE__) {
19 # We were called from a child object. Return ourselves.
20 return bless($self, $class);
23 # Try to find a child object which is available and return that.
25 # See if videosite::JSLexArrayParser is available
27 require videosite::JSLexArrayParser;
31 # Available. Return a JSLexArrayParser object
32 return videosite::JSLexArrayParser->new();
35 # See if JSSimleArrayParser is available
37 require videosite::JSSimpleArrayParser;
41 # Available. Return a JSSimpleArrayParser object
42 return videosite::JSSimpleArrayParser->new();
45 # Nothing available. Return ourselves.
46 return bless($self, $class);
52 # No functionality here