comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/DefaultCollectionItem.java @ 473:d0ac790a6c89 dive4elements-move

Moved directories to org.dive4elements
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 10:57:18 +0200
parents artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultCollectionItem.java@6ef6acf30d66
children 415df0fc4fa1
comparison
equal deleted inserted replaced
472:783cc1b6b615 473:d0ac790a6c89
1 /*
2 * Copyright (c) 2011 by Intevation GmbH
3 *
4 * This program is free software under the LGPL (>=v2.1)
5 * Read the file LGPL.txt coming with the software for details
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
7 */
8 package de.intevation.artifactdatabase;
9
10 import de.intevation.artifacts.CollectionItem;
11
12 import de.intevation.artifacts.common.utils.XMLUtils;
13
14 import org.w3c.dom.Document;
15
16 public class DefaultCollectionItem
17 implements CollectionItem
18 {
19 protected String artifactIdentifier;
20
21 protected byte [] data;
22
23 protected Document document;
24
25 public DefaultCollectionItem() {
26 }
27
28 public DefaultCollectionItem(String artifactIdentifier, byte [] attribute) {
29 this.artifactIdentifier = artifactIdentifier;
30 this.data = attribute;
31 }
32
33 public String getArtifactIdentifier() {
34 return artifactIdentifier;
35 }
36
37 public synchronized Document getAttribute() {
38 if (document == null) {
39 if (data != null) {
40 document = XMLUtils.fromByteArray(data, true);
41 }
42 }
43 return document;
44 }
45 }
46 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org