Promote SchemaSourceRepresentation
[yangtools.git] / parser / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / ReactorException.java
1 /*
2  * Copyright (c) 2015 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.parser.spi.meta;
9
10 import static java.util.Objects.requireNonNull;
11
12 import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier;
13
14 public class ReactorException extends Exception {
15     private static final long serialVersionUID = 1L;
16
17     private final ModelProcessingPhase phase;
18     private final SourceIdentifier sourceIdentifier;
19
20     public ReactorException(final ModelProcessingPhase phase, final String message, final SourceIdentifier sourceId,
21             final Throwable cause) {
22         super(message, cause);
23         this.phase = requireNonNull(phase);
24         sourceIdentifier = sourceId;
25     }
26
27     public ReactorException(final ModelProcessingPhase phase, final String message, final SourceIdentifier sourceId) {
28         super(message);
29         this.phase = requireNonNull(phase);
30         sourceIdentifier = sourceId;
31     }
32
33     public final ModelProcessingPhase getPhase() {
34         return phase;
35     }
36
37     public final SourceIdentifier getSourceIdentifier() {
38         return sourceIdentifier;
39     }
40 }