Class ValidatingXMLParser.MoMLEntityResolver

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

    public static class ValidatingXMLParser.MoMLEntityResolver
    extends java.lang.Object
    implements org.xml.sax.EntityResolver
    Resolve an entity by checking for http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd and, if found, return the value of MoMLParser.MoML_1.dtd.
    • 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 the entity.
      • Methods inherited from class java.lang.Object

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

      • MoMLEntityResolver

        public MoMLEntityResolver()
    • Method Detail

      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String publicID,
                                                     java.lang.String systemID)
                                              throws org.xml.sax.SAXException
        Resolve the entity.
        Specified by:
        resolveEntity in interface org.xml.sax.EntityResolver
        Parameters:
        publicID - Ignored.
        systemID - The systemID.
        Returns:
        If systemID equals http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd then return an InputSource based on the value of MoMLParser.MoML_DTD_1, If the systemID equals https://accessors.org/Accessor_1.dtd, then return the contents of $CLASSPATH/org/terraswarm/accessor/accessors/web/Accessor_1.dtd otherwise return null.
        Throws:
        org.xml.sax.SAXException - If the MoML DTD cannot be created.