Package org.intermine.template.xml
Class TemplateQueryBinding
- java.lang.Object
-
- org.intermine.pathquery.PathQueryBinding
-
- org.intermine.template.xml.TemplateQueryBinding
-
public class TemplateQueryBinding extends PathQueryBinding
Convert PathQueries to and from XML- Author:
- Mark Woodbridge
-
-
Field Summary
Fields Modifier and Type Field Description static TemplateQueryBinding
INSTANCE
A single instance of this class
-
Constructor Summary
Constructors Constructor Description TemplateQueryBinding()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doAdditionalConstraintStuff(PathQuery query, PathConstraint constraint, javax.xml.stream.XMLStreamWriter writer)
Adds any extra information for a constraint, like say Template extras.void
doMarshal(TemplateQuery template, javax.xml.stream.XMLStreamWriter writer, int version)
Convert a TemplateQuery to XML and write XML to given writer.static java.lang.String
marshal(TemplateQuery template, int version)
Convert a TemplateQuery to XMLstatic void
marshal(TemplateQuery template, javax.xml.stream.XMLStreamWriter writer, int version)
Convert a TemplateQuery to XML and write XML to given writer.static java.util.Map<java.lang.String,TemplateQuery>
unmarshalJSONTemplates(java.io.Reader reader, Model model)
Parse TemplateQueries from JSON.static java.util.Map<java.lang.String,TemplateQuery>
unmarshalTemplates(java.io.Reader reader, int version)
Parse TemplateQueries from XML.-
Methods inherited from class org.intermine.pathquery.PathQueryBinding
doMarshal, marshal, marshal, unmarshalJSONPathQueries, unmarshalJSONPathQuery, unmarshalPathQueries, unmarshalPathQueries, unmarshalPathQuery, unmarshalPathQuery
-
-
-
-
Field Detail
-
INSTANCE
public static final TemplateQueryBinding INSTANCE
A single instance of this class
-
-
Method Detail
-
marshal
public static void marshal(TemplateQuery template, javax.xml.stream.XMLStreamWriter writer, int version)
Convert a TemplateQuery to XML and write XML to given writer.- Parameters:
template
- the TemplateQuerywriter
- the XMLStreamWriter to write toversion
- the version number of the XML format
-
doMarshal
public void doMarshal(TemplateQuery template, javax.xml.stream.XMLStreamWriter writer, int version)
Convert a TemplateQuery to XML and write XML to given writer.- Parameters:
template
- the TemplateQuerywriter
- the XMLStreamWriter to write toversion
- the version number of the XML format
-
doAdditionalConstraintStuff
public void doAdditionalConstraintStuff(PathQuery query, PathConstraint constraint, javax.xml.stream.XMLStreamWriter writer) throws javax.xml.stream.XMLStreamException
Adds any extra information for a constraint, like say Template extras.- Overrides:
doAdditionalConstraintStuff
in classPathQueryBinding
- Parameters:
query
- the queryconstraint
- the constraint being processedwriter
- a writer to add data to- Throws:
javax.xml.stream.XMLStreamException
- if something goes wrong
-
marshal
public static java.lang.String marshal(TemplateQuery template, int version)
Convert a TemplateQuery to XML- Parameters:
template
- the TemplateQueryversion
- the version number of the XML format- Returns:
- the corresponding XML String
-
unmarshalTemplates
public static java.util.Map<java.lang.String,TemplateQuery> unmarshalTemplates(java.io.Reader reader, int version)
Parse TemplateQueries from XML.- Parameters:
reader
- the saved templatesversion
- the version of the xml format, an attribute of the ProfileManager- Returns:
- a Map from template name to TemplateQuery
-
unmarshalJSONTemplates
public static java.util.Map<java.lang.String,TemplateQuery> unmarshalJSONTemplates(java.io.Reader reader, Model model)
Parse TemplateQueries from JSON.- Parameters:
reader
- the saved templatesmodel
- the model- Returns:
- a Map from template name to TemplateQuery
-
-