blob: 185634e36dc491af8394794f438c17f87703d7d8 [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:50 CDT 2008 -->
<TITLE>
ToolFactory
</TITLE>
<META NAME="keywords" CONTENT="org.eclipse.wst.jsdt.core.ToolFactory class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="ToolFactory";
}
</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/ToolFactory.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;<A HREF="../../../../../org/eclipse/wst/jsdt/core/Signature.html" title="class in org.eclipse.wst.jsdt.core"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/eclipse/wst/jsdt/core/UnimplementedException.html" title="class in org.eclipse.wst.jsdt.core"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/eclipse/wst/jsdt/core/ToolFactory.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ToolFactory.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;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&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</FONT>
<BR>
Class ToolFactory</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.eclipse.wst.jsdt.core.ToolFactory</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>ToolFactory</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Factory for creating various compiler tools, such as scanners, parsers and compilers.
<p>
This class provides static methods only; it is not intended to be instantiated or subclassed by clients.
</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>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_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>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#M_FORMAT_EXISTING">M_FORMAT_EXISTING</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This mode is used for formatting existing code when all formatter options should be used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#M_FORMAT_NEW">M_FORMAT_NEW</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This mode is used for formatting new code when some formatter options should not be used.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_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>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#ToolFactory()">ToolFactory</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== 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/formatter/CodeFormatter.html" title="class in org.eclipse.wst.jsdt.core.formatter">CodeFormatter</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#createCodeFormatter(java.util.Map)">createCodeFormatter</A></B>(java.util.Map&nbsp;options)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create an instance of the built-in code formatter.</TD>
</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/formatter/CodeFormatter.html" title="class in org.eclipse.wst.jsdt.core.formatter">CodeFormatter</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#createCodeFormatter(java.util.Map, int)">createCodeFormatter</A></B>(java.util.Map&nbsp;options,
int&nbsp;mode)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create an instance of the built-in code formatter.</TD>
</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/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler">IScanner</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#createScanner(boolean, boolean, boolean, boolean)">createScanner</A></B>(boolean&nbsp;tokenizeComments,
boolean&nbsp;tokenizeWhiteSpace,
boolean&nbsp;assertMode,
boolean&nbsp;recordLineSeparator)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a scanner, indicating the level of detail requested for tokenizing.</TD>
</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/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler">IScanner</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#createScanner(boolean, boolean, boolean, java.lang.String)">createScanner</A></B>(boolean&nbsp;tokenizeComments,
boolean&nbsp;tokenizeWhiteSpace,
boolean&nbsp;recordLineSeparator,
java.lang.String&nbsp;sourceLevel)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a scanner, indicating the level of detail requested for tokenizing.</TD>
</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/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler">IScanner</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#createScanner(boolean, boolean, boolean, java.lang.String, java.lang.String)">createScanner</A></B>(boolean&nbsp;tokenizeComments,
boolean&nbsp;tokenizeWhiteSpace,
boolean&nbsp;recordLineSeparator,
java.lang.String&nbsp;sourceLevel,
java.lang.String&nbsp;complianceLevel)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a scanner, indicating the level of detail requested for tokenizing.</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, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_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>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="M_FORMAT_NEW"><!-- --></A><H3>
M_FORMAT_NEW</H3>
<PRE>
public static final int <B>M_FORMAT_NEW</B></PRE>
<DL>
<DD>This mode is used for formatting new code when some formatter options should not be used.
In particular, options that preserve the indentation of comments are not used.
In the future, newly added options may be ignored as well.
<p>Clients that are formatting new code are recommended to use this mode.
</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/wst/jsdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN"><CODE>DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN</CODE></A>,
<A HREF="../../../../../org/eclipse/wst/jsdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN"><CODE>DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN</CODE></A>,
<A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#createCodeFormatter(java.util.Map, int)"><CODE>createCodeFormatter(Map, int)</CODE></A></DL>
</DL>
<HR>
<A NAME="M_FORMAT_EXISTING"><!-- --></A><H3>
M_FORMAT_EXISTING</H3>
<PRE>
public static final int <B>M_FORMAT_EXISTING</B></PRE>
<DL>
<DD>This mode is used for formatting existing code when all formatter options should be used.
In particular, options that preserve the indentation of comments are used.
<p>Clients that are formatting existing code are recommended to use this mode.
</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/wst/jsdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN"><CODE>DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN</CODE></A>,
<A HREF="../../../../../org/eclipse/wst/jsdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN"><CODE>DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN</CODE></A>,
<A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#createCodeFormatter(java.util.Map, int)"><CODE>createCodeFormatter(Map, int)</CODE></A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_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>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="ToolFactory()"><!-- --></A><H3>
ToolFactory</H3>
<PRE>
public <B>ToolFactory</B>()</PRE>
<DL>
</DL>
<!-- ============ 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="createCodeFormatter(java.util.Map)"><!-- --></A><H3>
createCodeFormatter</H3>
<PRE>
public static <A HREF="../../../../../org/eclipse/wst/jsdt/core/formatter/CodeFormatter.html" title="class in org.eclipse.wst.jsdt.core.formatter">CodeFormatter</A> <B>createCodeFormatter</B>(java.util.Map&nbsp;options)</PRE>
<DL>
<DD>Create an instance of the built-in code formatter.
<p>The given options should at least provide the source level (<A HREF="../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#COMPILER_SOURCE"><CODE>JavaScriptCore.COMPILER_SOURCE</CODE></A>),
the compiler compliance level (<A HREF="../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#COMPILER_COMPLIANCE"><CODE>JavaScriptCore.COMPILER_COMPLIANCE</CODE></A>) and the target platform
(<A HREF="../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#COMPILER_CODEGEN_TARGET_PLATFORM"><CODE>JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM</CODE></A>).
Without these options, it is not possible for the code formatter to know what kind of source it needs to format.
</p><p>
Note this is equivalent to <code>createCodeFormatter(options, M_FORMAT_NEW)</code>. Thus some code formatter options
may be ignored. See @{link <A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#M_FORMAT_NEW"><CODE>M_FORMAT_NEW</CODE></A> for more details.
</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>options</CODE> - - the options map to use for formatting with the default code formatter. Recognized options
are documented on <code>JavaScriptCore#getDefaultOptions()</code>. If set to <code>null</code>, then use
the current settings from <code>JavaScriptCore#getOptions</code>.
<DT><B>Returns:</B><DD>an instance of the built-in code formatter<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/wst/jsdt/core/formatter/CodeFormatter.html" title="class in org.eclipse.wst.jsdt.core.formatter"><CODE>CodeFormatter</CODE></A>,
<A HREF="../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#getOptions()"><CODE>JavaScriptCore.getOptions()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="createCodeFormatter(java.util.Map, int)"><!-- --></A><H3>
createCodeFormatter</H3>
<PRE>
public static <A HREF="../../../../../org/eclipse/wst/jsdt/core/formatter/CodeFormatter.html" title="class in org.eclipse.wst.jsdt.core.formatter">CodeFormatter</A> <B>createCodeFormatter</B>(java.util.Map&nbsp;options,
int&nbsp;mode)</PRE>
<DL>
<DD>Create an instance of the built-in code formatter.
<p>The given options should at least provide the source level (<A HREF="../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#COMPILER_SOURCE"><CODE>JavaScriptCore.COMPILER_SOURCE</CODE></A>),
the compiler compliance level (<A HREF="../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#COMPILER_COMPLIANCE"><CODE>JavaScriptCore.COMPILER_COMPLIANCE</CODE></A>) and the target platform
(<A HREF="../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#COMPILER_CODEGEN_TARGET_PLATFORM"><CODE>JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM</CODE></A>).
Without these options, it is not possible for the code formatter to know what kind of source it needs to format.
</p>
<p>The given mode determines what options should be enabled when formatting the code. It can have the following
values: <A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#M_FORMAT_NEW"><CODE>M_FORMAT_NEW</CODE></A>, <A HREF="../../../../../org/eclipse/wst/jsdt/core/ToolFactory.html#M_FORMAT_EXISTING"><CODE>M_FORMAT_EXISTING</CODE></A>, but other values may be added in the future.
</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>options</CODE> - the options map to use for formatting with the default code formatter. Recognized options
are documented on <code>JavaScriptCore#getDefaultOptions()</code>. If set to <code>null</code>, then use
the current settings from <code>JavaScriptCore#getOptions</code>.<DD><CODE>mode</CODE> - the given mode to modify the given options.
<DT><B>Returns:</B><DD>an instance of the built-in code formatter<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/wst/jsdt/core/formatter/CodeFormatter.html" title="class in org.eclipse.wst.jsdt.core.formatter"><CODE>CodeFormatter</CODE></A>,
<A HREF="../../../../../org/eclipse/wst/jsdt/core/JavaScriptCore.html#getOptions()"><CODE>JavaScriptCore.getOptions()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="createScanner(boolean, boolean, boolean, boolean)"><!-- --></A><H3>
createScanner</H3>
<PRE>
public static <A HREF="../../../../../org/eclipse/wst/jsdt/core/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler">IScanner</A> <B>createScanner</B>(boolean&nbsp;tokenizeComments,
boolean&nbsp;tokenizeWhiteSpace,
boolean&nbsp;assertMode,
boolean&nbsp;recordLineSeparator)</PRE>
<DL>
<DD>Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be
used to tokenize some source in a JavaScript aware way.
Here is a typical scanning loop:
<code>
<pre>
IScanner scanner = ToolFactory.createScanner(false, false, false, false);
scanner.setSource("int i = 0;".toCharArray());
while (true) {
int token = scanner.getNextToken();
if (token == ITerminalSymbols.TokenNameEOF) break;
System.out.println(token + " : " + new String(scanner.getCurrentTokenSource()));
}
</pre>
</code>
<p>
The returned scanner will tolerate unterminated line comments (missing line separator). It can be made stricter
by using API with extra boolean parameter (<code>strictCommentMode</code>).
<p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>tokenizeComments</CODE> - if set to <code>false</code>, comments will be silently consumed<DD><CODE>tokenizeWhiteSpace</CODE> - if set to <code>false</code>, white spaces will be silently consumed,<DD><CODE>assertMode</CODE> - if set to <code>false</code>, occurrences of 'assert' will be reported as identifiers
(<code>ITerminalSymbols#TokenNameIdentifier</code>), whereas if set to <code>true</code>, it
would report assert keywords (<code>ITerminalSymbols#TokenNameassert</code>).<DD><CODE>recordLineSeparator</CODE> - if set to <code>true</code>, the scanner will record positions of encountered line
separator ends. In case of multi-character line separators, the last character position is considered. These positions
can then be extracted using <code>IScanner#getLineEnds</code>. Only non-unicode escape sequences are
considered as valid line separators.
<DT><B>Returns:</B><DD>a scanner<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/wst/jsdt/core/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler"><CODE>IScanner</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="createScanner(boolean, boolean, boolean, java.lang.String)"><!-- --></A><H3>
createScanner</H3>
<PRE>
public static <A HREF="../../../../../org/eclipse/wst/jsdt/core/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler">IScanner</A> <B>createScanner</B>(boolean&nbsp;tokenizeComments,
boolean&nbsp;tokenizeWhiteSpace,
boolean&nbsp;recordLineSeparator,
java.lang.String&nbsp;sourceLevel)</PRE>
<DL>
<DD>Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be
used to tokenize some source in a JavaScript aware way.
Here is a typical scanning loop:
<code>
<pre>
IScanner scanner = ToolFactory.createScanner(false, false, false, false);
scanner.setSource("int i = 0;".toCharArray());
while (true) {
int token = scanner.getNextToken();
if (token == ITerminalSymbols.TokenNameEOF) break;
System.out.println(token + " : " + new String(scanner.getCurrentTokenSource()));
}
</pre>
</code>
<p>
The returned scanner will tolerate unterminated line comments (missing line separator). It can be made stricter
by using API with extra boolean parameter (<code>strictCommentMode</code>).
<p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>tokenizeComments</CODE> - if set to <code>false</code>, comments will be silently consumed<DD><CODE>tokenizeWhiteSpace</CODE> - if set to <code>false</code>, white spaces will be silently consumed,<DD><CODE>recordLineSeparator</CODE> - if set to <code>true</code>, the scanner will record positions of encountered line
separator ends. In case of multi-character line separators, the last character position is considered. These positions
can then be extracted using <code>IScanner#getLineEnds</code>. Only non-unicode escape sequences are
considered as valid line separators.<DD><CODE>sourceLevel</CODE> - if set to <code>&quot;1.3&quot;</code> or <code>null</code>, occurrences of 'assert' will be reported as identifiers
(<code>ITerminalSymbols#TokenNameIdentifier</code>), whereas if set to <code>&quot;1.4&quot;</code>, it
would report assert keywords (<code>ITerminalSymbols#TokenNameassert</code>).
<DT><B>Returns:</B><DD>a scanner<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/wst/jsdt/core/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler"><CODE>IScanner</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="createScanner(boolean, boolean, boolean, java.lang.String, java.lang.String)"><!-- --></A><H3>
createScanner</H3>
<PRE>
public static <A HREF="../../../../../org/eclipse/wst/jsdt/core/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler">IScanner</A> <B>createScanner</B>(boolean&nbsp;tokenizeComments,
boolean&nbsp;tokenizeWhiteSpace,
boolean&nbsp;recordLineSeparator,
java.lang.String&nbsp;sourceLevel,
java.lang.String&nbsp;complianceLevel)</PRE>
<DL>
<DD>Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be
used to tokenize some source in a JavaScript aware way.
Here is a typical scanning loop:
<code>
<pre>
IScanner scanner = ToolFactory.createScanner(false, false, false, false);
scanner.setSource("int i = 0;".toCharArray());
while (true) {
int token = scanner.getNextToken();
if (token == ITerminalSymbols.TokenNameEOF) break;
System.out.println(token + " : " + new String(scanner.getCurrentTokenSource()));
}
</pre>
</code>
<p>
The returned scanner will tolerate unterminated line comments (missing line separator). It can be made stricter
by using API with extra boolean parameter (<code>strictCommentMode</code>).
<p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>tokenizeComments</CODE> - if set to <code>false</code>, comments will be silently consumed<DD><CODE>tokenizeWhiteSpace</CODE> - if set to <code>false</code>, white spaces will be silently consumed,<DD><CODE>recordLineSeparator</CODE> - if set to <code>true</code>, the scanner will record positions of encountered line
separator ends. In case of multi-character line separators, the last character position is considered. These positions
can then be extracted using <code>IScanner#getLineEnds</code>. Only non-unicode escape sequences are
considered as valid line separators.<DD><CODE>sourceLevel</CODE> - if set to <code>&quot;1.3&quot;</code> or <code>null</code>, occurrences of 'assert' will be reported as identifiers
(<code>ITerminalSymbols#TokenNameIdentifier</code>), whereas if set to <code>&quot;1.4&quot;</code>, it
would report assert keywords (<code>ITerminalSymbols#TokenNameassert</code>).<DD><CODE>complianceLevel</CODE> - This is used to support the Unicode 4.0 character sets. if set to 1.5 or above,
the Unicode 4.0 is supporte, otherwise Unicode 3.0 is supported.
<DT><B>Returns:</B><DD>a scanner<DT><B>See Also:</B><DD><A HREF="../../../../../org/eclipse/wst/jsdt/core/compiler/IScanner.html" title="interface in org.eclipse.wst.jsdt.core.compiler"><CODE>IScanner</CODE></A></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/ToolFactory.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;<A HREF="../../../../../org/eclipse/wst/jsdt/core/Signature.html" title="class in org.eclipse.wst.jsdt.core"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/eclipse/wst/jsdt/core/UnimplementedException.html" title="class in org.eclipse.wst.jsdt.core"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/eclipse/wst/jsdt/core/ToolFactory.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ToolFactory.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;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&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>