diff options
Diffstat (limited to 'src/org/apache/fop/area/Area.java')
-rw-r--r-- | src/org/apache/fop/area/Area.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/org/apache/fop/area/Area.java b/src/org/apache/fop/area/Area.java index f041f9227..8a3552f0b 100644 --- a/src/org/apache/fop/area/Area.java +++ b/src/org/apache/fop/area/Area.java @@ -10,6 +10,8 @@ package org.apache.fop.area; import java.io.Serializable; import org.apache.fop.fo.FObj; +import java.util.HashMap; + // If the area appears more than once in the output // or if the area has external data it is cached // to keep track of it and to minimize rendered output @@ -126,4 +128,33 @@ public class Area implements Serializable { public FObj getGeneratingFObj() { return this.genFObj; } + + // Do nothing! Let subclasses do something if they can have child areas. + public void addChild(Area child) { + } + + + HashMap props = null; + + public void addTrait(Trait prop) { + if (props == null) { + props = new HashMap(20); + } + props.put(prop.propType, prop.data); + } + + public void addTrait(Object traitCode, Object prop) { + if (props == null) { + props = new HashMap(20); + } + props.put(traitCode, prop); + } + + public HashMap getTraits() { + return this.props; + } + + public Object getTrait(Object oTraitCode) { + return (props != null? props.get(oTraitCode) : null); + } } |