|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.bio.program.tagvalue.AnnotationBuilder
public class AnnotationBuilder
Builds an Annotation tree from TagValue events using an AnnotationType to work out which fields are of what type.
| Constructor Summary | |
|---|---|
AnnotationBuilder(AnnotationType type)
Make a new AnnotationBuilder that will build Annotation instances of a given type. |
|
| Method Summary | |
|---|---|
void |
endRecord()
The current record has ended. |
void |
endTag()
End the current tag. |
Annotation |
getLast()
Get the last complete annotation built. |
void |
startRecord()
A new record is about to start. |
void |
startTag(Object tag)
Start a new tag. |
void |
value(TagValueContext ctxt,
Object value)
A value has been seen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotationBuilder(AnnotationType type)
Make a new AnnotationBuilder that will build Annotation instances of a given type.
The type is used to provide appropriate accessors for properties. As tag -value events stream through this TagValueListener, they will be matched against the properties of the annotation type. As sub-trees of events are pushed, child annotation bundles will be pushed into the appropriate properties. If any of the tag-value events are of a type that are not accepted by the annotation type, a ClassCastException will be thrown.
type - the AnnotationType stating what will be built and how
ClassCastException - if any of the tag-value events are of
inappropriate type| Method Detail |
|---|
public Annotation getLast()
Get the last complete annotation built.
The value of this is undefined before the first annotation has been built and during the parsing of an event stream.
public void startRecord()
TagValueListener
startRecord in interface TagValueListenerpublic void endRecord()
TagValueListener
endRecord in interface TagValueListenerpublic void startTag(Object tag)
TagValueListener
startTag in interface TagValueListenertag - the Object representing the new tag
public void value(TagValueContext ctxt,
Object value)
TagValueListener
value in interface TagValueListenerctxt - a TagValueContext that could be used to push a sub-documentvalue - the value Object observedpublic void endTag()
TagValueListener
endTag in interface TagValueListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||