private VCPENetworkModel loadModelFromDescriptor(VCPENetworkDescriptor descriptor)
     throws ResourceException {
   try {
     VCPENetworkModel model =
         (VCPENetworkModel)
             ObjectSerializer.fromXml(descriptor.getvCPEModel(), VCPENetworkModel.class);
     return model;
   } catch (SerializationException e) {
     throw new ResourceException(e);
   }
 }
  private VCPENetworkDescriptor storeModelIntoDescriptor(
      VCPENetworkModel model, VCPENetworkDescriptor descriptor) throws ResourceException {

    if (model == null) {
      descriptor.setvCPEModel(null);
    } else {
      try {
        descriptor.setvCPEModel(ObjectSerializer.toXml(model));
      } catch (SerializationException e) {
        throw new ResourceException(e);
      }
    }
    return descriptor;
  }
Пример #3
0
 @Override
 public String toXml() throws SerializationException {
   return ObjectSerializer.toXml(this);
 }