Class PageTemplateXMLReader


  • public class PageTemplateXMLReader
    extends java.lang.Object
    Reads all page template XML files from a given directory (or list of readers). Instances of this are for single-thread usage only.
    Author:
    bratseth
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PageTemplateRegistry read​(java.lang.String directory)
      Reads all page template xml files in a given directory.
      PageTemplateRegistry read​(java.util.List<com.yahoo.io.reader.NamedReader> pageReaders, boolean validateReaderNames)
      Reads all page template xml files in a given list of readers.
      PageTemplate readFile​(java.lang.String fileName)
      Reads a single page template file.
      • Methods inherited from class java.lang.Object

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

      • PageTemplateXMLReader

        public PageTemplateXMLReader()
    • Method Detail

      • read

        public PageTemplateRegistry read​(java.lang.String directory)
        Reads all page template xml files in a given directory.
        Throws:
        java.lang.RuntimeException - if directory is not a readable directory, or if there is some error in the XML
      • readFile

        public PageTemplate readFile​(java.lang.String fileName)
        Reads a single page template file.
        Throws:
        java.lang.RuntimeException - if fileName is not a readable file, or if there is some error in the XML
      • read

        public PageTemplateRegistry read​(java.util.List<com.yahoo.io.reader.NamedReader> pageReaders,
                                         boolean validateReaderNames)
        Reads all page template xml files in a given list of readers. This is called from the Vespa configuration model.
        Parameters:
        validateReaderNames - should be set to true if the readers were created by files, not otherwise
        Throws:
        java.lang.RuntimeException - if directory is not a readable directory, or if there is some error in the XML