public class JSSource extends Object
Modifier and Type | Class and Description |
---|---|
class |
JSSource.PositionLocator
Encapsulates a position in the source file and provides methods to search for elements
starting from the start position, and to modify the source.
|
Modifier and Type | Method and Description |
---|---|
void |
appendAfterArrayLit(com.google.javascript.rhino.Node array,
String str)
Locates the array literal specified by the
array node, in the source using the
source location information provided by the node, and inserts str
in the source after the end of the array. |
void |
appendln(String str)
Appends the lines in the specified string to the current source.
|
String |
getModuleId()
Returns the module id specified in the constructor
|
void |
insert(String str,
int lineno,
int colno)
Inserts the specified string into the source at the specified location
|
JSSource.PositionLocator |
locate(int lineno,
int colno) |
String |
toString() |
public JSSource(String source, String mid) throws IOException
IOException
public void insert(String str, int lineno, int colno)
str
- the string to insertlineno
- the line number to insert tocolno
- the column number to insert topublic JSSource.PositionLocator locate(int lineno, int colno)
public void appendln(String str)
str
- public void appendAfterArrayLit(com.google.javascript.rhino.Node array, String str)
array
node, in the source using the
source location information provided by the node, and inserts str
in the source after the end of the array.array
- Node with source position informationstr
- the string to insert into the source at the end of the specified arraypublic String getModuleId()
Copyright © 2011-2015 IBM. All Rights Reserved.