Package com.asakusafw.dmdl.semantics.type

Examples of com.asakusafw.dmdl.semantics.type.BasicType


                .toStatement();
        }

        private BasicTypeKind toBasicKind(Type type) {
            assert type instanceof BasicType;
            BasicType basicType = (BasicType) type;
            return basicType.getKind();
        }
View Full Code Here


            title.setCellValue(property.getName().identifier);

            Cell value = valueRow.createCell(index);
            value.setCellStyle(info.dataStyle);
            if (property.getType() instanceof BasicType) {
                BasicType type = (BasicType) property.getType();
                switch (type.getKind()) {
                case DATE:
                    value.setCellStyle(info.dateDataStyle);
                    break;
                case DATETIME:
                    value.setCellStyle(info.datetimeDataStyle);
View Full Code Here

    public static Class<?> getValueTypeAsClass(PropertyDeclaration property) {
        if (property == null) {
            throw new IllegalArgumentException("property must not be null"); //$NON-NLS-1$
        }
        if (property.getType() instanceof BasicType) {
            BasicType bt = (BasicType) property.getType();
            switch (bt.getKind()) {
            case BOOLEAN:
                return boolean.class;
            case DATE:
                return Date.class;
            case DATETIME:
                return DateTime.class;
            case DECIMAL:
                return BigDecimal.class;
            case DOUBLE:
                return double.class;
            case FLOAT:
                return float.class;
            case BYTE:
                return byte.class;
            case SHORT:
                return short.class;
            case INT:
                return int.class;
            case LONG:
                return long.class;
            case TEXT:
                return Text.class;
            default:
                throw new IllegalArgumentException(MessageFormat.format(
                        "Unsupported basic type: {0}", //$NON-NLS-1$
                        bt.getKind()));
            }
        }
        throw new IllegalArgumentException();
    }
View Full Code Here

    private boolean isBoolean(PropertyDeclaration property) {
        assert property != null;
        if ((property.getType() instanceof BasicType) == false) {
            return false;
        }
        BasicType type = (BasicType) property.getType();
        return type.getKind() == BasicTypeKind.BOOLEAN;
    }
View Full Code Here

    @Override
    public BasicType resolve(DmdlSemantics world, AstType syntax) {
        if (syntax instanceof AstBasicType) {
            AstBasicType ast = (AstBasicType) syntax;
            return new BasicType(ast, ast.kind);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.semantics.type.BasicType

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.