org.glassfish.hk2.classmodel.reflect
Class Parser

java.lang.Object
  extended by org.glassfish.hk2.classmodel.reflect.Parser
All Implemented Interfaces:
Closeable

public class Parser
extends Object
implements Closeable

Parse jar files or directories and create the model for any classes found.

Author:
Jerome Dochez

Nested Class Summary
 class Parser.Result
           
 
Field Summary
static String DEFAULT_WAIT_SYSPROP
           
 
Constructor Summary
Parser(ParsingContext context)
           
 
Method Summary
 Exception[] awaitTermination()
           
 Exception[] awaitTermination(int timeOut, TimeUnit unit)
           
 void close()
           
 ParsingContext getContext()
          Returns the context this parser instance was initialized with during the call to Parser(ParsingContext)
 Future<Parser.Result> parse(ArchiveAdapter source, Runnable doneHook)
          Parse the archive adapter entries and run the runnable hook on completion.
 void parse(File source, Runnable doneHook)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WAIT_SYSPROP

public static final String DEFAULT_WAIT_SYSPROP
See Also:
Constant Field Values
Constructor Detail

Parser

public Parser(ParsingContext context)
Method Detail

awaitTermination

public Exception[] awaitTermination()
                             throws InterruptedException
Throws:
InterruptedException

awaitTermination

public Exception[] awaitTermination(int timeOut,
                                    TimeUnit unit)
                             throws InterruptedException
Throws:
InterruptedException

close

public void close()
Specified by:
close in interface Closeable

parse

public void parse(File source,
                  Runnable doneHook)
           throws IOException
Throws:
IOException

parse

public Future<Parser.Result> parse(ArchiveAdapter source,
                                   Runnable doneHook)
                            throws IOException
Parse the archive adapter entries and run the runnable hook on completion.

Parameters:
source - the archive adapter to parse
doneHook - the runnable hook to run after completion
Returns:
the future object to monitor the result of the parsing.
Throws:
IOException - thrown by the source archive adapter when accessing entries

getContext

public ParsingContext getContext()
Returns the context this parser instance was initialized with during the call to Parser(ParsingContext)

Returns:
the parsing context this parser uses to store the parsing activities results.


Copyright © 2013 Oracle Corporation. All Rights Reserved.