Class MarkupEngine

    • Constructor Summary

      Constructors 
      Constructor Description
      MarkupEngine()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> parse​(org.apache.commons.configuration2.Configuration config, java.io.File file, java.lang.String contentPath)  
      DocumentModel parse​(JBakeConfiguration config, java.io.File file)
      Parse given file to extract as much infos as possible
      void processBody​(ParserContext context)
      Processes the body of the document.
      void processHeader​(ParserContext context)
      Processes the document header.
      boolean validate​(ParserContext context)
      Tests if this markup engine can process the document.
      • Methods inherited from class java.lang.Object

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

      • MarkupEngine

        public MarkupEngine()
    • Method Detail

      • validate

        public boolean validate​(ParserContext context)
        Tests if this markup engine can process the document.
        Parameters:
        context - the parser context
        Returns:
        true if this markup engine has enough context to process this document. false otherwise
      • processHeader

        public void processHeader​(ParserContext context)
        Processes the document header. Usually subclasses will parse the document body and look for specific header metadata and export it into contents map.
        Parameters:
        context - the parser context
      • processBody

        public void processBody​(ParserContext context)
        Processes the body of the document. Usually subclasses will parse the document body and render it, exporting the result using the ParserContext.setBody(String) method.
        Parameters:
        context - the parser context
      • parse

        public java.util.Map<java.lang.String,​java.lang.Object> parse​(org.apache.commons.configuration2.Configuration config,
                                                                            java.io.File file,
                                                                            java.lang.String contentPath)
        Specified by:
        parse in interface ParserEngine
        Parameters:
        config - The project configuration
        file - The file to be parsed
        contentPath - unknown
        Returns:
        A model representation of the given file
      • parse

        public DocumentModel parse​(JBakeConfiguration config,
                                   java.io.File file)
        Parse given file to extract as much infos as possible
        Specified by:
        parse in interface ParserEngine
        Parameters:
        file - file to process
        config - The project configuration
        Returns:
        a map containing all infos. Returning null indicates an error, even if an exception would be better.