Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/ManualPointsArtifact.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | 8d5ca5175038 |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
35 extends StaticD4EArtifact | 35 extends StaticD4EArtifact |
36 implements FacetTypes, WaterLineArtifact | 36 implements FacetTypes, WaterLineArtifact |
37 { | 37 { |
38 private static final long serialVersionUID = 7096025125474986011L; | 38 private static final long serialVersionUID = 7096025125474986011L; |
39 | 39 |
40 /** The logger for this class. */ | 40 /** The log for this class. */ |
41 private static Logger logger = Logger.getLogger(ManualPointsArtifact.class); | 41 private static Logger log = Logger.getLogger(ManualPointsArtifact.class); |
42 | 42 |
43 /** The name of the artifact. */ | 43 /** The name of the artifact. */ |
44 public static final String ARTIFACT_NAME = "manualpoints"; | 44 public static final String ARTIFACT_NAME = "manualpoints"; |
45 | 45 |
46 | 46 |
47 public ManualPointsArtifact() { | 47 public ManualPointsArtifact() { |
48 logger.debug("ManualPointsArtifact.ManualPointsArtifact()"); | 48 log.debug("ManualPointsArtifact.ManualPointsArtifact()"); |
49 } | 49 } |
50 | 50 |
51 | 51 |
52 /** | 52 /** |
53 * Gets called from factory to set things up. | 53 * Gets called from factory to set things up. |
59 Object context, | 59 Object context, |
60 CallMeta callMeta, | 60 CallMeta callMeta, |
61 Document data, | 61 Document data, |
62 List<Class> loadFacets) | 62 List<Class> loadFacets) |
63 { | 63 { |
64 logger.debug("ManualPointsArtifact.setup"); | 64 log.debug("ManualPointsArtifact.setup"); |
65 super.setup(identifier, factory, context, callMeta, data, loadFacets); | 65 super.setup(identifier, factory, context, callMeta, data, loadFacets); |
66 initialize(null, context, callMeta); | 66 initialize(null, context, callMeta); |
67 } | 67 } |
68 | 68 |
69 | 69 |
95 | 95 |
96 | 96 |
97 /** Setup state and facet. */ | 97 /** Setup state and facet. */ |
98 @Override | 98 @Override |
99 protected void initialize(Artifact artifact, Object context, CallMeta meta) { | 99 protected void initialize(Artifact artifact, Object context, CallMeta meta) { |
100 logger.debug("ManualPointsArtifact.initialize"); | 100 log.debug("ManualPointsArtifact.initialize"); |
101 List<Facet> fs = new ArrayList<Facet>(); | 101 List<Facet> fs = new ArrayList<Facet>(); |
102 | 102 |
103 DefaultState state = (DefaultState) getCurrentState(context); | 103 DefaultState state = (DefaultState) getCurrentState(context); |
104 state.computeInit(this, hash(), context, meta, fs); | 104 state.computeInit(this, hash(), context, meta, fs); |
105 if (!fs.isEmpty()) { | 105 if (!fs.isEmpty()) { |
106 logger.debug("Facets to add in ManualPointsArtifact.initialize ."); | 106 log.debug("Facets to add in ManualPointsArtifact.initialize ."); |
107 addFacets(getCurrentStateId(), fs); | 107 addFacets(getCurrentStateId(), fs); |
108 } | 108 } |
109 else { | 109 else { |
110 logger.debug("No facets to add in ManualPointsArtifact.initialize (" | 110 log.debug("No facets to add in ManualPointsArtifact.initialize (" |
111 + state.getID() + ")."); | 111 + state.getID() + ")."); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 | 115 |
124 JSONArray array = lines.getJSONArray(index); | 124 JSONArray array = lines.getJSONArray(index); |
125 | 125 |
126 return array.getDouble(0); | 126 return array.getDouble(0); |
127 } | 127 } |
128 catch(JSONException e){ | 128 catch(JSONException e){ |
129 logger.error("Could not decode json for line."); | 129 log.error("Could not decode json for line."); |
130 return 0d; | 130 return 0d; |
131 } | 131 } |
132 } | 132 } |
133 | 133 |
134 | 134 |