Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.javatools.parser.java.v2
Class JavaParser

java.lang.Object
  extended by oracle.javatools.parser.java.v2.JavaParser

public class JavaParser
extends java.lang.Object

Raw API for generating parse trees.


Field Summary
static byte j2se
           
 
Constructor Summary
JavaParser()
           
 
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 JavaFile lightParse(ReadTextBuffer textBuffer, java.net.URL url, JavaProvider javaProvider, int j2se)
          Parse the textBuffer and return a "light" sourceFile where all the method bodies were skipped In general this method should NOT be called directly.
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
 

Field Detail

j2se

public static byte j2se
Constructor Detail

JavaParser

public JavaParser()
Method Detail

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_*.

lightParse

public static JavaFile lightParse(ReadTextBuffer textBuffer,
                                  java.net.URL url,
                                  JavaProvider javaProvider,
                                  int j2se)
Parse the textBuffer and return a "light" sourceFile where all the method bodies were skipped In general this method should NOT be called directly. Instead, use JavaManager.getFile(URL) which sets the correct options based on the project.

Parameters:
textBuffer - A text buffer, which cannot be null
url - The URL associated with the textBuffer, if there is such a URL
javaProvider - The JavaProvider which can be used to resolve types after the parse, if there is such a JavaProvider
j2se - The Java Version, one of JavaTokens.J2SE_*
Returns:
A "light" SourceFile returned as a JavaFile

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()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.