当前位置: 首页>>代码示例>>Java>>正文


Java ConversionException类代码示例

本文整理汇总了Java中org.ofbiz.base.conversion.ConversionException的典型用法代码示例。如果您正苦于以下问题:Java ConversionException类的具体用法?Java ConversionException怎么用?Java ConversionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConversionException类属于org.ofbiz.base.conversion包,在下文中一共展示了ConversionException类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: retrieveData

import org.ofbiz.base.conversion.ConversionException; //导入依赖的package包/类
@Override
protected List<T> retrieveData(Integer count) {
    HttpClient httpClient = new HttpClient();
    DatabaseTestDataSettings settings = new DatabaseTestDataSettings();
    String format = properties.getProperty("demosuite.test.data.provider." + getDataGeneratorName() + ".exportFormat");
    String url = properties.getProperty("demosuite.test.data.provider." + getDataGeneratorName() + ".url") + "?";
    httpClient.setContentType("application/json");
    httpClient.setUrl(url + "&x__format=" + format + "&x__no_entries=" + count);
    ListToJSON listJsonConverter = new JSONConverters.ListToJSON();
    try {
        JSON json = listJsonConverter.convert(settings.getFields());
        Debug.log(json.toString());
        httpClient.setRawStream(json.toString());
    } catch (ConversionException e1) {
        Debug.logError(e1.getMessage(), "");
    }

    try {
        String r = httpClient.sendHttpRequest(settings.getMethod());
        return handleData(r, format);

    } catch (HttpClientException e) {
        throw new RuntimeException(e);
    }

}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:27,代码来源:DatabaseTestDataDataGenerator.java

示例2: retrieveData

import org.ofbiz.base.conversion.ConversionException; //导入依赖的package包/类
@Override
protected List<T> retrieveData(Integer count) {
    HttpClient httpClient = new HttpClient();
    MockarooSettings settings = new MockarooSettings();
    String format = properties.getProperty("demosuite.test.data.provider." + getDataGeneratorName() + ".exportFormat");
    String url = properties.getProperty("demosuite.test.data.provider." + getDataGeneratorName() + ".url") + format + "?key="
            + settings.getQueryParameters().get("key");
    httpClient.setContentType("application/json");
    httpClient.setUrl(url + "&count=" + count + "&array=true");
    ListToJSON listJsonConverter = new JSONConverters.ListToJSON();
    try {
        JSON json = listJsonConverter.convert(settings.getFields());
        Debug.log(json.toString());
        httpClient.setRawStream(json.toString());
    } catch (ConversionException e1) {
        Debug.logError(e1.getMessage(), "");
    }

    try {
        String r = httpClient.sendHttpRequest(settings.getMethod());
        return handleData(r, format);

    } catch (HttpClientException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:27,代码来源:MockarooDataGenerator.java

示例3: convert

import org.ofbiz.base.conversion.ConversionException; //导入依赖的package包/类
public JSON convert(GenericValue obj) throws ConversionException {
    Map<String, Object> fieldMap = new HashMap<String, Object>(obj);
    fieldMap.put("_DELEGATOR_NAME_", obj.getDelegator().getDelegatorName());
    fieldMap.put("_ENTITY_NAME_", obj.getEntityName());
    try {
        return JSON.from(fieldMap);
    } catch (IOException e) {
        throw new ConversionException(e);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:11,代码来源:Converters.java

示例4: exec

import org.ofbiz.base.conversion.ConversionException; //导入依赖的package包/类
@Override
public boolean exec(MethodContext methodContext) throws MiniLangException {
    try {
        this.fieldFma.put(methodContext.getEnvMap(), this.converter.convert(System.currentTimeMillis()));
    } catch (ConversionException e) {
        throw new MiniLangRuntimeException(e.getMessage(), this);
    }
    return true;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:10,代码来源:Now.java

示例5: convert

import org.ofbiz.base.conversion.ConversionException; //导入依赖的package包/类
public String convert(SpecialNumber obj) throws ConversionException {
    throw new NullPointerException();
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:4,代码来源:FlexibleStringExpanderTests.java

示例6: convert

import org.ofbiz.base.conversion.ConversionException; //导入依赖的package包/类
public String convert(MimeMessageWrapper obj) throws ConversionException {
    return obj.toString();
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:4,代码来源:MimeMessageWrapper.java

示例7: convert

import org.ofbiz.base.conversion.ConversionException; //导入依赖的package包/类
public List<GenericValue> convert(GenericValue obj) throws ConversionException {
    List<GenericValue> tempList = new LinkedList<GenericValue>();
    tempList.add(obj);
    return tempList;
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:6,代码来源:Converters.java

示例8: log

import org.ofbiz.base.conversion.ConversionException; //导入依赖的package包/类
public static void log(int level, Throwable t, String msg, String module, String callingClass, Object... params) {
    if (isOn(level)) {
        if (msg != null && params.length > 0) {
            StringBuilder sb = new StringBuilder();
            Formatter formatter = new Formatter(sb);
            formatter.format(msg, params);
            msg = sb.toString();
        }

        // log
        if (useLog4J) {
            Logger logger = getLogger(module);
            //callingClass
            logger.log(levelObjs[level], msg, t);
        } else {
            StringBuilder prefixBuf = new StringBuilder();

            DateToString dateToString = new DateToString(); 
            try {
                prefixBuf.append(dateToString.convert(new java.util.Date(), Locale.getDefault(), 
                        TimeZone.getDefault(), UtilDateTime.DATE_TIME_FORMAT));
            } catch (ConversionException e) {
                logFatal(e, Debug.class.getName());
            }
            prefixBuf.append(" [OFBiz");
            if (module != null) {
                prefixBuf.append(":");
                prefixBuf.append(module);
            }
            prefixBuf.append(":");
            prefixBuf.append(levels[level]);
            prefixBuf.append("] ");
            if (msg != null) {
                getPrintWriter().print(prefixBuf.toString());
                getPrintWriter().println(msg);
            }
            if (t != null) {
                getPrintWriter().print(prefixBuf.toString());
                getPrintWriter().println("Received throwable:");
                t.printStackTrace(getPrintWriter());
            }
        }
    }
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:45,代码来源:Debug.java


注:本文中的org.ofbiz.base.conversion.ConversionException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。