OSDN Git Service

BirthmarkSpi -> BirthmarkService
[stigmata/stigmata.git] / src / main / java / jp / sourceforge / stigmata / BirthmarkExtractor.java
1 package jp.sourceforge.stigmata;
2
3 import java.io.InputStream;
4
5 import jp.sourceforge.stigmata.spi.BirthmarkService;
6
7 /**
8  * extract birthmarks from given Java bytecode stream.
9  * 
10  * @author Haruaki TAMADA
11  */
12 public interface BirthmarkExtractor{
13     /**
14      * returns service provider interface of this extractor.
15      */
16     public BirthmarkService getProvider();
17
18     /**
19      * create new birthmark.
20      */
21     public Birthmark createBirthmark();
22
23     /**
24      * Does extractor accept given extraction unit. 
25      */
26     public boolean isAcceptable(ExtractionUnit unit);
27
28     /**
29      * returns accepted extraction unit list.
30      */
31     public ExtractionUnit[] getAcceptableUnits();
32
33     /**
34      * build birthmark element from given string.
35      */
36     public BirthmarkElement buildElement(String value);
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 }