0 Replies Latest reply on Nov 5, 2006 6:23 PM by starksm64

    DtdAwareContentHandler to support SAX2 LexicalHandler events

    starksm64

      The only way I can get the version for ejb2.x descriptors is to get the doctype. I hacked in some support for this by adding an extended ContentHandler that supports the startDTD/endDTD from the SAX2 LexicalHandler:

       interface DtdAwareContentHandler extends ContentHandler
       {
       public void startDTD(String name, String publicId, String systemId);
       public void endDTD();
       }
      


      The DelegatingContentHandler supports this, and the ObjectModelBuilder and DelegatingObjectModelFactory have been updated to pass this even on based on reflection of the type ObjectModelFactory:

      public class BookObjectFactory
       implements ObjectModelFactory
      {
       // ObjectModelFactory implementation
      
       public void startDTD(String name, String publicId, String systemId)
       {
       // Get version info from publicId...
       }