Package com.asakusafw.dmdl.windgate.csv.driver.CsvSupportTrait

Examples of com.asakusafw.dmdl.windgate.csv.driver.CsvSupportTrait.Configuration


    }

    @Override
    public void process(DmdlSemantics environment, ModelDeclaration declaration, AstAttribute attribute) {
        Map<String, AstAttributeElement> elements = AttributeUtil.getElementMap(attribute);
        Configuration conf = analyzeConfig(environment, attribute, elements);
        if (conf != null) {
            declaration.putTrait(CsvSupportTrait.class, new CsvSupportTrait(attribute, conf));
        }
    }
View Full Code Here


        AstLiteral falseRep = take(environment, elements, ELEMENT_FALSE_NAME, LiteralKind.STRING);
        AstLiteral dateFormat = take(environment, elements, ELEMENT_DATE_NAME, LiteralKind.STRING);
        AstLiteral dateTimeFormat = take(environment, elements, ELEMENT_DATE_TIME_NAME, LiteralKind.STRING);
        environment.reportAll(AttributeUtil.reportInvalidElements(attribute, elements.values()));

        Configuration result = new Configuration();
        if (charset != null && checkNotEmpty(environment, ELEMENT_CHARSET_NAME, charset)) {
            result.setCharsetName(charset.toStringValue());
        }
        if (header != null) {
            result.setEnableHeader(header.toBooleanValue());
        }
        if (trueRep != null && checkNotEmpty(environment, ELEMENT_TRUE_NAME, trueRep)) {
            result.setTrueFormat(trueRep.toStringValue());
        }
        if (falseRep != null && checkNotEmpty(environment, ELEMENT_FALSE_NAME, falseRep)) {
            result.setFalseFormat(falseRep.toStringValue());
        }
        if (dateFormat != null && checkDateFormat(environment, ELEMENT_DATE_NAME, dateFormat)) {
            result.setDateFormat(dateFormat.toStringValue());
        }
        if (dateTimeFormat != null && checkDateFormat(environment, ELEMENT_DATE_TIME_NAME, dateTimeFormat)) {
            result.setDateTimeFormat(dateTimeFormat.toStringValue());
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.windgate.csv.driver.CsvSupportTrait.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.