Package com.asakusafw.dmdl

Examples of com.asakusafw.dmdl.Diagnostic


        assert declaration != null;
        assert attribute != null;
        if (declaration.getTrait(CsvFieldTrait.class) == null) {
            return true;
        }
        environment.report(new Diagnostic(
                Level.ERROR,
                attribute,
                Messages.getString("CsvFieldDriver.diagnosticDuplicateAttribute"), //$NON-NLS-1$
                declaration.getOwner().getName().identifier,
                declaration.getName().identifier));
View Full Code Here


                if (kind == accept) {
                    return;
                }
            }
        }
        environment.report(new Diagnostic(
                Level.ERROR,
                attribute,
                Messages.getString("CsvFieldDriver.diagnosticInvalidTypeElement"), //$NON-NLS-1$
                declaration.getOwner().getName().identifier,
                declaration.getName().identifier,
View Full Code Here

        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("CsvSupportDriver.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("CsvSupportDriver.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("CsvSupportDriver.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("CsvSupportDriver.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(CsvFieldTrait.class) == null) {
            return true;
        }
        environment.report(new Diagnostic(
                Level.ERROR,
                attribute,
                Messages.getString("CsvFieldDriver.diagnosticDuplicateModelAttribute"), //$NON-NLS-1$
                declaration.getOwner().getName().identifier,
                declaration.getName().identifier));
View Full Code Here

                if (kind == accept) {
                    return;
                }
            }
        }
        environment.report(new Diagnostic(
                Level.ERROR,
                attribute,
                Messages.getString("CsvFieldDriver.diagnosticInvalidType"), //$NON-NLS-1$
                declaration.getOwner().getName().identifier,
                declaration.getName().identifier,
View Full Code Here

        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,
                    "@{0}({1}) must not be empty",
                    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,
                    "@{0}({1}) must be a string literal",
                    TARGET_NAME,
                    elementName));
            return null;
        } else {
            AstLiteral literal = (AstLiteral) element.value;
            if (literal.kind != kind) {
                environment.report(new Diagnostic(
                        Level.ERROR,
                        element,
                        "@{0}({1}) must be a string literal",
                        TARGET_NAME,
                        elementName));
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.