org.glassfish.web
Class WebEntityResolver

java.lang.Object
  extended by org.glassfish.web.WebEntityResolver
All Implemented Interfaces:
org.jvnet.hk2.component.PostConstruct, org.xml.sax.EntityResolver

@Service(name="web")
public class WebEntityResolver
extends java.lang.Object
implements org.xml.sax.EntityResolver, org.jvnet.hk2.component.PostConstruct

EntityResolver that recognizes known public IDs of JavaEE DTDs/schemas and return a local copy.

This implementation assumes that those files are available in $INSTALL_ROOT/lib/schemas and $INSTALL_ROOT/lib/dtds, but in different environment, different implementation can be plugged in to perform entirely different resolution.

Author:
Kohsuke Kawaguchi

Field Summary
 java.util.Map<java.lang.String,java.lang.String> knownDTDs
          Known DTDs.
 
Constructor Summary
WebEntityResolver()
           
 
Method Summary
 void postConstruct()
           
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          If the parser hits one of the well-known DTDs, parse local copies instead of hitting the remote server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

knownDTDs

public final java.util.Map<java.lang.String,java.lang.String> knownDTDs
Known DTDs. Expose the map so that interested party can introspect the table value and modify them.

Constructor Detail

WebEntityResolver

public WebEntityResolver()
Method Detail

postConstruct

public void postConstruct()
Specified by:
postConstruct in interface org.jvnet.hk2.component.PostConstruct

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
If the parser hits one of the well-known DTDs, parse local copies instead of hitting the remote server.

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Throws:
org.xml.sax.SAXException
java.io.IOException


Copyright © 2012 GlassFish Community. All Rights Reserved.