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


Java ValidationException类代码示例

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


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

示例1: ResultToField

import org.ofbiz.minilang.ValidationException; //导入依赖的package包/类
private ResultToField(Element element, SimpleMethod simpleMethod) throws ValidationException {
    if (MiniLangValidate.validationOn()) {
        MiniLangValidate.attributeNames(simpleMethod, element, "result-name", "field");
        MiniLangValidate.requiredAttributes(simpleMethod, element, "result-name");
        MiniLangValidate.expressionAttributes(simpleMethod, element, "result-name", "field");
        MiniLangValidate.noChildElements(simpleMethod, element);
    }
    this.resultNameFma = FlexibleMapAccessor.getInstance(element.getAttribute("result-name"));
    String fieldAttribute = element.getAttribute("field");
    if (fieldAttribute.length() == 0) {
        this.fieldFma = this.resultNameFma;
    } else {
        this.fieldFma = FlexibleMapAccessor.getInstance(fieldAttribute);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:16,代码来源:CallSimpleMethod.java

示例2: Now

import org.ofbiz.minilang.ValidationException; //导入依赖的package包/类
public Now(Element element, SimpleMethod simpleMethod) throws MiniLangException {
    super(element, simpleMethod);
    if (MiniLangValidate.validationOn()) {
        String tagName = element.getTagName();
        if ("now-date-to-env".equals(tagName) || "now-timestamp".equals(tagName)) {
            MiniLangValidate.handleError("Deprecated - use <now>", simpleMethod, element);
        }
        MiniLangValidate.attributeNames(simpleMethod, element, "field", "type");
        MiniLangValidate.requiredAttributes(simpleMethod, element, "field");
        MiniLangValidate.expressionAttributes(simpleMethod, element, "field");
        MiniLangValidate.constantAttributes(simpleMethod, element, "type");
        MiniLangValidate.noChildElements(simpleMethod, element);
    }
    boolean elementModified = autoCorrect(element);
    if (elementModified && MiniLangUtil.autoCorrectOn()) {
        MiniLangUtil.flagDocumentAsCorrected(element);
    }
    this.fieldFma = FlexibleMapAccessor.getInstance(element.getAttribute("field"));
    this.type = element.getAttribute("type");
    Class<?> targetClass = null;
    try {
        if (!this.type.isEmpty()) {
            targetClass = ObjectType.loadClass(this.type);
        }
        if (targetClass == null) {
            targetClass = java.sql.Timestamp.class;
        }
        this.converter = Converters.getConverter(Long.class, targetClass);
    } catch (ClassNotFoundException e) {
        throw new ValidationException(e.getMessage(), simpleMethod, element);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:33,代码来源:Now.java


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