本文整理匯總了Java中eu.atos.sla.service.types.TemplateParam類的典型用法代碼示例。如果您正苦於以下問題:Java TemplateParam類的具體用法?Java TemplateParam怎麽用?Java TemplateParam使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TemplateParam類屬於eu.atos.sla.service.types包,在下文中一共展示了TemplateParam類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
}
示例5: isReadable
import eu.atos.sla.service.types.TemplateParam; //導入依賴的package包/類
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
initParser();
boolean isUsed = (type == TemplateParam.class) &&
mediaType.toString().contains(MediaType.APPLICATION_JSON) &&
jsonParser!=null;
if (isUsed)
logger.debug("isReadable: {} -->type:{} genericType:{} mediaType:{} with parser:{}",
isUsed, type, genericType, mediaType, jsonParser);
return isUsed;
}
示例6: isReadable
import eu.atos.sla.service.types.TemplateParam; //導入依賴的package包/類
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
initParser();
boolean isUsed = (type == TemplateParam.class) && mediaType.toString().contains(MediaType.APPLICATION_XML);
logger.debug("isReadable: {} -->type:{} genericType:{} mediaType:{} with parser:{}",
isUsed, type, genericType, mediaType, xmlParser);
return isUsed;
}
示例7: isReadable
import eu.atos.sla.service.types.TemplateParam; //導入依賴的package包/類
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
initParser();
boolean isUsed = (type == TemplateParam.class) &&
mediaType.toString().contains(MediaType.APPLICATION_JSON) &&
jsonParser!=null;
if (isUsed)
logger.debug("isReadable: {} -->type:{} genericType:{} mediaType:{} with parser:{}",
isUsed, type, genericType, mediaType, jsonParser);
return isUsed;
}
示例8: isReadable
import eu.atos.sla.service.types.TemplateParam; //導入依賴的package包/類
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
initParser();
boolean isUsed = (type == TemplateParam.class) && mediaType.toString().contains(MediaType.APPLICATION_XML);
logger.debug("isReadable: {} -->type:{} genericType:{} mediaType:{} with parser:{}",
isUsed, type, genericType, mediaType, xmlParser);
return isUsed;
}