source: josm/trunk/src/org/openstreetmap/josm/data/projection/proj/ClassProjFactory.java@ 5230

Last change on this file since 5230 was 5227, checked in by bastiK, 12 years ago

finish custom projection

File size: 725 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.projection.proj;
3
4/**
5 * Proj Factory that creates instances from a given class.
6 */
7public class ClassProjFactory implements ProjFactory {
8
9 private Class<? extends Proj> projClass;
10
11 public ClassProjFactory(Class<? extends Proj> projClass) {
12 this.projClass = projClass;
13 }
14
15 @Override
16 public Proj createInstance() {
17 Proj proj = null;
18 try {
19 proj = projClass.newInstance();
20 } catch (InstantiationException e) {
21 throw new RuntimeException(e);
22 } catch (IllegalAccessException e) {
23 throw new RuntimeException(e);
24 }
25 return proj;
26 }
27}
Note: See TracBrowser for help on using the repository browser.