1 package jp.sourceforge.stigmata;
3 import java.io.InputStream;
5 import jp.sourceforge.stigmata.spi.BirthmarkService;
8 * extract birthmarks from given Java bytecode stream.
10 * @author Haruaki TAMADA
12 public interface BirthmarkExtractor{
14 * returns service provider interface of this extractor.
16 public BirthmarkService getProvider();
19 * create new birthmark.
21 public Birthmark createBirthmark();
24 * Does extractor accept given extraction unit.
26 public boolean isAcceptable(ExtractionUnit unit);
29 * returns accepted extraction unit list.
31 public ExtractionUnit[] getAcceptableUnits();
34 * build birthmark element from given string.
36 public BirthmarkElement buildElement(String value);
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;