Class XMLParser.EntityResolver

  • All Implemented Interfaces:
    org.xml.sax.EntityResolver
    Enclosing class:
    XMLParser

    public static class XMLParser.EntityResolver
    extends java.lang.Object
    implements org.xml.sax.EntityResolver
    The entity resolver that tries to first load a DTD file locally, and if it is not found, looks for it on the Internet using the DTD file's system ID. The DTD file, as well as its version, is uniquely identified by its public ID.
    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Thomas Feng
    Pt.AcceptedRating:
    Red (tfeng)
    Pt.ProposedRating:
    Green (tfeng)
    • Constructor Summary

      Constructors 
      Constructor Description
      EntityResolver()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.xml.sax.InputSource resolveEntity​(java.lang.String publicId, java.lang.String systemId)
      Resolve an entity (a DTD file) by first looking for it locally.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EntityResolver

        public EntityResolver()
    • Method Detail

      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String publicId,
                                                     java.lang.String systemId)
        Resolve an entity (a DTD file) by first looking for it locally. If it is not found locally, this resolver tries to grab it from the Internet using its systemId.
        Specified by:
        resolveEntity in interface org.xml.sax.EntityResolver
        Parameters:
        publicId - The public ID of the entity, for example, "-//UC Berkeley//DTD MoML 1//EN" for Ptolemy MoML 1.0.
        systemId - The system ID of the entity, for example, "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd".
        Returns:
        The input source that contains the content of the DTD, or null if it cannot be loaded either locally or from the Internet.