5.9. Helpers

The helpers that build a Coffee object are similar to their assembler counterparts. The Helper class is the top of a hierarchy of classes that help to build an object based on recognizing elements of an XML markup file. An application (such as ShowCoffeeXML) that uses a SAX parser can pass control to helpers upon receiving SAX events. The idea is that the application will register itself with the SAX parser to receive recognition events. Then the application uses Helper objects to help build a target object.

 package sjm.examples.coffee; /** * This class is the top of a hierarchy of classes that help * to build a coffee object, based on recognizing elements * of an XML markup file.... */ public class Helper { /** * An application ...

Get Building Parsers with Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.