Interface LayoutParser

  • All Known Implementing Classes:
    AppLayoutParser, MSTRLayoutParser

    public interface LayoutParser
    The LayoutParser interface defines the methods that comprise a class that parses the layout definition (as a String) into an in-memory representation (in the form of a LayoutTag object instance.

    Note that in the context of the MicroStrategy style catalog a single instance of a layout parser is reused by multiple threads concurrently. As such, it should be thread-safe and not use instance data members (that vary from call to call).

    Since:
    MicroStrategy Web 8.0.0
    • Method Detail

      • getDescription

        java.lang.String getDescription()
        Gets the description of this layout parser object (to be read by someone wishing to use it). This description should include some reference to the type of special tags that understands.
        Returns:
        A textual description of this layout parser object.
      • parseLayout

        LayoutTag parseLayout​(java.lang.String layout,
                              java.lang.String location,
                              LayoutParser.MessageListener listener)
                       throws LayoutParsingException
        Deprecated.
        This method performs a parsing operation on a layout definition (supplied as a string). If the caller wants to be informed of warning and error conditions, he should create an instance of an object that implements the LayoutParser.MessageListener interface.
        Parameters:
        layout - The Layout Definition as a string.
        location - The source location for this layout. It is only used for diagnostic purposes. If omitted, then no source location is mentioned any error or warning messages.
        listener - An instance of a MessageListener object that the parser uses to indicate warning and error conditions.
        Returns:
        If successful, a LayoutTag that represents the Layout Definition in-memory.
        Throws:
        LayoutParsingException - If parsing fails (due to an error condition), this exception is raised.
      • parseLayout

        LayoutTag parseLayout​(java.lang.String layout,
                              java.lang.String location,
                              LayoutSource layoutSource,
                              LayoutParser.MessageListener listener)
                       throws LayoutParsingException
        This method sets the layoutSource object on the parser and performs a parsing operation on a layout definition (supplied as a string). If the caller wants to be informed of warning and error conditions, he should create an instance of an object that implements the LayoutParser.MessageListener interface.
        Parameters:
        layout - The Layout Definition as a string.
        location - The source location for this layout. It is only used for diagnostic purposes. If omitted, then no source location is mentioned any error or warning messages.
        listener - An instance of a MessageListener object that the parser uses to indicate warning and error conditions.
        layoutSource - The layout source is for loading the external file when "includeTag" is used
        Throws:
        LayoutParsingException
        Since:
        MicroStrategy Web 8.0.2