コード例 #1
0
 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);
   }
 }
コード例 #2
0
  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);
 }