Module tvbrowser

Class ParamParser


  • public class ParamParser
    extends java.lang.Object
    The ParamParser analyzes a String and calls a ParamLibrary for each Key/Function it finds. This System is easily extendible. For an example look into the CapturePlugin code
    Author:
    bodum
    • Constructor Summary

      Constructors 
      Constructor Description
      ParamParser()
      Create a ParamParser with the default ParamLibrary
      ParamParser​(ParamLibrary lib)
      Create a ParamParser with a specific Library
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String analyse​(java.lang.String command, Program prg)
      Analyze a String and return the parsed String.
      java.lang.String getErrorString()
      The Error-String for Details about an Error
      ParamLibrary getParamLibrary()
      The used ParamLibrary
      boolean hasErrors()
      Returns True if an error occurred
      void setParamLibrary​(ParamLibrary lib)
      Set the ParamLibrary that this Parser uses
      boolean showErrors()
      show the parser error(s), if there were errors during parsing
      boolean showErrors​(java.awt.Window parent)
      show the parser error(s), if there were errors during parsing
      • Methods inherited from class java.lang.Object

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

      • ParamParser

        public ParamParser()
        Create a ParamParser with the default ParamLibrary
      • ParamParser

        public ParamParser​(ParamLibrary lib)
        Create a ParamParser with a specific Library
        Parameters:
        lib - ParamLibrary to use
    • Method Detail

      • hasErrors

        public boolean hasErrors()
        Returns True if an error occurred
        Returns:
        True if Error
      • getErrorString

        public java.lang.String getErrorString()
        The Error-String for Details about an Error
        Returns:
        Error-String
      • getParamLibrary

        public ParamLibrary getParamLibrary()
        The used ParamLibrary
        Returns:
        ParamLibrary used in this Parser
      • setParamLibrary

        public void setParamLibrary​(ParamLibrary lib)
        Set the ParamLibrary that this Parser uses
        Parameters:
        lib - ParamLibrary to use
      • analyse

        public java.lang.String analyse​(java.lang.String command,
                                        Program prg)
        Analyze a String and return the parsed String. If an error occurred, the return value is null.
        Parameters:
        command - String to parse
        prg - Program to use while parsing
        Returns:
        parsed String, null if an error occurred
      • showErrors

        public boolean showErrors​(java.awt.Window parent)
        show the parser error(s), if there were errors during parsing
        Parameters:
        parent - parent window
        Returns:
        true, if an error exists in the parser, false otherwise
        Since:
        3.0
      • showErrors

        public boolean showErrors()
        show the parser error(s), if there were errors during parsing
        Returns:
        true, if an error exists in the parser, false otherwise
        Since:
        3.0