Package org.slim3.gen.datastore

Examples of org.slim3.gen.datastore.DataType.accept()


        public Void visitLinkedHashSetType(
                final LinkedHashSetType collectionType,
                final AttributeMetaDesc attr) throws RuntimeException {
            DataType elementType = collectionType.getElementType();
            Boolean handled =
                elementType.accept(
                    new SimpleDataTypeVisitor<Boolean, Void, RuntimeException>(
                        false) {

                        @Override
                        public Boolean visitCoreReferenceType(
View Full Code Here


        @Override
        public Void visitSortedSetType(final SortedSetType collectionType,
                final AttributeMetaDesc attr) throws RuntimeException {
            DataType elementType = collectionType.getElementType();
            Boolean handled =
                elementType.accept(
                    new SimpleDataTypeVisitor<Boolean, Void, RuntimeException>(
                        false) {

                        @Override
                        public Boolean visitCoreReferenceType(
View Full Code Here

                    .getAttributeMetaDescList()) {
                    if (attr.isPrimaryKey()) {
                        continue;
                    }
                    DataType dataType = attr.getDataType();
                    dataType.accept(this, attr);
                }
                int schemaVersion = modelMetaDesc.getSchemaVersion();
                if (schemaVersion > 0) {
                    printer.println(
                        "entity.setProperty(\"%1$s\", %2$s);",
View Full Code Here

        @Override
        public Void visitArrayType(ArrayType type, final AttributeMetaDesc attr)
                throws RuntimeException {
            DataType componentType = type.getComponentType();
            boolean accepted =
                componentType.accept(
                    new SimpleDataTypeVisitor<Boolean, Void, RuntimeException>(
                        false) {

                        @Override
                        public Boolean visitPrimitiveByteType(
View Full Code Here

                        .getAttributeMetaDescList()) {
                        if (attr.isPrimaryKey()) {
                            continue;
                        }
                        DataType dataType = attr.getDataType();
                        dataType.accept(this, attr);
                    }
                }
            }
            printer.unindent();
            printer.println("}");
View Full Code Here

                    }
                    printer
                        .println("writer.setNextPropertyName(\"%1$s\");", name);
                    printer.println("encoder = new %s();", ja
                        .getCoderClassName());
                    dataType.accept(this, attr);
                    for (int i = 0; i < indent; i++) {
                        printer.unindent();
                        printer.println("}");
                    }
                }
View Full Code Here

            printer.println("writer.beginArray();");
            printer.println("for(%s v : %s){", et.getClassName(), valueExp);
            printer.indent();
            ModelToJsonMethodGenerator gen =
                new ModelToJsonMethodGenerator(printer, "v");
            et.accept(gen, p);
            for (int i = 0; i < gen.indent; i++) {
                printer.unindent();
                printer.println("}");
            }
            printer.unindent();
View Full Code Here

                printer.println("for(%s v : %s){"
                        , et.getClassName(), valueExp);
                printer.indent();
                ModelToJsonMethodGenerator gen = new ModelToJsonMethodGenerator(
                    printer, "v");
                et.accept(gen, p);
                for(int i = 0; i < gen.indent; i++){
                    printer.unindent();
                    printer.println("}");
                }
                printer.unindent();
View Full Code Here

                        name);
                    printer.println("decoder = new %s();", ja
                        .getCoderClassName());
                    setterExp = "m." + attr.getWriteMethodName();
                    getterExp = "m." + attr.getReadMethodName() + "()";
                    dt.accept(this, attr);
                }
                printer.unindent();
                printer.println("return m;");
            }
            printer.unindent();
View Full Code Here

                    modelMetaDesc.getModelClassName());
        } else {
            printer.println("    %1$s m = (%1$s) model;", modelMetaDesc
                .getModelClassName());
            DataType dataType = attr.getDataType();
            dataType.accept(
                new SimpleDataTypeVisitor<Void, Void, RuntimeException>() {

                    @Override
                    protected Void defaultAction(DataType type, Void p)
                            throws RuntimeException {
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.