blob: 7d0926bdc2f7af2a214bf43680265521cda64b80 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_12) on Fri May 30 11:15:59 CDT 2008 -->
<TITLE>
ASTRewrite
</TITLE>
<META NAME="keywords" CONTENT="org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="ASTRewrite";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ASTRewrite.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ImportRewrite.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ASTRewrite.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.eclipse.wst.jsdt.core.dom.rewrite</FONT>
<BR>
Class ASTRewrite</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../../../resources/inherit.gif" ALT="extended by "><B>org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>ASTRewrite</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Infrastructure for modifying code by describing changes to AST nodes.
The AST rewriter collects descriptions of modifications to nodes and
translates these descriptions into text edits that can then be applied to
the original source. The key thing is that this is all done without actually
modifying the original AST, which has the virtue of allowing one to entertain
several alternate sets of changes on the same AST (e.g., for calculating
quick fix proposals). The rewrite infrastructure tries to generate minimal
text changes, preserve existing comments and indentation, and follow code
formatter settings. If the freedom to explore multiple alternate changes is
not required, consider using the AST's built-in rewriter
(see <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/JavaScriptUnit.html#rewrite(IDocument, java.util.Map)"><CODE>JavaScriptUnit.rewrite(IDocument, Map)</CODE></A>).
<p>
The following code snippet illustrated usage of this class:
</p>
<pre>
Document document = new Document("import java.util.List;\nclass X {}\n");
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(doc.get().toCharArray());
JavaScriptUnit cu = (JavaScriptUnit) parser.createAST(null);
AST ast = cu.getAST();
ImportDeclaration id = ast.newImportDeclaration();
id.setName(ast.newName(new String[] {"java", "util", "Set"}));
ASTRewrite rewriter = ASTRewrite.create(ast);
TypeDeclaration td = (TypeDeclaration) cu.types().get(0);
ITrackedNodePosition tdLocation = rewriter.track(td);
ListRewrite lrw = rewriter.getListRewrite(cu, JavaScriptUnit.IMPORTS_PROPERTY);
lrw.insertLast(id, null);
TextEdit edits = rewriter.rewriteAST(document, null);
UndoEdit undo = edits.apply(document);
assert "import java.util.List;\nimport java.util.Set;\nclass X {}".equals(doc.get().toCharArray());
// tdLocation.getStartPosition() and tdLocation.getLength()
// are new source range for "class X {}" in doc.get()
</pre>
<p>
This class is not intended to be subclassed.
</p>
Provisional API: This class/interface is part of an interim API that is still under development and expected to
change significantly before reaching stability. It is being made available at this early stage to solicit feedback
from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
(repeatedly) as the API evolves.
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite">ASTRewrite</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#create(org.eclipse.wst.jsdt.core.dom.AST)">create</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/AST.html" title="class in org.eclipse.wst.jsdt.core.dom">AST</A>&nbsp;ast)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new instance for describing manipulations of
the given AST.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createCopyTarget(org.eclipse.wst.jsdt.core.dom.ASTNode)">createCopyTarget</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a placeholder node for a true copy of the given node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createGroupNode(org.eclipse.wst.jsdt.core.dom.ASTNode[])">createGroupNode</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>[]&nbsp;targetNodes)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a node that represents a sequence of nodes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createMoveTarget(org.eclipse.wst.jsdt.core.dom.ASTNode)">createMoveTarget</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a placeholder node for the new locations of the given node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createStringPlaceholder(java.lang.String, int)">createStringPlaceholder</A></B>(java.lang.String&nbsp;code,
int&nbsp;nodeType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a placeholder node for a source string that is to be inserted into
the output document at the position corresponding to the placeholder.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#get(org.eclipse.wst.jsdt.core.dom.ASTNode, org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor)">get</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/StructuralPropertyDescriptor.html" title="class in org.eclipse.wst.jsdt.core.dom">StructuralPropertyDescriptor</A>&nbsp;property)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the value of the given property as managed by this rewriter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/AST.html" title="class in org.eclipse.wst.jsdt.core.dom">AST</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#getAST()">getAST</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the AST the rewrite was set up on.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/TargetSourceRangeComputer.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite">TargetSourceRangeComputer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#getExtendedSourceRangeComputer()">getExtendedSourceRangeComputer</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the extended source range computer for this AST rewriter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ListRewrite.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite">ListRewrite</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#getListRewrite(org.eclipse.wst.jsdt.core.dom.ASTNode, org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor)">getListRewrite</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ChildListPropertyDescriptor.html" title="class in org.eclipse.wst.jsdt.core.dom">ChildListPropertyDescriptor</A>&nbsp;property)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a new rewriter for describing modifications to the
given list property of the given node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#remove(org.eclipse.wst.jsdt.core.dom.ASTNode, TextEditGroup)">remove</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
TextEditGroup&nbsp;editGroup)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the given node from its parent in this rewriter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#replace(org.eclipse.wst.jsdt.core.dom.ASTNode, org.eclipse.wst.jsdt.core.dom.ASTNode, TextEditGroup)">replace</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;replacement,
TextEditGroup&nbsp;editGroup)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replaces the given node in this rewriter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;TextEdit</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#rewriteAST()">rewriteAST</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts all modifications recorded by this rewriter into an object representing the the corresponding text
edits to the source of a <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/ITypeRoot.html" title="interface in org.eclipse.wst.jsdt.core"><CODE>ITypeRoot</CODE></A> from which the AST was created from.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;TextEdit</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#rewriteAST(IDocument, java.util.Map)">rewriteAST</A></B>(IDocument&nbsp;document,
java.util.Map&nbsp;options)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts all modifications recorded by this rewriter
into an object representing the corresponding text
edits to the given document containing the original source
code.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#set(org.eclipse.wst.jsdt.core.dom.ASTNode, org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor, java.lang.Object, TextEditGroup)">set</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/StructuralPropertyDescriptor.html" title="class in org.eclipse.wst.jsdt.core.dom">StructuralPropertyDescriptor</A>&nbsp;property,
java.lang.Object&nbsp;value,
TextEditGroup&nbsp;editGroup)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the given property of the given node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#setTargetSourceRangeComputer(org.eclipse.wst.jsdt.core.dom.rewrite.TargetSourceRangeComputer)">setTargetSourceRangeComputer</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/TargetSourceRangeComputer.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite">TargetSourceRangeComputer</A>&nbsp;computer)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a custom target source range computer for this AST rewriter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#toString()">toString</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string suitable for debugging purposes (only).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ITrackedNodePosition.html" title="interface in org.eclipse.wst.jsdt.core.dom.rewrite">ITrackedNodePosition</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#track(org.eclipse.wst.jsdt.core.dom.ASTNode)">track</A></B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an object that tracks the source range of the given node
across the rewrite to its AST.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="create(org.eclipse.wst.jsdt.core.dom.AST)"><!-- --></A><H3>
create</H3>
<PRE>
public static <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite">ASTRewrite</A> <B>create</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/AST.html" title="class in org.eclipse.wst.jsdt.core.dom">AST</A>&nbsp;ast)</PRE>
<DL>
<DD>Creates a new instance for describing manipulations of
the given AST.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>ast</CODE> - the AST whose nodes will be rewritten
<DT><B>Returns:</B><DD>the new rewriter instance</DL>
</DD>
</DL>
<HR>
<A NAME="getAST()"><!-- --></A><H3>
getAST</H3>
<PRE>
public final <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/AST.html" title="class in org.eclipse.wst.jsdt.core.dom">AST</A> <B>getAST</B>()</PRE>
<DL>
<DD>Returns the AST the rewrite was set up on.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the AST the rewrite was set up on</DL>
</DD>
</DL>
<HR>
<A NAME="rewriteAST(IDocument, java.util.Map)"><!-- --></A><H3>
rewriteAST</H3>
<PRE>
public TextEdit <B>rewriteAST</B>(IDocument&nbsp;document,
java.util.Map&nbsp;options)
throws java.lang.IllegalArgumentException</PRE>
<DL>
<DD>Converts all modifications recorded by this rewriter
into an object representing the corresponding text
edits to the given document containing the original source
code. The document itself is not modified.
<p>
For nodes in the original that are being replaced or deleted,
this rewriter computes the adjusted source ranges
by calling <code>getTargetSourceRangeComputer().computeSourceRange(node)</code>.
</p>
<p>
Calling this methods does not discard the modifications
on record. Subsequence modifications are added to the ones
already on record. If this method is called again later,
the resulting text edit object will accurately reflect
the net cumulative affect of all those changes.
</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>document</CODE> - original document containing source code<DD><CODE>options</CODE> - the table of formatter options
(key type: <code>String</code>; value type: <code>String</code>);
or <code>null</code> to use the standard global options
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#getOptions()"><CODE>org.eclipse.wst.jsdt.core.JavaScriptCore.getOptions()</CODE></A>
<DT><B>Returns:</B><DD>text edit object describing the changes to the
document corresponding to the changes recorded by this rewriter
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - An <code>IllegalArgumentException</code>
is thrown if the document passed does not correspond to the AST that is rewritten.</DL>
</DD>
</DL>
<HR>
<A NAME="rewriteAST()"><!-- --></A><H3>
rewriteAST</H3>
<PRE>
public TextEdit <B>rewriteAST</B>()
throws <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/JavaScriptModelException.html" title="class in org.eclipse.wst.jsdt.core">JavaScriptModelException</A>,
java.lang.IllegalArgumentException</PRE>
<DL>
<DD>Converts all modifications recorded by this rewriter into an object representing the the corresponding text
edits to the source of a <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/ITypeRoot.html" title="interface in org.eclipse.wst.jsdt.core"><CODE>ITypeRoot</CODE></A> from which the AST was created from.
The type root's source itself is not modified by this method call.
<p>
Important: This API can only be used if the modified AST has been created from a
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/ITypeRoot.html" title="interface in org.eclipse.wst.jsdt.core"><CODE>ITypeRoot</CODE></A> with source. That means <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTParser.html#setSource(org.eclipse.wst.jsdt.core.IJavaScriptUnit)"><CODE>ASTParser.setSource(org.eclipse.wst.jsdt.core.IJavaScriptUnit)</CODE></A>,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTParser.html#setSource(org.eclipse.wst.jsdt.core.IClassFile)"><CODE>ASTParser.setSource(org.eclipse.wst.jsdt.core.IClassFile)</CODE></A> or <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTParser.html#setSource(org.eclipse.wst.jsdt.core.ITypeRoot)"><CODE>ASTParser.setSource(ITypeRoot)</CODE></A>
has been used when initializing the <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTParser.html" title="class in org.eclipse.wst.jsdt.core.dom"><CODE>ASTParser</CODE></A>. A <CODE>IllegalArgumentException</CODE> is thrown
otherwise. An <CODE>IllegalArgumentException</CODE> is also thrown when the type roots buffer does not correspond
anymore to the AST. Use <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#rewriteAST(IDocument, java.util.Map)"><CODE>rewriteAST(IDocument, Map)</CODE></A> for all ASTs created from other content.
</p>
<p>
For nodes in the original that are being replaced or deleted,
this rewriter computes the adjusted source ranges
by calling <code>getTargetSourceRangeComputer().computeSourceRange(node)</code>.
</p>
<p>
Calling this methods does not discard the modifications
on record. Subsequence modifications are added to the ones
already on record. If this method is called again later,
the resulting text edit object will accurately reflect
the net cumulative affect of all those changes.
</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>text edit object describing the changes to the
document corresponding to the changes recorded by this rewriter
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../../org/eclipse/wst/jsdt/core/JavaScriptModelException.html" title="class in org.eclipse.wst.jsdt.core">JavaScriptModelException</A></CODE> - A <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/JavaScriptModelException.html" title="class in org.eclipse.wst.jsdt.core"><CODE>JavaScriptModelException</CODE></A> is thrown when
the underlying javaScript units buffer could not be accessed.
<DD><CODE>java.lang.IllegalArgumentException</CODE> - An <CODE>IllegalArgumentException</CODE>
is thrown if the document passed does not correspond to the AST that is rewritten.</DL>
</DD>
</DL>
<HR>
<A NAME="remove(org.eclipse.wst.jsdt.core.dom.ASTNode, TextEditGroup)"><!-- --></A><H3>
remove</H3>
<PRE>
public final void <B>remove</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
TextEditGroup&nbsp;editGroup)</PRE>
<DL>
<DD>Removes the given node from its parent in this rewriter. The AST itself
is not actually modified in any way; rather, the rewriter just records
a note that this node should not be there.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the node being removed<DD><CODE>editGroup</CODE> - the edit group in which to collect the corresponding
text edits, or <code>null</code> if ungrouped
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the node is null, or if the node is not
part of this rewriter's AST, or if the described modification is invalid
(such as removing a required node)</DL>
</DD>
</DL>
<HR>
<A NAME="replace(org.eclipse.wst.jsdt.core.dom.ASTNode, org.eclipse.wst.jsdt.core.dom.ASTNode, TextEditGroup)"><!-- --></A><H3>
replace</H3>
<PRE>
public final void <B>replace</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;replacement,
TextEditGroup&nbsp;editGroup)</PRE>
<DL>
<DD>Replaces the given node in this rewriter. The replacement node
must either be brand new (not part of the original AST) or a placeholder
node (for example, one created by <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createCopyTarget(org.eclipse.wst.jsdt.core.dom.ASTNode)"><CODE>createCopyTarget(ASTNode)</CODE></A>
or <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createStringPlaceholder(java.lang.String, int)"><CODE>createStringPlaceholder(String, int)</CODE></A>). The AST itself
is not actually modified in any way; rather, the rewriter just records
a note that this node has been replaced.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the node being replaced<DD><CODE>replacement</CODE> - the replacement node, or <code>null</code> if no
replacement<DD><CODE>editGroup</CODE> - the edit group in which to collect the corresponding
text edits, or <code>null</code> if ungrouped
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the node is null, or if the node is not part
of this rewriter's AST, or if the replacement node is not a new node (or
placeholder), or if the described modification is otherwise invalid</DL>
</DD>
</DL>
<HR>
<A NAME="set(org.eclipse.wst.jsdt.core.dom.ASTNode, org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor, java.lang.Object, TextEditGroup)"><!-- --></A><H3>
set</H3>
<PRE>
public final void <B>set</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/StructuralPropertyDescriptor.html" title="class in org.eclipse.wst.jsdt.core.dom">StructuralPropertyDescriptor</A>&nbsp;property,
java.lang.Object&nbsp;value,
TextEditGroup&nbsp;editGroup)</PRE>
<DL>
<DD>Sets the given property of the given node. If the given property is a child
property, the value must be a replacement node that is either be brand new
(not part of the original AST) or a placeholder node (for example, one
created by <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createCopyTarget(org.eclipse.wst.jsdt.core.dom.ASTNode)"><CODE>createCopyTarget(ASTNode)</CODE></A>
or <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createStringPlaceholder(java.lang.String, int)"><CODE>createStringPlaceholder(String, int)</CODE></A>); or it must be
<code>null</code>, indicating that the child should be deleted.
If the given property is a simple property, the value must be the new
value (primitive types must be boxed) or <code>null</code>.
The AST itself is not actually modified in any way; rather, the rewriter
just records a note that this node has been changed in the specified way.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the node<DD><CODE>property</CODE> - the node's property; either a simple property or a child property<DD><CODE>value</CODE> - the replacement child or new value, or <code>null</code> if none<DD><CODE>editGroup</CODE> - the edit group in which to collect the corresponding
text edits, or <code>null</code> if ungrouped
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the node or property is null, or if the node
is not part of this rewriter's AST, or if the property is not a node property,
or if the described modification is invalid</DL>
</DD>
</DL>
<HR>
<A NAME="get(org.eclipse.wst.jsdt.core.dom.ASTNode, org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor)"><!-- --></A><H3>
get</H3>
<PRE>
public java.lang.Object <B>get</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/StructuralPropertyDescriptor.html" title="class in org.eclipse.wst.jsdt.core.dom">StructuralPropertyDescriptor</A>&nbsp;property)</PRE>
<DL>
<DD>Returns the value of the given property as managed by this rewriter. If the property
has been removed, <code>null</code> is returned. If it has been replaced, the replacing value
is returned. If the property has not been changed yet, the original value is returned.
<p>
For child list properties use <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ListRewrite.html#getRewrittenList()"><CODE>ListRewrite.getRewrittenList()</CODE></A> to get access to the
rewritten nodes in a list. </p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the node<DD><CODE>property</CODE> - the node's property
<DT><B>Returns:</B><DD>the value of the given property as managed by this rewriter</DL>
</DD>
</DL>
<HR>
<A NAME="getListRewrite(org.eclipse.wst.jsdt.core.dom.ASTNode, org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor)"><!-- --></A><H3>
getListRewrite</H3>
<PRE>
public final <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ListRewrite.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite">ListRewrite</A> <B>getListRewrite</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node,
<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ChildListPropertyDescriptor.html" title="class in org.eclipse.wst.jsdt.core.dom">ChildListPropertyDescriptor</A>&nbsp;property)</PRE>
<DL>
<DD>Creates and returns a new rewriter for describing modifications to the
given list property of the given node.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the node<DD><CODE>property</CODE> - the node's property; the child list property
<DT><B>Returns:</B><DD>a new list rewriter object
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the node or property is null, or if the node
is not part of this rewriter's AST, or if the property is not a node property,
or if the described modification is invalid</DL>
</DD>
</DL>
<HR>
<A NAME="track(org.eclipse.wst.jsdt.core.dom.ASTNode)"><!-- --></A><H3>
track</H3>
<PRE>
public final <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ITrackedNodePosition.html" title="interface in org.eclipse.wst.jsdt.core.dom.rewrite">ITrackedNodePosition</A> <B>track</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node)</PRE>
<DL>
<DD>Returns an object that tracks the source range of the given node
across the rewrite to its AST. Upon return, the result object reflects
the given node's current source range in the AST. After
<code>rewrite</code> is called, the result object is updated to
reflect the given node's source range in the rewritten AST.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the node to track
<DT><B>Returns:</B><DD>an object that tracks the source range of <code>node</code>
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the node is null, or if the node
is not part of this rewriter's AST, or if the node is already being
tracked</DL>
</DD>
</DL>
<HR>
<A NAME="createStringPlaceholder(java.lang.String, int)"><!-- --></A><H3>
createStringPlaceholder</H3>
<PRE>
public final <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A> <B>createStringPlaceholder</B>(java.lang.String&nbsp;code,
int&nbsp;nodeType)</PRE>
<DL>
<DD>Creates and returns a placeholder node for a source string that is to be inserted into
the output document at the position corresponding to the placeholder.
The string will be inserted without being reformatted beyond correcting
the indentation level. The placeholder node can either be inserted as new or
used to replace an existing node.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>code</CODE> - the string to be inserted; lines should should not have extra indentation<DD><CODE>nodeType</CODE> - the ASTNode type that corresponds to the passed code.
<DT><B>Returns:</B><DD>the new placeholder node
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the code is null, or if the node
type is invalid</DL>
</DD>
</DL>
<HR>
<A NAME="createGroupNode(org.eclipse.wst.jsdt.core.dom.ASTNode[])"><!-- --></A><H3>
createGroupNode</H3>
<PRE>
public final <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A> <B>createGroupNode</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>[]&nbsp;targetNodes)</PRE>
<DL>
<DD>Creates and returns a node that represents a sequence of nodes.
Each of the given nodes must be either be brand new (not part of the original AST), or
a placeholder node (for example, one created by <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createCopyTarget(org.eclipse.wst.jsdt.core.dom.ASTNode)"><CODE>createCopyTarget(ASTNode)</CODE></A>
or <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html#createStringPlaceholder(java.lang.String, int)"><CODE>createStringPlaceholder(String, int)</CODE></A>), or another group node.
The type of the returned node is unspecified. The returned node can be used
to replace an existing node (or as an element of another group node).
When the document is rewritten, the source code for each of the given nodes is
inserted, in order, into the output document at the position corresponding to the
group (indentation is adjusted).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>targetNodes</CODE> - the nodes to go in the group
<DT><B>Returns:</B><DD>the new group node
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the targetNodes is <code>null</code> or empty</DL>
</DD>
</DL>
<HR>
<A NAME="createCopyTarget(org.eclipse.wst.jsdt.core.dom.ASTNode)"><!-- --></A><H3>
createCopyTarget</H3>
<PRE>
public final <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A> <B>createCopyTarget</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node)</PRE>
<DL>
<DD>Creates and returns a placeholder node for a true copy of the given node.
The placeholder node can either be inserted as new or used to replace an
existing node. When the document is rewritten, a copy of the source code
for the given node is inserted into the output document at the position
corresponding to the placeholder (indentation is adjusted).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the node to create a copy placeholder for
<DT><B>Returns:</B><DD>the new placeholder node
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the node is null, or if the node
is not part of this rewriter's AST</DL>
</DD>
</DL>
<HR>
<A NAME="createMoveTarget(org.eclipse.wst.jsdt.core.dom.ASTNode)"><!-- --></A><H3>
createMoveTarget</H3>
<PRE>
public final <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A> <B>createMoveTarget</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/ASTNode.html" title="class in org.eclipse.wst.jsdt.core.dom">ASTNode</A>&nbsp;node)</PRE>
<DL>
<DD>Creates and returns a placeholder node for the new locations of the given node.
After obtaining a placeholder, the node should then to be removed or replaced.
The placeholder node can either be inserted as new or used to replace an
existing node. When the document is rewritten, the source code for the given
node is inserted into the output document at the position corresponding to the
placeholder (indentation is adjusted).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the node to create a move placeholder for
<DT><B>Returns:</B><DD>the new placeholder node
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the node is null, or if the node
is not part of this rewriter's AST</DL>
</DD>
</DL>
<HR>
<A NAME="getExtendedSourceRangeComputer()"><!-- --></A><H3>
getExtendedSourceRangeComputer</H3>
<PRE>
public final <A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/TargetSourceRangeComputer.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite">TargetSourceRangeComputer</A> <B>getExtendedSourceRangeComputer</B>()</PRE>
<DL>
<DD>Returns the extended source range computer for this AST rewriter.
The default value is a <code>new TargetSourceRangeComputer()</code>.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>an extended source range computer</DL>
</DD>
</DL>
<HR>
<A NAME="setTargetSourceRangeComputer(org.eclipse.wst.jsdt.core.dom.rewrite.TargetSourceRangeComputer)"><!-- --></A><H3>
setTargetSourceRangeComputer</H3>
<PRE>
public final void <B>setTargetSourceRangeComputer</B>(<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/TargetSourceRangeComputer.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite">TargetSourceRangeComputer</A>&nbsp;computer)</PRE>
<DL>
<DD>Sets a custom target source range computer for this AST rewriter. This is advanced feature to modify how
comments are associated with nodes, which should be done only in special cases.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>computer</CODE> - a target source range computer,
or <code>null</code> to restore the default value of
<code>new TargetSourceRangeComputer()</code></DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD>Returns a string suitable for debugging purposes (only).
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a debug string</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ASTRewrite.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../../../../org/eclipse/wst/jsdt/core/dom/rewrite/ImportRewrite.html" title="class in org.eclipse.wst.jsdt.core.dom.rewrite"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ASTRewrite.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>