avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mirceat...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/dom DefaultDOMHandler.java DOMHandlerFactory.java DefaultDOMHandlerFactory.java
Date Tue, 03 Sep 2002 20:29:53 GMT
mirceatoma    2002/09/03 13:29:53

  Modified:    xmlutil/src/java/org/apache/excalibur/xml/dom
                        DefaultDOMHandler.java DOMHandlerFactory.java
                        DefaultDOMHandlerFactory.java
  Log:
  Remove the configuration of the TransformerFactory (it can be handled by a ContentHandler
wrapper).
  
  Revision  Changes    Path
  1.4       +3 -20     jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/dom/DefaultDOMHandler.java
  
  Index: DefaultDOMHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/dom/DefaultDOMHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultDOMHandler.java	16 Aug 2002 10:42:36 -0000	1.3
  +++ DefaultDOMHandler.java	3 Sep 2002 20:29:53 -0000	1.4
  @@ -22,33 +22,16 @@
       implements DOMHandler
   {    
       private final Document m_document;
  -    private final boolean m_ignoreWhitespaces;
  -    private final boolean m_ignoreComments;
       
  -    public DefaultDOMHandler( TransformerHandler handler, Document document, boolean ignoreComments,
boolean ignoreWhitespaces )
  +    public DefaultDOMHandler( TransformerHandler handler, Document document )
       {
           super( handler, handler );
  -        m_document = document;
  -        m_ignoreComments = ignoreComments;
  -        m_ignoreWhitespaces = ignoreWhitespaces;
  -        
  +        m_document = document;        
           handler.setResult( new DOMResult( m_document ) );
       }
       
       public Document getDocument()
       {
           return m_document;
  -    }
  -    
  -    public void ignorableWhitespace( final char[] ch, final int start, final int len )
  -    throws SAXException
  -    {
  -        if ( !m_ignoreWhitespaces ) super.ignorableWhitespace( ch, start, len );      
 
  -    }
  -    
  -    public void comment( final char[] ch, final int start, final int len )
  -    throws SAXException
  -    {
  -        if ( !m_ignoreComments ) super.comment( ch, start, len );
       }
   }
  
  
  
  1.3       +5 -1      jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/dom/DOMHandlerFactory.java
  
  Index: DOMHandlerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/dom/DOMHandlerFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMHandlerFactory.java	16 Aug 2002 10:42:36 -0000	1.2
  +++ DOMHandlerFactory.java	3 Sep 2002 20:29:53 -0000	1.3
  @@ -7,6 +7,8 @@
    */
   package org.apache.excalibur.xml.dom;
   
  +import org.w3c.dom.Document;
  +
   /**
    * The factory creates a DOMHandler encapsulating a DOM document. The document
    * behaviour is setup by the factory.
  @@ -19,4 +21,6 @@
       String ROLE = DOMHandlerFactory.class.getName();
   
       DOMHandler createDOMHandler() throws Exception;
  +
  +    DOMHandler createDOMHandler(Document document) throws Exception;
   }
  
  
  
  1.4       +8 -14     jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/dom/DefaultDOMHandlerFactory.java
  
  Index: DefaultDOMHandlerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/dom/DefaultDOMHandlerFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultDOMHandlerFactory.java	16 Aug 2002 10:42:12 -0000	1.3
  +++ DefaultDOMHandlerFactory.java	3 Sep 2002 20:29:53 -0000	1.4
  @@ -26,20 +26,11 @@
    */
   public class DefaultDOMHandlerFactory
       extends AbstractLogEnabled
  -    implements DOMHandlerFactory, Configurable, Initializable, Component, ThreadSafe
  +    implements DOMHandlerFactory, Initializable, Component, ThreadSafe
   {
       private final SAXTransformerFactory m_transformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
       private final DocumentBuilderFactory m_documentBuilderFactory = DocumentBuilderFactory.newInstance();
       private DocumentBuilder m_documentBuilder;
  -    private boolean m_ignoreWhitespaces;
  -    private boolean m_ignoreComments;
  -
  -    public void configure( final Configuration configuration )
  -        throws ConfigurationException
  -    {
  -        m_ignoreWhitespaces = configuration.getChild( "ignore-whitespaces" ).getValueAsBoolean(
false );
  -        m_ignoreComments = configuration.getChild( "ignore-comments" ).getValueAsBoolean(
false );
  -    }
   
       public void initialize() throws Exception
       {
  @@ -49,8 +40,11 @@
       public DOMHandler createDOMHandler() throws Exception
       {
           final Document document = m_documentBuilder.newDocument();
  -        final TransformerHandler transformerHandler = m_transformerFactory.newTransformerHandler();
  -
  -        return new DefaultDOMHandler( transformerHandler, document, m_ignoreComments, m_ignoreWhitespaces
);
  +        return createDOMHandler(document);
       }
  +    
  +    public DOMHandler createDOMHandler(Document document) throws Exception {
  +        final TransformerHandler transformerHandler = m_transformerFactory.newTransformerHandler();
  +        return new DefaultDOMHandler( transformerHandler, document );
  +    }    
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message