Package com.asakusafw.dmdl.model

Examples of com.asakusafw.dmdl.model.AstDescription


            List<Statement> statements = Lists.create();
            SimpleName builder = f.newSimpleName("builder"); //$NON-NLS-1$
            statements.add(new TypeBuilder(f, context.resolve(DataModelDescriptorBuilder.class))
                    .newObject(f.newClassLiteral(context.resolve(model.getSymbol())))
                    .toLocalVariableDeclaration(context.resolve(DataModelDescriptorBuilder.class), builder));
            AstDescription description = model.getDescription();
            if (description != null) {
                statements.add(new ExpressionBuilder(f, builder)
                        .method("comment", Models.toLiteral(f, description.getText())) //$NON-NLS-1$
                        .toStatement());
            }
            for (PropertyDeclaration property : model.getDeclaredProperties()) {
                HiveFieldTrait field = HiveFieldTrait.get(property);
                if (field.isColumnPresent() == false) {
View Full Code Here


        private Expression createNewPropertyDescriptor(PropertyDeclaration property) {
            Expression columnName = Models.toLiteral(f, HiveFieldTrait.getColumnName(property));
            Expression typeDesc = computeValueType(property);
            Expression comment = null;
            AstDescription description = property.getDescription();
            if (description == null) {
                comment = Models.toNullLiteral(f);
            } else {
                comment = Models.toLiteral(f, description.getText());
            }
            SimpleName dataModel = f.newSimpleName("dataModel"); //$NON-NLS-1$
            ClassBody block = f.newClassBody(Arrays.asList(f.newMethodDeclaration(
                    null,
                    new AttributeBuilder(f)
View Full Code Here

     */
    public String getDescription(Declaration declaration) {
        if (declaration == null) {
            throw new IllegalArgumentException("declaration must not be null"); //$NON-NLS-1$
        }
        AstDescription description = declaration.getDescription();
        if (description == null) {
            return declaration.getName().identifier;
        } else {
            return description.getText();
        }
    }
View Full Code Here

            throw new IllegalArgumentException("pattern must not be null"); //$NON-NLS-1$
        }
        if (arguments == null) {
            throw new IllegalArgumentException("arguments must not be null"); //$NON-NLS-1$
        }
        return new AstDescription(
                null,
                AstLiteral.quote(MessageFormat.format(pattern, (Object[]) arguments)));
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.model.AstDescription

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.