Interface Parser

    • Method Detail

      • parse

        void parse​(java.io.Reader source,
                   org.apache.maven.doxia.sink.Sink sink)
            throws ParseException
        Parses the given source model and emits Doxia events into the given sink. Shortcut for parse(Reader, Sink, String) with last argument being null.
        Parameters:
        source - not null reader that provides the source document. You could use newReader methods from ReaderFactory.
        sink - A sink that consumes the Doxia events.
        Throws:
        ParseException - if the model could not be parsed.
      • parse

        void parse​(java.io.Reader source,
                   org.apache.maven.doxia.sink.Sink sink,
                   java.lang.String reference)
            throws ParseException
        Parses the given source model and emits Doxia events into the given sink.
        Parameters:
        source - not null reader that provides the source document. You could use newReader methods from ReaderFactory.
        sink - A sink that consumes the Doxia events.
        reference - a string identifying the source (for file based documents the source file path)
        Throws:
        ParseException - if the model could not be parsed.
      • setEmitComments

        void setEmitComments​(boolean emitComments)
        When comments are found in source markup, emit comment Doxia events or just ignore?
        Parameters:
        emitComments - true (default value) to emit comment Doxia events
      • isEmitComments

        boolean isEmitComments()
        Does the parser emit Doxia comments event when comments found in source?
        Returns:
        true (default value) if comment Doxia events are emitted
      • addSinkWrapperFactory

        void addSinkWrapperFactory​(SinkWrapperFactory factory)
        Registers a given SinkWrapperFactory with the parser used in subsequent calls of parse(...)
        Parameters:
        factory - the factory to create the sink wrapper
        Since:
        2.0.0
      • setEmitAnchorsForIndexableEntries

        void setEmitAnchorsForIndexableEntries​(boolean emitAnchors)
        Determines whether to automatically generate anchors for each index entry found by IndexingSink or not. By default no anchors are generated.
        Parameters:
        emitAnchors - true to emit anchors otherwise false (the default)
        Since:
        2.0.0
      • isEmitAnchorsForIndexableEntries

        boolean isEmitAnchorsForIndexableEntries()
        Returns whether anchors are automatically generated for each index entry found by IndexingSink or not.
        Returns:
        true if anchors are emitted otherwise false
        Since:
        2.0.0