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.
41 public Birthmark extract(InputStream in) throws BirthmarkExtractionFailedException;
44 * extract birthmark from given byte array.
46 public Birthmark extract(byte[] bytecode) throws BirthmarkExtractionFailedException;
49 * extract birthmark from given stream with given environment.
51 public Birthmark extract(InputStream in, BirthmarkEnvironment environment) throws BirthmarkExtractionFailedException;
54 * extract birthmark from given byte array with given environment.
56 public Birthmark extract(byte[] bytecode, BirthmarkEnvironment environment) throws BirthmarkExtractionFailedException;
59 * extract birthmark from given stream and add element to given birthmark object.
61 public Birthmark extract(Birthmark birthmark, InputStream in) throws BirthmarkExtractionFailedException;
64 * extract birthmark from given byte array and add element to given birthmark object.
66 public Birthmark extract(Birthmark birthmark, byte[] bytecode) throws BirthmarkExtractionFailedException;
69 * extract birthmark from given stream with given environment and add element to given birthmark object.
71 public Birthmark extract(Birthmark birthmark, InputStream in, BirthmarkEnvironment environment) throws BirthmarkExtractionFailedException;
74 * extract birthmark from given byte array with given environment and add element to given birthmark object.
76 public Birthmark extract(Birthmark birthmark, byte[] bytecode, BirthmarkEnvironment environment) throws BirthmarkExtractionFailedException;