1 package jp.sourceforge.stigmata;
7 import java.io.InputStream;
9 import jp.sourceforge.stigmata.spi.BirthmarkSpi;
12 * extract birthmarks from given Java bytecode stream.
14 * @author Haruaki TAMADA
17 public interface BirthmarkExtractor{
19 * returns service provider interface of this extractor.
21 public BirthmarkSpi getProvider();
24 * create new birthmark.
26 public Birthmark createBirthmark();
29 * Does extractor accept given extraction unit.
31 public boolean isAcceptable(ExtractionUnit unit);
34 * returns accepted extraction unit list.
36 public ExtractionUnit[] getAcceptableUnits();
39 * extract birthmark from given stream with given environment.
41 public Birthmark extract(InputStream in, BirthmarkContext context) throws BirthmarkExtractionFailedException;
44 * extract birthmark from given byte array with given environment.
46 public Birthmark extract(byte[] bytecode, BirthmarkContext context) throws BirthmarkExtractionFailedException;
49 * extract birthmark from given stream with given environment and add element to given birthmark object.
51 public Birthmark extract(Birthmark birthmark, InputStream in, BirthmarkContext context) throws BirthmarkExtractionFailedException;
54 * extract birthmark from given byte array with given environment and add element to given birthmark object.
56 public Birthmark extract(Birthmark birthmark, byte[] bytecode, BirthmarkContext context) throws BirthmarkExtractionFailedException;