org.eclipse.wst.jsdt.core.util

## Class JsStringScanner

- java.lang.Object
- - org.eclipse.wst.jsdt.core.util.JsStringScanner

    public class JsStringScanner
    extends java.lang.Object

Scanner to parse JavaScript string as it is written in JavaSript source code like `"aaa\n"` or `'aaa\n"\ u{58}"'`. It's used in `StringLiteral` to convert JavaScript string into native Java String

Since:
  2.0

### Constructor Summary

Constructors
Constructor and Description
`JsStringScanner(java.lang.String source)` Create new Scanner

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `scan()` Scans JavaScript string set in the constructor or via `setSource(String)`
`void` `setSource(java.lang.String source)` Set JavaScript string to parse

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JsStringScanner

    public JsStringScanner(java.lang.String source)

Create new Scanner

Parameters:
  `source` - JavaScript string to scan

### Method Detail

#### setSource

    public void setSource(java.lang.String source)

Set JavaScript string to parse

Parameters:
  `source` - JavaScript string to scan

#### scan

    public java.lang.String scan()

Scans JavaScript string set in the constructor or via `setSource(String)`

Returns:
  literal representation of the scanned JavaScript string
Throws:
  `java.lang.IllegalArgumentException` - in case of parse error