本文整理汇总了Java中eu.atos.sla.service.types.TemplateParam.setOriginalSerialzedTemplate方法的典型用法代码示例。如果您正苦于以下问题:Java TemplateParam.setOriginalSerialzedTemplate方法的具体用法?Java TemplateParam.setOriginalSerialzedTemplate怎么用?Java TemplateParam.setOriginalSerialzedTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eu.atos.sla.service.types.TemplateParam
的用法示例。
在下文中一共展示了TemplateParam.setOriginalSerialzedTemplate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFrom
import eu.atos.sla.service.types.TemplateParam; //导入方法依赖的package包/类
@Override
public TemplateParam readFrom(Class<TemplateParam> type, Type genericType,
Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
throws IOException, WebApplicationException {
String str = MessageBodyUtils.getStringFromInputStream(entityStream);
try {
Template templateWSAG = jsonParser.getWsagObject(str);
String serializedWsagData = jsonParser.getWsagAsSerializedData(str);
TemplateParam agreementParam = new TemplateParam();
agreementParam.setTemplate(templateWSAG);
agreementParam.setOriginalSerialzedTemplate(removeXMLHeader(serializedWsagData));
return agreementParam;
} catch (ParserException e) {
logger.error("Error parsing"+e.getMessage());
throw new WebApplicationException(e,Response.Status.NOT_ACCEPTABLE);
}
}
示例2: readFrom
import eu.atos.sla.service.types.TemplateParam; //导入方法依赖的package包/类
@Override
public TemplateParam readFrom(Class<TemplateParam> type, Type genericType,
Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
throws IOException, WebApplicationException {
String str = MessageBodyUtils.getStringFromInputStream(entityStream);
try {
Template template = (xmlParser==null)?defaultParser.getWsagObject(str):xmlParser.getWsagObject(str);
TemplateParam templateParam = new TemplateParam();
templateParam.setTemplate(template);
String templateData = (xmlParser==null)?defaultParser.getWsagAsSerializedData(str):xmlParser.getWsagAsSerializedData(str);
templateParam.setOriginalSerialzedTemplate(removeXMLHeader(templateData));
return templateParam;
} catch (ParserException e) {
logger.error("Error parsing with "+xmlParser.getClass().getName() );
throw new WebApplicationException(e, Response.Status.NOT_ACCEPTABLE);
}
}
示例3: readFrom
import eu.atos.sla.service.types.TemplateParam; //导入方法依赖的package包/类
@Override
public TemplateParam readFrom(Class<TemplateParam> type, Type genericType,
Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
throws IOException, WebApplicationException {
String str = MessageBodyUtils.getStringFromInputStream(entityStream);
try {
Template templateWSAG = jsonParser.getWsagObject(str);
String serializedWsagData = jsonParser.getWsagAsSerializedData(str);
TemplateParam agreementParam = new TemplateParam();
agreementParam.setTemplate(templateWSAG);
agreementParam.setOriginalSerialzedTemplate(removeXMLHeader(serializedWsagData));
return agreementParam;
} catch (ParserException e) {
logger.error("Error parsing"+e.getMessage());
throw new WebApplicationException(e,Response.Status.NOT_ACCEPTABLE);
}
}
示例4: readFrom
import eu.atos.sla.service.types.TemplateParam; //导入方法依赖的package包/类
@Override
public TemplateParam readFrom(Class<TemplateParam> type, Type genericType,
Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
throws IOException, WebApplicationException {
String str = MessageBodyUtils.getStringFromInputStream(entityStream);
try {
Template template = (xmlParser==null)?defaultParser.getWsagObject(str):xmlParser.getWsagObject(str);
TemplateParam templateParam = new TemplateParam();
templateParam.setTemplate(template);
String templateData = (xmlParser==null)?defaultParser.getWsagAsSerializedData(str):xmlParser.getWsagAsSerializedData(str);
templateParam.setOriginalSerialzedTemplate(removeXMLHeader(templateData));
return templateParam;
} catch (ParserException e) {
logger.error("Error parsing with "+xmlParser.getClass().getName() );
throw new WebApplicationException(e, Response.Status.NOT_ACCEPTABLE);
}
}