Class BHTMLParser

java.lang.Object
net.bjmsw.hda.vs.bhtml.BHTMLParser

public class BHTMLParser extends Object
BHTMLParser class provides methods for parsing and replacing variables in BHTML content.

BHTML (bjmHTML): A simple HTML-like language that allows for variables to be replaced with their values.

Format: The BHTML content must start with the tag <!bhtml>. (This tag is removed during parsing) Variables are defined with curly braces: {VAR_NAME}

  • Constructor Details

    • BHTMLParser

      public BHTMLParser()
  • Method Details

    • parse

      public static String parse(String content, Map<String,String> variables)
      Replaces variables in BHTML content with their corresponding values.
      Parameters:
      content - the BHTML content to parse and replace variables
      variables - a map containing the variable name-value pairs
      Returns:
      the BHTML content with variables replaced by their values
    • parseFile

      public static String parseFile(String file, Map<String,String> variables)
      Parses a file and replaces variables in BHTML content with their corresponding values.
      Parameters:
      file - the path of the file to parse
      variables - a map containing the variable name-value pairs
      Returns:
      the BHTML content with variables replaced by their values, or null if an exception occurs