1   package org.kuali.ole.ingest;
2   
3   import com.thoughtworks.xstream.XStream;
4   import org.kuali.ole.ingest.pojo.*;
5   
6   import java.io.IOException;
7   import java.net.URISyntaxException;
8   
9   
10  
11  
12  public class ProfileObjectGeneratorFromXML {
13      
14  
15  
16  
17  
18  
19  
20  
21      public Profile buildProfileFromFileContent(String fileContent) throws URISyntaxException, IOException {
22          XStream xStream = new XStream();
23          xStream.alias("profile", Profile.class);
24          xStream.alias("attribute", ProfileAttributeBo.class);
25          xStream.alias("rule", OleRule.class);
26          xStream.alias("action", OleAction.class);
27          xStream.alias("routeTo", OleRoute.class);
28          xStream.alias("incomingField", MatchPoint.class);
29          xStream.alias("existingField", MatchPoint.class);
30          xStream.registerConverter(new ProfileAttributeConverter());
31          Object object = xStream.fromXML(fileContent);
32          return (Profile) object;
33      }
34  }