@@ -0,0 +1,1632 @@
+package org.dasein.cloud.vsphere;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport org.codehaus.jackson.map.ObjectMapper;%0Aimport org.codehaus.jackson.map.DeserializationConfig.Feature;%0Aimport org.codehaus.jackson.map.ObjectMapper.DefaultTyping;%0A%0Apublic class ObjectManagement %7B%0A    ObjectMapper mapper = null;%0A%0A    public ObjectManagement() %7B %0A        mapper = new ObjectMapper();%0A        mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);%0A        mapper.enableDefaultTypingAsProperty(DefaultTyping.OBJECT_AND_NON_CONCRETE, %22type%22);%0A    %7D%0A%0A    public %3CT%3E T readJsonFile(String filename, Class%3CT%3E valueType) %7B%0A        //ObjectMapper mapper = new ObjectMapper();%0A        //mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);%0A        //mapper.enableDefaultTypingAsProperty(DefaultTyping.OBJECT_AND_NON_CONCRETE, %22type%22);%0A        try %7B%0A            return (T) mapper.readValue(new File(filename), valueType);%0A        %7D catch ( Exception e ) %7B %0A            throw new RuntimeException(%22Unable to read file %22 + filename, e);%0A        %7D%0A    %7D%0A%0A    public void writeJsonFile(Object object, String filename) %7B%0A        //ObjectMapper mapper = new ObjectMapper().setVisibility(JsonMethod.FIELD, Visibility.ANY);%0A        //mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);%0A        //mapper.enableDefaultTypingAsProperty(DefaultTyping.OBJECT_AND_NON_CONCRETE, %22type%22);%0A%0A        try %7B%0A            mapper.writerWithDefaultPrettyPrinter().writeValue(new File(filename), object);%0A        %7D catch ( IOException e ) %7B%0A            throw new RuntimeException(%22Unable to write file %22 + filename, e);%0A        %7D%0A    %7D%0A%7D%0A

save and restore for complex objects for mock testing...