Class PageTemplateXMLReader


  • public class PageTemplateXMLReader
    extends 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
    • Constructor Detail

      • PageTemplateXMLReader

        public PageTemplateXMLReader()
    • Method Detail

      • read

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

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

        public PageTemplateRegistry read​(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:
        RuntimeException - if directory is not a readable directory, or if there is some error in the XML