Package com.asakusafw.dmdl.source.DmdlSourceRepository

Examples of com.asakusafw.dmdl.source.DmdlSourceRepository.Cursor


                    return false;
                }
                Set<String> saw = new TreeSet<String>();
                try {
                    DmdlSourceRepository repo = (DmdlSourceRepository) target;
                    Cursor cursor = repo.createCursor();
                    try {
                        while (cursor.next()) {
                            String path = cursor.getIdentifier().getRawPath();
                            if (path.endsWith("/")) {
                                path = path.substring(0, path.length() - 1);
                            }
                            String file = path.substring(path.lastIndexOf('/') + 1);
                            saw.add(file);
                        }
                    } finally {
                        cursor.close();
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    return false;
                }
View Full Code Here


        DmdlParser parser = new DmdlParser();
        DmdlAnalyzer analyzer = new DmdlAnalyzer(
                ServiceLoader.load(TypeDriver.class, serviceClassLoader),
                ServiceLoader.load(AttributeDriver.class, serviceClassLoader));
        int count = 0;
        Cursor cursor = source.createCursor();
        try {
            while (cursor.next()) {
                URI name = cursor.getIdentifier();
                LOG.info(Messages.getString("AnalyzeTask.monitorParseStarting"), name); //$NON-NLS-1$
                Reader resource = cursor.openResource();
                try {
                    AstScript script = parser.parse(resource, name);
                    for (AstModelDefinition<?> model : script.models) {
                        LOG.debug(Messages.getString("AnalyzeTask.monitorFoundModel"), model.name); //$NON-NLS-1$
                        analyzer.addModel(model);
                        count++;
                    }
                } catch (DmdlSyntaxException e) {
                    LOG.error(MessageFormat.format(
                            Messages.getString("AnalyzeTask.monitorParseFailed"), //$NON-NLS-1$
                            name), e);
                    green = false;
                } finally {
                    resource.close();
                }
            }
            LOG.debug(Messages.getString("AnalyzeTask.monitorCountModel"), count); //$NON-NLS-1$
        } finally {
            cursor.close();
        }
        if (green == false) {
            throw new IOException(MessageFormat.format(
                    Messages.getString("AnalyzeTask.errorParse"), //$NON-NLS-1$
                    processName));
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.source.DmdlSourceRepository.Cursor

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.