public class JavaScriptSource
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
JavaScriptSource.Kind |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCode()
Returns the code.
|
int |
getColumnOffset()
Returns the column offset for the first line.
|
EventType |
getEventKind()
Returns the event kind, or null if not event handler code.
|
JavaScriptSource.Kind |
getKind()
Returns the kind.
|
int |
getLineOffset()
Returns the line offset for the first line.
|
static JavaScriptSource |
makeEmbeddedCode(java.lang.String code,
int lineOffset,
int columnOffset)
Constructs a new code snippet descriptor for JavaScript code embedded in a 'script' tag in an HTML file.
|
static JavaScriptSource |
makeEventHandlerCode(EventType kind,
java.lang.String code,
int lineOffset,
int columnOffset)
Constructs a new code snippet descriptor for JavaScript code embedded in an event handler attribute in an HTML file.
|
static JavaScriptSource |
makeFileCode(java.lang.String code)
Constructs a new code snippet descriptor for JavaScript code in a separate file.
|
public java.lang.String getCode()
public int getColumnOffset()
public EventType getEventKind()
public JavaScriptSource.Kind getKind()
public int getLineOffset()
public static JavaScriptSource makeEmbeddedCode(java.lang.String code, int lineOffset, int columnOffset)
code
- the JavaScript codelineOffset
- number of lines preceding the codecolumnOffset
- number of columns preceding the first line of the codepublic static JavaScriptSource makeEventHandlerCode(EventType kind, java.lang.String code, int lineOffset, int columnOffset)
kind
- event kind, e.g. "click" or "submit"code
- the JavaScript codelineOffset
- number of lines preceding the codecolumnOffset
- number of columns preceding the first line of the codepublic static JavaScriptSource makeFileCode(java.lang.String code)
Copyright © 2009-2019 Aarhus University