OSDN Git Service

add preprocessor of birthmarking
[stigmata/stigmata-core.git] / src / main / java / jp / sourceforge / stigmata / BirthmarkExtractor.java
1 package jp.sourceforge.stigmata;
2
3 /*
4  * $Id$
5  */
6
7 import java.io.InputStream;
8
9 import jp.sourceforge.stigmata.spi.BirthmarkSpi;
10
11 /**
12  * extract birthmarks from given Java bytecode stream.
13  * 
14  * @author Haruaki TAMADA
15  * @version $Revision$ 
16  */
17 public interface BirthmarkExtractor{
18     /**
19      * returns service provider interface of this extractor.
20      */
21     public BirthmarkSpi getProvider();
22
23     /**
24      * create new birthmark.
25      */
26     public Birthmark createBirthmark();
27
28     /**
29      * Does extractor accept given extraction unit. 
30      */
31     public boolean isAcceptable(ExtractionUnit unit);
32
33     /**
34      * returns accepted extraction unit list.
35      */
36     public ExtractionUnit[] getAcceptableUnits();
37
38     /**
39      * extract birthmark from given stream with given environment.
40      */
41     public Birthmark extract(InputStream in, BirthmarkContext context) throws BirthmarkExtractionFailedException;
42
43     /**
44      * extract birthmark from given byte array with given environment.
45      */
46     public Birthmark extract(byte[] bytecode, BirthmarkContext context) throws BirthmarkExtractionFailedException;
47
48     /**
49      * extract birthmark from given stream with given environment and add element to given birthmark object.
50      */
51     public Birthmark extract(Birthmark birthmark, InputStream in, BirthmarkContext context) throws BirthmarkExtractionFailedException;
52
53     /**
54      * extract birthmark from given byte array with given environment and add element to given birthmark object.
55      */
56     public Birthmark extract(Birthmark birthmark, byte[] bytecode, BirthmarkContext context) throws BirthmarkExtractionFailedException;
57 }