Do not declare URISyntaxException as thrown
[yangtools.git] / yang-validation-tool / src / main / java / org / opendaylight / yangtools / yang / validation / tool / Main.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.validation.tool;
9
10 import java.io.File;
11 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
14
15 public final class Main {
16     private static final Logger LOG = LoggerFactory.getLogger(Main.class);
17
18     private Main() {
19
20     }
21
22     public static void main(final String[] args) {
23         final Params params = ParamsUtil.parseArgs(args, Params.getParser());
24
25         if (params.isValid()) {
26             final File[] yangModels = params.getYangSourceDir().listFiles();
27
28             try {
29                 YangParserTestUtils.parseYangFiles(yangModels);
30             } catch (Exception e) {
31                 LOG.error("Yang files could not be parsed.", e);
32             }
33         }
34     }
35 }