Package com.asakusafw.dmdl

Examples of com.asakusafw.dmdl.Diagnostic


        assert environment != null;
        assert name != null;
        assert stringLiteral != null;
        assert stringLiteral.kind == LiteralKind.STRING;
        if (stringLiteral.toStringValue().isEmpty()) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    stringLiteral,
                    Messages.getString("CsvFormatDriver.diagnosticEmptyElement"), //$NON-NLS-1$
                    TARGET_NAME,
                    name));
View Full Code Here


        }
        try {
            SimpleDateFormat format = new SimpleDateFormat(stringLiteral.toStringValue());
            format.format(new java.util.Date());
        } catch (IllegalArgumentException e) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    stringLiteral,
                    Messages.getString("CsvFormatDriver.diagnosticInvalidDateFormat"), //$NON-NLS-1$
                    TARGET_NAME,
                    name));
View Full Code Here

        assert kind != null;
        AstAttributeElement element = elements.remove(elementName);
        if (element == null) {
            return null;
        } else if ((element.value instanceof AstLiteral) == false) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    element,
                    Messages.getString("CsvFormatDriver.diagnosticInvalidLiteralKind"), //$NON-NLS-1$
                    TARGET_NAME,
                    elementName,
                    kind));
            return null;
        } else {
            AstLiteral literal = (AstLiteral) element.value;
            if (literal.kind != kind) {
                environment.report(new Diagnostic(
                        Level.ERROR,
                        element,
                        Messages.getString("CsvFormatDriver.diagnosticInvalidLiteralKind"), //$NON-NLS-1$
                        TARGET_NAME,
                        elementName,
View Full Code Here

                if (kind == accept) {
                    return;
                }
            }
        }
        environment.report(new Diagnostic(
                Level.ERROR,
                attribute,
                "Invalid type for @{2} ({0}.{1}), must be one of {3}",
                declaration.getOwner().getName().identifier,
                declaration.getName().identifier,
View Full Code Here

        assert declaration != null;
        assert attribute != null;
        if (declaration.getTrait(TsvFieldTrait.class) == null) {
            return true;
        }
        environment.report(new Diagnostic(
                Level.ERROR,
                attribute,
                "Other @directio.tsv.* is already declared in {0}.{1}",
                declaration.getOwner().getName().identifier,
                declaration.getName().identifier));
View Full Code Here

            if (HiveFieldTrait.get(property).isColumnPresent() == false) {
                continue;
            }
            TypeInfo typeInfo = HiveFieldTrait.getTypeInfo(property);
            if ((typeInfo instanceof PrimitiveTypeInfo) == false) {
                environment.report(new Diagnostic(Diagnostic.Level.ERROR,
                        property.getOriginalAst(),
                        Messages.getString("OrcFileDriver.diagnosticUnsupportedPropertyType"), //$NON-NLS-1$
                        typeInfo.getQualifiedName(),
                        property.getName().identifier,
                        property.getType()));
View Full Code Here

            String symbol = formatVersion.toStringValue();
            try {
                OrcFile.Version value = OrcFile.Version.byName(symbol);
                result.configuration().withFormatVersion(value);
            } catch (IllegalArgumentException e) {
                environment.report(new Diagnostic(
                        Level.ERROR,
                        formatVersion,
                        Messages.getString("OrcFileDriver.diagnosticUnknownElement"), //$NON-NLS-1$
                        TARGET_NAME,
                        ELEMENT_FORMAT_VERSION,
View Full Code Here

        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,
                        Messages.getString("OrcFileDriver.diagnosticUnknownElement"), //$NON-NLS-1$
                        TARGET_NAME,
                        key,
View Full Code Here

        HiveFieldTrait trait = HiveFieldTrait.get(declaration);
        if (AttributeUtil.checkFieldType(environment, declaration, attribute, typeKinds) == false) {
            return false;
        }
        if (trait.getTypeKind() != HiveFieldTrait.TypeKind.NATURAL) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    attribute,
                    Messages.getString("Util.diagnosticDuplicatePropertyAttribute"), //$NON-NLS-1$
                    declaration.getOwner().getName().identifier,
                    declaration.getName().identifier));
View Full Code Here

            DmdlSemantics environment,
            Declaration declaration,
            AstAttribute attribute) {
        assert attribute.name.toString().equals(TARGET_NAME);
        if ((declaration instanceof ModelDeclaration) == false) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    declaration.getOriginalAst(),
                    "@{0} is for only for models",
                    TARGET_NAME));
            return;
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.Diagnostic

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.