Package org.scijava.annotations
Class AbstractIndexWriter
- java.lang.Object
-
- org.scijava.annotations.AbstractIndexWriter
-
- Direct Known Subclasses:
AnnotationCombiner,DirectoryIndexer
public abstract class AbstractIndexWriter extends Object
Writes annotations as JSON-formatted files.The file names are the names of the annotations, and the serialized data describe the class which was annotated together with the specific annotation fields.
- Author:
- Johannes Schindelin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractIndexWriter.StreamFactory
-
Constructor Summary
Constructors Constructor Description AbstractIndexWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <A extends Annotation>
Map<String,Object>adapt(A annotation)protected Objectadapt(Object o)protected voidadd(Map<String,Object> annotationValues, String annotationName, String className)protected booleanfoundAnnotations()protected voidmerge(String annotationName, AbstractIndexWriter.StreamFactory factory)Merges an existing annotation index into the currently-generated one.protected voidwrite(AbstractIndexWriter.StreamFactory factory)protected voidwriteMap(PrintStream out, Object... pairs)
-
-
-
Method Detail
-
foundAnnotations
protected boolean foundAnnotations()
-
add
protected void add(Map<String,Object> annotationValues, String annotationName, String className)
-
write
protected void write(AbstractIndexWriter.StreamFactory factory) throws IOException
- Throws:
IOException
-
merge
protected void merge(String annotationName, AbstractIndexWriter.StreamFactory factory) throws IOException
Merges an existing annotation index into the currently-generated one.This method is used to read previously-indexed annotations and reconcile them with the newly-generated ones just.
- Parameters:
annotationName- the name of the annotation for which the index contains the annotated classesfactory- the factory to generate input and output streams given an annotation name- Throws:
IOException
-
adapt
protected <A extends Annotation> Map<String,Object> adapt(A annotation)
-
writeMap
protected void writeMap(PrintStream out, Object... pairs) throws IOException
- Throws:
IOException
-
-