Class XMLEntityResolver

    • Constructor Summary

      Constructors 
      Constructor Description
      XMLEntityResolver()
      Initializes the resolver.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addExternalEntity​(java.lang.String name, java.lang.String publicID, java.lang.String systemID)
      Adds an external entity.
      void addInternalEntity​(java.lang.String name, java.lang.String value)
      Adds an internal entity.
      protected void finalize()
      Cleans up the object when it's destroyed.
      java.io.Reader getEntity​(IXMLReader xmlReader, java.lang.String name)
      Returns a Java reader containing the value of an entity.
      boolean isExternalEntity​(java.lang.String name)
      Returns true if an entity is external.
      protected java.io.Reader openExternalEntity​(IXMLReader xmlReader, java.lang.String publicID, java.lang.String systemID)
      Opens an external entity.
      • Methods inherited from class java.lang.Object

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

      • XMLEntityResolver

        public XMLEntityResolver()
        Initializes the resolver.
    • Method Detail

      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Cleans up the object when it's destroyed.
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • addInternalEntity

        public void addInternalEntity​(java.lang.String name,
                                      java.lang.String value)
        Adds an internal entity.
        Specified by:
        addInternalEntity in interface IXMLEntityResolver
        Parameters:
        name - the name of the entity.
        value - the value of the entity.
      • addExternalEntity

        public void addExternalEntity​(java.lang.String name,
                                      java.lang.String publicID,
                                      java.lang.String systemID)
        Adds an external entity.
        Specified by:
        addExternalEntity in interface IXMLEntityResolver
        Parameters:
        name - the name of the entity.
        publicID - the public ID of the entity, which may be null.
        systemID - the system ID of the entity.
      • getEntity

        public java.io.Reader getEntity​(IXMLReader xmlReader,
                                        java.lang.String name)
                                 throws XMLParseException
        Returns a Java reader containing the value of an entity.
        Specified by:
        getEntity in interface IXMLEntityResolver
        Parameters:
        xmlReader - the current XML reader
        name - the name of the entity.
        Returns:
        the reader, or null if the entity could not be resolved.
        Throws:
        XMLParseException - If an exception occurred while resolving the entity.
      • isExternalEntity

        public boolean isExternalEntity​(java.lang.String name)
        Returns true if an entity is external.
        Specified by:
        isExternalEntity in interface IXMLEntityResolver
        Parameters:
        name - the name of the entity.
      • openExternalEntity

        protected java.io.Reader openExternalEntity​(IXMLReader xmlReader,
                                                    java.lang.String publicID,
                                                    java.lang.String systemID)
                                             throws XMLParseException
        Opens an external entity.
        Parameters:
        xmlReader - the current XML reader
        publicID - the public ID, which may be null
        systemID - the system ID
        Returns:
        the reader, or null if the reader could not be created/opened
        Throws:
        XMLParseException