Package jmri.jmrit

Class XmlFileValidateAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
    Direct Known Subclasses:
    XmlFileValidateRunner

    public class XmlFileValidateAction
    extends JmriAbstractAction
    Make sure an XML file is readable, and validates OK against its schema and DTD.

    Can also be run from the command line as apps.jmrit.XmlFileValidationAction (e.g. ./runtest.csh apps/jmrit/XmlFileValidateAction foo.xml) in which case if there's a filename argument, it checks that directly, otherwise it pops a file selection dialog. (The dialog form has to be manually canceled when done)

    See Also:
    XmlFile, XmlFileCheckAction, Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • Fields inherited from interface javax.swing.Action

        ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)  
      JmriPanel makePanel()  
      protected void processFile​(java.io.File file)  
      (package private) void readFile​(java.io.File file)
      Read and verify a file is schema valid XML.
      protected void showFailResults​(java.awt.Component who, java.lang.String fileName, java.lang.String text)  
      protected void showOkResults​(java.awt.Component who, java.lang.String text)  
      • Methods inherited from class javax.swing.AbstractAction

        addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.swing.Action

        accept
    • Method Detail

      • processFile

        protected void processFile​(java.io.File file)
      • showOkResults

        protected void showOkResults​(java.awt.Component who,
                                     java.lang.String text)
      • showFailResults

        protected void showFailResults​(java.awt.Component who,
                                       java.lang.String fileName,
                                       java.lang.String text)
      • readFile

        void readFile​(java.io.File file)
               throws org.jdom2.JDOMException,
                      java.io.IOException
        Read and verify a file is schema valid XML.
        Parameters:
        file - the file to read
        Throws:
        org.jdom2.JDOMException - if file is not schema valid XML
        java.io.IOException - if unable to read file