OSDN Git Service

update
[stigmata/stigmata.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.
40      */
41     public Birthmark extract(InputStream in) throws BirthmarkExtractionFailedException;
42
43     /**
44      * extract birthmark from given byte array.
45      */
46     public Birthmark extract(byte[] bytecode) throws BirthmarkExtractionFailedException;
47
48     /**
49      * extract birthmark from given stream with given environment.
50      */
51     public Birthmark extract(InputStream in, BirthmarkEnvironment environment) throws BirthmarkExtractionFailedException;
52
53     /**
54      * extract birthmark from given byte array with given environment.
55      */
56     public Birthmark extract(byte[] bytecode, BirthmarkEnvironment environment) throws BirthmarkExtractionFailedException;
57
58     /**
59      * extract birthmark from given stream and add element to given birthmark object.
60      */
61     public Birthmark extract(Birthmark birthmark, InputStream in) throws BirthmarkExtractionFailedException;
62
63     /**
64      * extract birthmark from given byte array and add element to given birthmark object.
65      */
66     public Birthmark extract(Birthmark birthmark, byte[] bytecode) throws BirthmarkExtractionFailedException;
67
68     /**
69      * extract birthmark from given stream with given environment and add element to given birthmark object.
70      */
71     public Birthmark extract(Birthmark birthmark, InputStream in, BirthmarkEnvironment environment) throws BirthmarkExtractionFailedException;
72
73     /**
74      * extract birthmark from given byte array with given environment and add element to given birthmark object.
75      */
76     public Birthmark extract(Birthmark birthmark, byte[] bytecode, BirthmarkEnvironment environment) throws BirthmarkExtractionFailedException;
77 }