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

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


            Expression context,
            ShuffleModel.Segment value) {
        assert node != null;
        assert context != null;
        assert value != null;
        Type type = importer.toType(value.getCompiled().getMapOutputType().getQualifiedName());
        return factory.newLocalVariableDeclaration(
                new AttributeBuilder(factory)
                    .Final()
                    .toAttributes(),
                type,
View Full Code Here


    }

    private Statement setupOutput(FragmentNode node, StageModel.Sink value) {
        assert node != null;
        assert value != null;
        Type type = importer.resolve(factory.newParameterizedType(
                Models.toType(factory, Result.class),
                Models.toType(factory, value.getType())));
        return factory.newLocalVariableDeclaration(
                new AttributeBuilder(factory)
                    .Final()
View Full Code Here

            TypeDeclaration objectClass = createObjectClass(context, descriptor);
            if (objectClass == null) {
                continue;
            }

            Type objectType = importer.resolvePackageMember(
                    Models.append(factory, getClassName(), objectClass.getName()));
            if (context.element.getTypeParameters().isEmpty() == false) {
                objectType = new TypeBuilder(factory, objectType)
                        .parameterize(util.toTypeVariables(context.element))
                        .toType();
View Full Code Here

    }

    private MethodDeclaration createRenamer(Context context, NamedType rawObjectType) {
        assert context != null;
        assert rawObjectType != null;
        Type objectType;
        if (context.element.getTypeParameters().isEmpty()) {
            objectType = rawObjectType;
        } else {
            objectType = new TypeBuilder(factory, rawObjectType)
                .parameterize(util.toTypeVariables(context.element))
View Full Code Here

            ConstructorDeclaration ctor = connection.createConstructor(name);
            MethodDeclaration method = createBody();
            members.addAll(extraFields);
            members.add(ctor);
            members.add(method);
            Type inputType = createInputType();
            return factory.newClassDeclaration(
                    createJavadoc(),
                    new AttributeBuilder(factory)
                        .annotation(t(TraceLocation.class), createTraceLocationElements())
                        .annotation(t(SuppressWarnings.class), v("deprecation"))
View Full Code Here

            Expression start,
            Expression length) {
        Precondition.checkMustNotBeNull(bytes, "bytes"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(start, "start"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(length, "length"); //$NON-NLS-1$
        Type type = factory.newNamedType(Models.toName(factory, optionClass.getName()));
        return new TypeBuilder(factory, type)
            .method("getBytesLength", bytes, start, length)
            .toExpression();
    }
View Full Code Here

        Precondition.checkMustNotBeNull(start1, "start1"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(length1, "length1"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(bytes2, "bytes2"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(start2, "start2"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(length2, "length2"); //$NON-NLS-1$
        Type type = factory.newNamedType(Models.toName(factory, optionClass.getName()));
        return new TypeBuilder(factory, type)
            .method("compareBytes",
                    bytes1, start1, length1,
                    bytes2, start2, length2)
            .toExpression();
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 factory.newQualifiedName(qualifier, simple);
        }

        @Override
        public DocElement visitField(IrDocField elem, Void context) {
            Type type = declaring(elem.getDeclaringType());
            SimpleName name = (SimpleName) elem.getName().accept(this, null);
            return factory.newDocField(type, name);
        }
View Full Code Here

            return factory.newDocField(type, name);
        }

        @Override
        public DocElement visitMethod(IrDocMethod elem, Void context) {
            Type type = declaring(elem.getDeclaringType());
            SimpleName name = (SimpleName) elem.getName().accept(this, null);
            List<DocMethodParameter> params = new ArrayList<DocMethodParameter>();
            for (IrDocMethodParameter p : elem.getParameters()) {
                params.add(convert(p));
            }
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.