Package org.biojava.bio.seq.io.filterxml
Class XMLFilterWriter
- java.lang.Object
-
- org.biojava.bio.seq.io.filterxml.XMLFilterWriter
-
public class XMLFilterWriter extends Object
Write FeatureFilters in XML format.- Since:
- 1.3
- Author:
- Thomas Down
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
XMLFilterWriter.FilterWriter
Interface for an object which can write a FeatureFilter as XML.
-
Field Summary
Fields Modifier and Type Field Description static String
XML_FILTER_NS
-
Constructor Summary
Constructors Constructor Description XMLFilterWriter()
Construct a newXMLFilterWriter
which can serialize the buildin types ofFeatureFilter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addXMLFilterWriter(Class clazz, XMLFilterWriter.FilterWriter xfw)
Add a writer for the specified class of filtersvoid
addXMLFilterWriter(FeatureFilter ff, XMLFilterWriter.FilterWriter xfw)
Add a writer for a singleton filter.boolean
isStrict()
Determine if this writer is in strict mode.void
setIsStrict(boolean b)
Selects strict mode.void
writeFilter(FeatureFilter ff, XMLWriter xw)
Write a FeatureFilter to the supplied XMLWriter
-
-
-
Field Detail
-
XML_FILTER_NS
public static final String XML_FILTER_NS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XMLFilterWriter
public XMLFilterWriter()
Construct a newXMLFilterWriter
which can serialize the buildin types ofFeatureFilter
.
-
-
Method Detail
-
addXMLFilterWriter
public void addXMLFilterWriter(Class clazz, XMLFilterWriter.FilterWriter xfw)
Add a writer for the specified class of filters
-
addXMLFilterWriter
public void addXMLFilterWriter(FeatureFilter ff, XMLFilterWriter.FilterWriter xfw)
Add a writer for a singleton filter.
-
isStrict
public boolean isStrict()
Determine if this writer is in strict mode.
-
setIsStrict
public void setIsStrict(boolean b)
Selects strict mode. In strict mode, the writer will throw anIllegalArgumentException
if it encounters a type ofFeatureFilter
it doesn't recognize. When not in strict model, unrecognized filters are silently replaced byFeatureFilter.all
. Default isfalse
.
-
writeFilter
public void writeFilter(FeatureFilter ff, XMLWriter xw) throws IllegalArgumentException, IOException
Write a FeatureFilter to the supplied XMLWriter- Throws:
IllegalArgumentException
- if the FeatureFilter is unrecognized, and the writer is in strict mode.IOException
- if an error occurs while outputting XML.
-
-