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

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


            }
            return factory.newDocMethod(type, name, params);
        }

        private DocMethodParameter convert(IrDocMethodParameter elem) {
            Type type = elem.getType().accept(types, this);
            SimpleName name;
            if (elem.getName() != null) {
                name = (SimpleName) elem.getName().accept(this, null);
            } else {
                name = null;
View Full Code Here


            return;
        }

        @Override
        public Type visitArrayType(IrDocArrayType elem, Mapper context) {
            Type component = elem.getComponentType().accept(this, context);
            return context.factory.newArrayType(component);
        }
View Full Code Here

        }
        if (context.getModelKind() == ModelKind.NAMED_TYPE) {
            Name enclosed = Models.append(f, toNamedType().getName(), name);
            return chain(f.newNamedType(enclosed));
        } else {
            Type current = context;
            for (SimpleName segment : Models.toList(name)) {
                current = f.newQualifiedType(current, segment);
            }
            return chain(current);
        }
View Full Code Here

     */
    public TypeBuilder array(int dimensions) {
        if (dimensions < 0) {
            throw new IllegalArgumentException("dimensions must be greater than or equal to 0"); //$NON-NLS-1$
        }
        Type current = context;
        for (int i = 0; i < dimensions; i++) {
            current = f.newArrayType(current);
        }
        return chain(current);
    }
View Full Code Here

     */
    public Type resolvePackageMember(Name name) {
        if (name == null) {
            throw new IllegalArgumentException("name must not be null"); //$NON-NLS-1$
        }
        Type type;
        if (name.getModelKind() == ModelKind.SIMPLE_NAME) {
            type = reservePackageMember((SimpleName) name);
        } else {
            type = reservePackageMember((QualifiedName) name);
        }
View Full Code Here

            this.reserved = new HashMap<SimpleName, Name>();
        }

        @Override
        public Type visitArrayType(ArrayType elem, Void context) {
            Type component = elem.getComponentType().accept(this, null);
            if (elem.getComponentType().equals(component)) {
                return elem;
            }
            return factory.newArrayType(component);
        }
View Full Code Here

            return Character.isUpperCase(first);
        }

        @Override
        public Type visitParameterizedType(ParameterizedType elem, Void context) {
            Type nonparameterized = elem.getType().accept(this, null);
            List<Type> arguments = new ArrayList<Type>();
            for (Type t : elem.getTypeArguments()) {
                arguments.add(t.accept(this, null));
            }
            if (nonparameterized.equals(elem.getType())
                    && arguments.equals(elem.getTypeArguments())) {
                return elem;
            }
            return factory.newParameterizedType(nonparameterized, arguments);
        }
View Full Code Here

            return factory.newParameterizedType(nonparameterized, arguments);
        }

        @Override
        public Type visitQualifiedType(QualifiedType elem, Void context) {
            Type qualifier = elem.getQualifier().accept(this, null);
            if (qualifier.equals(elem.getQualifier())) {
                return elem;
            }
            return factory.newQualifiedType(qualifier, elem.getSimpleName());
        }
View Full Code Here

        @Override
        public Type visitWildcard(Wildcard elem, Void context) {
            if (elem.getBoundKind() == WildcardBoundKind.UNBOUNDED) {
                return elem;
            }
            Type bound = elem.getTypeBound().accept(this, null);
            if (bound.equals(elem.getTypeBound())) {
                return elem;
            }
            return factory.newWildcard(elem.getBoundKind(), bound);
        }
View Full Code Here

    @Override
    protected Type visitGenericArrayType(
            GenericArrayType type,
            ModelFactory context) {
        Type component = dispatch(type.getGenericComponentType(), context);
        return context.newArrayType(component);
    }
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.