Class JavaScriptExtractor


  • public final class JavaScriptExtractor
    extends java.lang.Object
    Utility class for extracting functions from JavaScript code.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String matchToClosingBrace​(java.lang.String jsCode, java.lang.String start)
      Searches the given JavaScript code for the identifier of a function and returns its body.
      • Methods inherited from class java.lang.Object

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

      • matchToClosingBrace

        @Nonnull
        public static java.lang.String matchToClosingBrace​(java.lang.String jsCode,
                                                           java.lang.String start)
                                                    throws ParsingException
        Searches the given JavaScript code for the identifier of a function and returns its body.
        Parameters:
        jsCode - JavaScript code
        start - start of the function (without the opening brace)
        Returns:
        extracted code (opening brace + function + closing brace)
        Throws:
        ParsingException