Debian Codegraph @

src/com/google/debugging/sourcemap/SourceMapGeneratorFactory.java

raw symbols SCIP
1 /*
2 * Copyright 2009 The Closure Compiler Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package com.google.debugging.sourcemap;
17
18 /**
19 * @author [email protected] (John Lenz)
20 */
21 public class SourceMapGeneratorFactory {
22
23 /**
24 * @return The appropriate source map object for the given source map format.
25 */
26 public static SourceMapGenerator getInstance() {
27 return getInstance(SourceMapFormat.DEFAULT);
28 }
29
30 /**
31 * @return The appropriate source map object for the given source map format.
32 */
33 public static SourceMapGenerator getInstance(SourceMapFormat format) {
34 switch (format) {
35 case V1:
36 return new SourceMapGeneratorV1();
37 case V2:
38 return new SourceMapGeneratorV2();
39 case DEFAULT:
40 case V3:
41 return new SourceMapGeneratorV3();
42 default:
43 throw new IllegalStateException("unsupported source map format");
44 }
45 }
46 }