ingo@186: /* ingo@186: * Copyright (c) 2011 by Intevation GmbH ingo@186: * ingo@186: * This program is free software under the LGPL (>=v2.1) ingo@186: * Read the file LGPL.txt coming with the software for details ingo@186: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@186: */ ingo@186: package de.intevation.artifactdatabase; ingo@186: ingo@186: import de.intevation.artifacts.CollectionItem; ingo@186: ingo@186: import de.intevation.artifacts.common.utils.XMLUtils; ingo@186: ingo@186: import org.w3c.dom.Document; ingo@186: ingo@186: public class DefaultCollectionItem ingo@186: implements CollectionItem ingo@186: { ingo@186: protected String artifactIdentifier; ingo@186: ingo@186: protected byte [] data; ingo@186: ingo@186: protected Document document; ingo@186: ingo@186: public DefaultCollectionItem() { ingo@186: } ingo@186: ingo@186: public DefaultCollectionItem(String artifactIdentifier, byte [] attribute) { ingo@186: this.artifactIdentifier = artifactIdentifier; ingo@188: this.data = attribute; ingo@186: } ingo@186: ingo@186: public String getArtifactIdentifier() { ingo@186: return artifactIdentifier; ingo@186: } ingo@186: ingo@186: public synchronized Document getAttribute() { ingo@186: if (document == null) { ingo@186: if (data != null) { ingo@236: document = XMLUtils.fromByteArray(data, true); ingo@186: } ingo@186: } ingo@186: return document; ingo@186: } ingo@186: } ingo@186: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :