Examples of AstLiteral


Examples of com.asakusafw.dmdl.model.AstLiteral

        Configuration config = config();
        config.setSidColumn("SID");
        config.setTimestampColumn("TIMESTAMP");
        config.setDeleteFlagColumn("DELETE");
        config.setDeleteFlagValue(new AstLiteral(null, "TRUE", LiteralKind.BOOLEAN));
        ThunderGateModelEmitter emitter = new ThunderGateModelEmitter(config);
        emitter.emit(table);

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

        Configuration config = config();
        config.setSidColumn("SID");
        config.setTimestampColumn("TIMESTAMP");
        config.setDeleteFlagColumn("DELETE");
        config.setDeleteFlagValue(new AstLiteral(null, "TRUE", LiteralKind.BOOLEAN));
        ThunderGateModelEmitter emitter = new ThunderGateModelEmitter(config);
        emitter.emit(table);

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    }

    private void consumeTableName(
            DmdlSemantics environment, AstAttribute attribute,
            Map<String, AstAttributeElement> elements, ParquetFileTrait result) {
        AstLiteral tableName = take(environment, attribute, elements, ELEMENT_TABLE_NAME, LiteralKind.STRING);
        if (tableName != null) {
            String value = tableName.toStringValue();
            if (AttributeUtil.checkPresent(environment, tableName, label(ELEMENT_TABLE_NAME), value)) {
                result.setTableName(value);
            }
        }
    }
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    }

    private void consumeFormatVersion(
            DmdlSemantics environment, AstAttribute attribute,
            Map<String, AstAttributeElement> elements, ParquetFileTrait result) {
        AstLiteral formatVersion = take(environment, attribute, elements, ELEMENT_FORMAT_VERSION, LiteralKind.STRING);
        if (formatVersion != null) {
            String symbol = formatVersion.toStringValue();
            try {
                ParquetProperties.WriterVersion value = ParquetProperties.WriterVersion.fromString(symbol);
                result.configuration().withWriterVersion(value);
            } catch (IllegalArgumentException e) {
                environment.report(new Diagnostic(
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    }

    private <T extends Enum<?>> T consumeOption(
            DmdlSemantics environment, AstAttribute attribute, Map<String, AstAttributeElement> elements,
            String key, String description, T[] options) {
        AstLiteral literal = take(environment, attribute, elements, key, LiteralKind.STRING);
        if (literal != null) {
            String symbol = literal.toStringValue();
            T value = find(options, symbol);
            if (value == null) {
                environment.report(new Diagnostic(
                        Level.ERROR,
                        literal,
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    private Integer consumeSize(
            DmdlSemantics environment, AstAttribute attribute,
            Map<String, AstAttributeElement> elements,
            String key, long min, long max) {
        AstLiteral size = take(environment, attribute, elements, key, LiteralKind.INTEGER);
        if (size != null) {
            String label = label(key);
            BigInteger value = size.toIntegerValue();
            if (AttributeUtil.checkRange(environment, size, label, value, min, max)) {
                return value.intValue();
            }
        }
        return null;
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    }

    private void consumeEnableDictionary(
            DmdlSemantics environment, AstAttribute attribute,
            Map<String, AstAttributeElement> elements, ParquetFileTrait result) {
        AstLiteral value = take(environment, attribute, elements, ELEMENT_ENABLE_DICTIONARY, LiteralKind.BOOLEAN);
        if (value != null) {
            result.configuration().withEnableDictionary(value.toBooleanValue());
        }
    }
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

    }

    private void consumeEnableValidation(
            DmdlSemantics environment, AstAttribute attribute,
            Map<String, AstAttributeElement> elements, ParquetFileTrait result) {
        AstLiteral value = take(environment, attribute, elements, ELEMENT_ENABLE_VALIDATION, LiteralKind.BOOLEAN);
        if (value != null) {
            result.configuration().withEnableValidation(value.toBooleanValue());
        }
    }
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

                    "@{0}.{1} must be a string literal",
                    TARGET_NAME,
                    ELEMENT_NAME));
            return null;
        } else {
            AstLiteral literal = (AstLiteral) target.value;
            if (literal.kind != LiteralKind.STRING) {
                environment.report(new Diagnostic(
                        Level.ERROR,
                        target,
                        "@{0}.{1} must be a string literal",
                        TARGET_NAME,
                        ELEMENT_NAME));
                return null;
            }
            return literal.toStringValue();
        }
    }
View Full Code Here

Examples of com.asakusafw.dmdl.model.AstLiteral

        Holder holder = new Holder(environment, declaration, attribute);

        PropertySymbol sid = holder.takeProperty(SID_ELEMENT_NAME);
        PropertySymbol timestamp = holder.takeProperty(TIMESTAMP_ELEMENT_NAME);
        PropertySymbol delete = holder.takeProperty(DELETE_FLAG_ELEMENT_NAME);
        AstLiteral deleteValue = holder.takeLiteral(DELETE_FLAG_VALUE_ELEMENT_NAME);
        holder.checkEmpty();
        if (holder.sawError) {
            return;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.