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

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


                outputName,
        });
        Engine engine = new Engine(environment, moduleId, outputName, index, dataType, orderingInfo);
        CompilationUnit source = engine.generate();
        environment.emit(source);
        Name packageName = source.getPackageDeclaration().getName();
        SimpleName simpleName = source.getTypeDeclarations().get(0).getName();
        QualifiedName name = environment
            .getModelFactory()
            .newQualifiedName(packageName, simpleName);
        LOG.debug("Finish preparing output file orderer: batch={}, flow={}, output={}, class={}", new Object[] {
View Full Code Here


            return factory.newSimpleName(elem.getIdentifier());
        }

        @Override
        public DocElement visitQualifiedName(IrDocQualifiedName elem, Void context) {
            Name qualifier = (Name) elem.getQualifier().accept(this, null);
            SimpleName simple = (SimpleName) elem.getName().accept(this, null);
            return factory.newQualifiedName(qualifier, simple);
        }
View Full Code Here

                elem.isVariableArity());
        }

        @Override
        public DocElement visitNamedType(IrDocNamedType elem, Void context) {
            Name name = (Name) elem.getName().accept(this, null);
            return factory.newNamedType(name);
        }
View Full Code Here

            return context.factory.newBasicType(kind);
        }

        @Override
        public Type visitNamedType(IrDocNamedType elem, Mapper context) {
            Name name = (Name) elem.getName().accept(context, null);
            return context.factory.newNamedType(name);
        }
View Full Code Here

    @Override
    public List<SimpleName> toNameList() {
        LinkedList<SimpleName> result = new LinkedList<SimpleName>();
        result.addFirst(getSimpleName());
        Name current = getQualifier();
        while (current.getModelKind() == ModelKind.QUALIFIED_NAME) {
            QualifiedName qname = (QualifiedName) current;
            result.addFirst(qname.getSimpleName());
            current = qname.getQualifier();
        }
        assert current.getModelKind() == ModelKind.SIMPLE_NAME;
        result.addFirst((SimpleName) current);
        return result;
    }
View Full Code Here

        ModelKind kind = name.getModelKind();
        if (kind == ModelKind.SIMPLE_NAME) {
            return Collections.singletonList((SimpleName) name);
        } else {
            LinkedList<SimpleName> result = new LinkedList<SimpleName>();
            Name current = name;
            do {
                QualifiedName qname = (QualifiedName) current;
                result.addFirst(qname.getSimpleName());
                current = qname.getQualifier();
            } while (current.getModelKind() == ModelKind.QUALIFIED_NAME);

            assert current.getModelKind() == ModelKind.SIMPLE_NAME;
            result.addFirst((SimpleName) current);

            return result;
        }
    }
View Full Code Here

            throw new IllegalArgumentException("prefix must not be null"); //$NON-NLS-1$
        }
        if (rest == null) {
            throw new IllegalArgumentException("rest must not be null"); //$NON-NLS-1$
        }
        Name name = Models.toName(factory, rest);
        return append(factory, prefix, name);
    }
View Full Code Here

            throw new IllegalArgumentException("names must have elements"); //$NON-NLS-1$
        }
        if (names.length == 1) {
            return names[0];
        }
        Name current = names[0];
        for (int i = 1; i < names.length; i++) {
            for (SimpleName segment : toList(names[i])) {
                current = factory.newQualifiedName(current, segment);
            }
        }
View Full Code Here

        }
        String[] segments = nameString.trim().split("\\s*\\.\\s*"); //$NON-NLS-1$
        if (segments.length == 0 || segments[0].length() == 0) {
            throw new IllegalArgumentException("nameString is empty"); //$NON-NLS-1$
        }
        Name left = factory.newSimpleName(segments[0]);
        for (int i = 1; i < segments.length; i++) {
            SimpleName right = factory.newSimpleName(segments[i]);
            left = factory.newQualifiedName(left, right);
        }
        return left;
View Full Code Here

            throw new IllegalArgumentException("factory must not be null"); //$NON-NLS-1$
        }
        if (constant == null) {
            throw new IllegalArgumentException("constant must not be null"); //$NON-NLS-1$
        }
        Name typeName = toName(factory, constant.getDeclaringClass().getName());
        return factory.newQualifiedName(
                typeName,
                factory.newSimpleName(constant.name()));
    }
View Full Code Here

TOP

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

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.