java.lang.Object
org.jdrupes.mdoclet.internal.doclets.formats.html.markup.Script

public class Script extends Object
A builder for HTML script elements.
  • Konstruktordetails

    • Script

      public Script()
      Creates an empty script.
    • Script

      public Script(String code)
      Creates a new script containing the specified code.
      Parameter:
      code - the code
  • Methodendetails

    • append

      public Script append(CharSequence code)
      Appends the given code to the script.
      Parameter:
      code - the code
      Gibt zurück:
      this object
    • appendStringLiteral

      Appends the given text as a string constant to the string.

      Characters within the string will be escaped as needed.

      Parameter:
      text - the text
      Gibt zurück:
      this object
    • appendStringLiteral

      public Script appendStringLiteral(CharSequence text, char quoteChar)
      Appends the given text as a string constant to the string.

      Characters within the string will be escaped as needed.

      Parameter:
      text - the text
      quoteChar - the quote character to use
      Gibt zurück:
      this object
    • asContent

      public Content asContent()
      Returns a “live” view of the script as a Content object.

      Any later modifications to the script will be reflected in the object that is returned.

      Gibt zurück:
      the script
    • stringLiteral

      public static String stringLiteral(CharSequence s)
      Returns a JavaScript string literal containing a specified string, escaping the characters of that string as needed.
      Parameter:
      s - the string
      Gibt zurück:
      a string literal containing the string
    • stringLiteral

      public static String stringLiteral(CharSequence s, char quoteChar)
      Returns a JavaScript string literal containing a specified string, escaping the characters of that string as needed.
      Parameter:
      s - the string
      quoteChar - the quote character to use for the literal
      Gibt zurück:
      a string literal containing the string