Package org.intermine.api.xml
Class ProfileBinding
- java.lang.Object
-
- org.intermine.api.xml.ProfileBinding
-
public final class ProfileBinding extends java.lang.Object
Code for reading and writing Profile objects as XML.- Author:
- Kim Rutherford, Richard Smith
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
marshal(Profile profile, ObjectStore os, javax.xml.stream.XMLStreamWriter writer, boolean writeUserAndPassword, boolean writeQueries, boolean writeTemplates, boolean writeBags, boolean writeTags, boolean onlyConfigTags, int version, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys)
Convert a Profile to XML and write XML to given writer.static void
marshal(Profile profile, ObjectStore os, javax.xml.stream.XMLStreamWriter writer, int version, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classkeys)
Convert a Profile to XML and write XML to given writer.static Profile
unmarshal(java.io.Reader reader, ProfileManager profileManager, java.lang.String username, java.lang.String password, java.util.Set<Tag> tags, ObjectStoreWriter osw, int version)
Read a Profile from an XML stream Reader.
-
-
-
Method Detail
-
marshal
public static void marshal(Profile profile, ObjectStore os, javax.xml.stream.XMLStreamWriter writer, int version, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classkeys)
Convert a Profile to XML and write XML to given writer.- Parameters:
profile
- the UserProfileos
- the ObjectStore to use when looking up the ids of objects in bagswriter
- the XMLStreamWriter to write toversion
- the version number of the xml format, an attribute of the profile managerclasskeys
- the classKey
-
marshal
public static void marshal(Profile profile, ObjectStore os, javax.xml.stream.XMLStreamWriter writer, boolean writeUserAndPassword, boolean writeQueries, boolean writeTemplates, boolean writeBags, boolean writeTags, boolean onlyConfigTags, int version, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys)
Convert a Profile to XML and write XML to given writer.- Parameters:
profile
- the UserProfileos
- the ObjectStore to use when looking up the ids of objects in bagswriter
- the XMLStreamWriter to write towriteUserAndPassword
- write username and passwordwriteQueries
- save saved querieswriteTemplates
- write saved templateswriteBags
- write saved bagswriteTags
- write saved tagsonlyConfigTags
- if true, only save tags that contain a ':'classKeys
- has to be setted if you save bagsversion
- the version number of the xml format, an attribute of the profile manager
-
unmarshal
public static Profile unmarshal(java.io.Reader reader, ProfileManager profileManager, java.lang.String username, java.lang.String password, java.util.Set<Tag> tags, ObjectStoreWriter osw, int version)
Read a Profile from an XML stream Reader. Note that Tags from the XML are stored immediately using the ProfileManager.- Parameters:
reader
- contains the Profile XMLprofileManager
- the ProfileManager to pass to the Profile constructorusername
- default username - used if there is no username in the XMLpassword
- default passwordtags
- a set to populate with user tagsosw
- an ObjectStoreWriter for the production database, to write bagsversion
- the version of the XML format, an attribute on the ProfileManager- Returns:
- the new Profile
-
-