com.agilejava.docbkx.maven
Class InjectingEntityResolver

java.lang.Object
  extended by com.agilejava.docbkx.maven.InjectingEntityResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver

public class InjectingEntityResolver
extends java.lang.Object
implements org.xml.sax.EntityResolver

An EntityResolver that will inject a couple of additional general internal entities into the DTD resolved by underlying resolver.

Author:
Wilfred Springer

Nested Class Summary
 class InjectingEntityResolver.ReplacementInputSource
          The InputSource that will replace the first InputSource retrieved, containig XML entity declarations for all entities defined in the POM.
 
Constructor Summary
InjectingEntityResolver(java.util.List entities, org.xml.sax.EntityResolver resolver, java.lang.String type, org.apache.maven.plugin.logging.Log log)
           
 
Method Summary
 void forceInjection()
          Forces the object to inject the entities.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Returns the InputSource containing the external entity's data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectingEntityResolver

public InjectingEntityResolver(java.util.List entities,
                               org.xml.sax.EntityResolver resolver,
                               java.lang.String type,
                               org.apache.maven.plugin.logging.Log log)
Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
Returns the InputSource containing the external entity's data. This implementation will normally return an InputSource that contains all additional entities defined, including a reference to the InputSource that was originally requested. TODO Figure out if this works with all parsers. There might be a couple of cases in which we would need to perform some additional work.

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Parameters:
publicId - The public identifier of the entity.
systemId - The system identifier of the entity.
Returns:
An InputSource producing the data required.
Throws:
org.xml.sax.SAXException
java.io.IOException

forceInjection

public void forceInjection()
Forces the object to inject the entities.



Copyright © 2006-2008. All Rights Reserved.