org.biojava.bio.seq.io
Class SwissprotProcessor

java.lang.Object
  extended byorg.biojava.bio.seq.io.SequenceBuilderFilter
      extended byorg.biojava.bio.seq.io.SwissprotProcessor
All Implemented Interfaces:
ParseErrorSource, SeqIOListener, SequenceBuilder

public class SwissprotProcessor
extends SequenceBuilderFilter
implements ParseErrorSource

Simple filter which handles attribute lines from an Swissprot entry. Skeleton implementation, please add more functionality.

FIXME: Note that this is currently rather incomplete, and doesn't handle any of the header information sensibly except for ID and AC.

Since:
1.1
Author:
Thomas Down, Matthew Pocock, Greg Cox

Nested Class Summary
static class SwissprotProcessor.Factory
          Factory which wraps SequenceBuilders in a SwissprotProcessor
 
Field Summary
static java.lang.String PROPERTY_SWISSPROT_ACCESSIONS
           
static java.lang.String PROPERTY_SWISSPROT_COMMENT
           
static java.lang.String PROPERTY_SWISSPROT_FEATUREATTRIBUTE
           
 
Constructor Summary
SwissprotProcessor(SequenceBuilder delegate)
           
SwissprotProcessor(SequenceBuilder delegate, java.lang.String theSource)
          Constructor that sets the source of the feature to theSource.
 
Method Summary
 void addParseErrorListener(ParseErrorListener theListener)
          Adds a parse error listener to the list of listeners if it isn't already included.
 void addSequenceProperty(java.lang.Object key, java.lang.Object value)
          Notify the listener of a sequence-wide property.
 void endSequence()
          Notify the listener that processing of the sequence is complete.
protected  void notifyParseErrorEvent(ParseErrorEvent theEvent)
          Passes the event on to all the listeners registered for ParseErrorEvents.
 void removeParseErrorListener(ParseErrorListener theListener)
          Removes a parse error listener from the list of listeners if it is included.
 
Methods inherited from class org.biojava.bio.seq.io.SequenceBuilderFilter
addFeatureProperty, addSymbols, endFeature, getDelegate, makeSequence, setName, setURI, startFeature, startSequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_SWISSPROT_ACCESSIONS

public static final java.lang.String PROPERTY_SWISSPROT_ACCESSIONS
See Also:
Constant Field Values

PROPERTY_SWISSPROT_COMMENT

public static final java.lang.String PROPERTY_SWISSPROT_COMMENT
See Also:
Constant Field Values

PROPERTY_SWISSPROT_FEATUREATTRIBUTE

public static final java.lang.String PROPERTY_SWISSPROT_FEATUREATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

SwissprotProcessor

public SwissprotProcessor(SequenceBuilder delegate,
                          java.lang.String theSource)
Constructor that sets the source of the feature to theSource.

Parameters:
delegate - The sequecence builder to be used in constructing the sequence
theSource - The source of the features. e.g. "SWISS-PROT", "TrEMBL"

SwissprotProcessor

public SwissprotProcessor(SequenceBuilder delegate)
Method Detail

endSequence

public void endSequence()
                 throws ParseException
Description copied from interface: SeqIOListener
Notify the listener that processing of the sequence is complete.

Specified by:
endSequence in interface SeqIOListener
Overrides:
endSequence in class SequenceBuilderFilter
Throws:
ParseException

addSequenceProperty

public void addSequenceProperty(java.lang.Object key,
                                java.lang.Object value)
                         throws ParseException
Description copied from interface: SeqIOListener
Notify the listener of a sequence-wide property. This might be stored as an entry in the sequence's annotation bundle.

Specified by:
addSequenceProperty in interface SeqIOListener
Overrides:
addSequenceProperty in class SequenceBuilderFilter
Throws:
ParseException

addParseErrorListener

public void addParseErrorListener(ParseErrorListener theListener)
Adds a parse error listener to the list of listeners if it isn't already included.

Specified by:
addParseErrorListener in interface ParseErrorSource
Parameters:
theListener - Listener to be added.

removeParseErrorListener

public void removeParseErrorListener(ParseErrorListener theListener)
Removes a parse error listener from the list of listeners if it is included.

Specified by:
removeParseErrorListener in interface ParseErrorSource
Parameters:
theListener - Listener to be removed.

notifyParseErrorEvent

protected void notifyParseErrorEvent(ParseErrorEvent theEvent)
Passes the event on to all the listeners registered for ParseErrorEvents.

Parameters:
theEvent - The event to be handed to the listeners.