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 interfaceXMLFilterWriter.FilterWriterInterface for an object which can write a FeatureFilter as XML.
-
Field Summary
Fields Modifier and Type Field Description static StringXML_FILTER_NS
-
Constructor Summary
Constructors Constructor Description XMLFilterWriter()Construct a newXMLFilterWriterwhich can serialize the buildin types ofFeatureFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddXMLFilterWriter(Class clazz, XMLFilterWriter.FilterWriter xfw)Add a writer for the specified class of filtersvoidaddXMLFilterWriter(FeatureFilter ff, XMLFilterWriter.FilterWriter xfw)Add a writer for a singleton filter.booleanisStrict()Determine if this writer is in strict mode.voidsetIsStrict(boolean b)Selects strict mode.voidwriteFilter(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 newXMLFilterWriterwhich 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 anIllegalArgumentExceptionif it encounters a type ofFeatureFilterit 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.
-
-