當前位置: 首頁>>代碼示例>>Java>>正文


Java TemplateParam類代碼示例

本文整理匯總了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);
		}
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:19,代碼來源:TemplateParamJsonMessageBodyReader.java

示例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);
	}
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:19,代碼來源:TemplateParamXmlMessageBodyReader.java

示例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);
        }
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:19,代碼來源:TemplateParamJsonMessageBodyReader.java

示例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);
    }
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:19,代碼來源:TemplateParamXmlMessageBodyReader.java

示例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;
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:12,代碼來源:TemplateParamJsonMessageBodyReader.java

示例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;
	
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:10,代碼來源:TemplateParamXmlMessageBodyReader.java

示例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;
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:12,代碼來源:TemplateParamJsonMessageBodyReader.java

示例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;
    
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:10,代碼來源:TemplateParamXmlMessageBodyReader.java


注:本文中的eu.atos.sla.service.types.TemplateParam類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。