Mercurial > dive4elements > framework
diff artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java @ 351:eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
artifacts/trunk@3329 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 30 Nov 2011 08:13:48 +0000 |
parents | 93a774fe2bb4 |
children | 1d11a0531242 |
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java Wed Nov 23 17:17:39 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java Wed Nov 30 08:13:48 2011 +0000 @@ -1,5 +1,7 @@ package de.intevation.artifactdatabase.state; +import java.util.List; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -18,18 +20,21 @@ */ public class DefaultFacet implements Facet { - /** The index of this facet.*/ + /** The index of this facet. */ protected int index; - /** The name of this facet.*/ + /** The name of this facet. */ protected String name; - /** The description of this facet.*/ + /** The description of this facet. */ protected String description; + + /** Trivial, empty constructor. */ public DefaultFacet() { } + /** * The default constructor to create new Facet objects. * @@ -54,12 +59,17 @@ this.description = description; } + + /** + * Copies name, index and description of other facet. + */ public void set(Facet other) { index = other.getIndex(); name = other.getName(); description = other.getDescription(); } + public Facet deepCopy() { DefaultFacet copy = new DefaultFacet(); copy.set(this); @@ -82,10 +92,38 @@ } + /** + * @return null + */ public Object getData(Artifact artifact, CallContext context) { return null; } + + /** + * (Do not) provide data. + * Override to allow other facets to access your data. + * @return always null. + */ + public Object provideBlackboardData( + Artifact artifact, + Object key, + Object param, + CallContext context + ) { + return null; + } + + + /** + * Return list of keys (objects) for which this facet can provide data + * ("external parameterization"), for other facets, via blackboard. + */ + public List getDataProviderKeys() { + return null; + } + + public String toString() { return new StringBuilder("name = '") .append(name).append("', index = ")