Skip navigation links
oracle.javatools.parser.java.v2
Class JavaParser
java.lang.Object
oracle.javatools.parser.java.v2.JavaParser
-
public class JavaParser
- extends java.lang.Object
Raw API for generating parse trees.
Field Summary |
static byte |
j2se
|
Method Summary |
static boolean |
cancelParse(java.lang.Thread thread)
Attempt to cancel the parse running on the thread indicated by the incoming 'thread' parameter. |
static java.util.logging.Logger |
getLogger()
|
static SourceFile |
parse(ReadTextBuffer textBuffer)
Parses the given text buffer with default options. |
static SourceFile |
parse(ReadTextBuffer textBuffer, int j2se)
Parses the given text buffer with default options. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
j2se
public static byte j2se
JavaParser
public JavaParser()
parse
public static SourceFile parse(ReadTextBuffer textBuffer)
- Parses the given text buffer with default options. In general this method should NOT be called directly. Instead, use JavaManager.getSourceFile(TextBuffer) which sets the correct options based on the project.
parse
public static SourceFile parse(ReadTextBuffer textBuffer,
int j2se)
- Parses the given text buffer with default options. In general this method should NOT be called directly. Instead, use JavaManager.getSourceFile(TextBuffer) which sets the correct options based on the project.
-
- Parameters:
j2se
- Valid values are JavaTokens.J2SE_*.
cancelParse
public static boolean cancelParse(java.lang.Thread thread)
- Attempt to cancel the parse running on the thread indicated by the incoming 'thread' parameter. If the parser actually cancels the parse, it will throw a CancellationException on the thread indicated by the incoming 'thread' parameter.
-
- Parameters:
thread
- A thread that is currently parsing
- Returns:
- True if the parser was notified of the cancellation, false otherwise, usually because there was no parser associated with the incoming 'thread' parameter. Notification of cancellation is no guarantee that the parser can actually cancel the parse.
getLogger
public static java.util.logging.Logger getLogger()
Skip navigation links
Copyright © 1997, 2013, Oracle. All rights reserved.