Package com.asakusafw.utils.java.model.syntax

Examples of com.asakusafw.utils.java.model.syntax.Type


     * @return 対応する結果型
     * @throws IllegalArgumentException 引数に{@code null}が指定された場合
     */
    public Type toSourceType(TypeMirror type) {
        Precondition.checkMustNotBeNull(type, "type"); //$NON-NLS-1$
        Type source = t(Source.class);
        Type modelType = t(type);
        return factory.newParameterizedType(source, Collections.singletonList(modelType));
    }
View Full Code Here


     * @return 対応する入力型
     * @throws IllegalArgumentException 引数に{@code null}が指定された場合
     */
    public Type toInType(TypeMirror type) {
        Precondition.checkMustNotBeNull(type, "type"); //$NON-NLS-1$
        Type source = t(In.class);
        Type modelType = t(type);
        return factory.newParameterizedType(source, Collections.singletonList(modelType));
    }
View Full Code Here

     * @return 対応する出力型
     * @throws IllegalArgumentException 引数に{@code null}が指定された場合
     */
    public Type toOutType(TypeMirror type) {
        Precondition.checkMustNotBeNull(type, "type"); //$NON-NLS-1$
        Type source = t(Out.class);
        Type modelType = t(type);
        return factory.newParameterizedType(source, Collections.singletonList(modelType));
    }
View Full Code Here

            statements.add(new ExpressionBuilder(factory, Models.toNullLiteral(factory))
                .toLocalVariableDeclaration(t(Map.class, t(String.class), t(String.class)), attributes));

            for (CopyDescription slot : slots) {
                SourceInfo info = slot.getInput();
                Type mapperType = generateMapper(slot);
                Type formatClass = t(info.getFormat());
                statements.add(new ExpressionBuilder(factory, attributes)
                    .assignFrom(new TypeBuilder(factory, t(HashMap.class, t(String.class), t(String.class)))
                        .newObject()
                        .toExpression())
                    .toStatement());
View Full Code Here

        }

        private Type t(java.lang.reflect.Type type, Type...typeArgs) {
            assert type != null;
            assert typeArgs != null;
            Type raw = importer.toType(type);
            if (typeArgs.length == 0) {
                return raw;
            }
            return factory.newParameterizedType(raw, Arrays.asList(typeArgs));
        }
View Full Code Here

        }

        private Type t(java.lang.reflect.Type type, Type...typeArgs) {
            assert type != null;
            assert typeArgs != null;
            Type raw = importer.toType(type);
            if (typeArgs.length == 0) {
                return raw;
            }
            return factory.newParameterizedType(raw, Arrays.asList(typeArgs));
        }
View Full Code Here

         * 演算子実装クラスのインスタンスを生成し、それを参照するための式を返す。
         * @return 生成した式
         */
        public Expression createImplementation() {
            Class<?> implementing = description.getDeclaration().getImplementing();
            Type type = convert(implementing);
            return addField(type, "op", new TypeBuilder(factory, type)
                .newObject()
                .toExpression());
        }
View Full Code Here

            DataClass data = environment.getDataClasses().load(type);
            if (data == null) {
                environment.error("{0}のデータモデルを解析できませんでした", type);
                data = new DataClass.Unresolved(factory, type);
            }
            Type domType = importer.toType(type);
            Expression cache = addField(
                    domType,
                    "cache",
                    data.createNewInstance(domType));
            return new DataObjectMirror(factory, cache, data);
View Full Code Here

         * @throws IllegalArgumentException 引数に{@code null}が指定された場合
         */
        public ListBufferMirror createListBuffer(java.lang.reflect.Type type, InputBuffer bufferKind) {
            Precondition.checkMustNotBeNull(type, "type"); //$NON-NLS-1$
            Precondition.checkMustNotBeNull(bufferKind, "bufferKind"); //$NON-NLS-1$
            Type elementType = importer.toType(type);
            Class<?> bufferType = inputBufferTypeFromKind(bufferKind);
            Type listType = importer.resolve(factory.newParameterizedType(
                    Models.toType(factory, bufferType),
                    Collections.singletonList(elementType)));
            Expression list = addField(
                    listType,
                    "list",
View Full Code Here

                    util.t(var.getType().getRepresentation()),
                    name));
            parameterMetaData.add(util.toMetaData(var, arguments.size()));
            arguments.add(name);
        }
        Type type = getType(objectType);
        javadoc.returns().text("生成した演算子オブジェクト");
        javadoc.seeType(util.t(flowClass.getElement()));
        return factory.newMethodDeclaration(
                javadoc.toJavadoc(),
                new AttributeBuilder(factory)
View Full Code Here

TOP

Related Classes of com.asakusafw.utils.java.model.syntax.Type

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.