org.jfree.report.structure

Class Element

public abstract class Element extends Node

An element is a node that can have attributes. The 'id' and the 'name' attribute is defined for all elements.

Both the name and the id attribute may be null.

Properties in the 'http://jfreereport.sourceforge.net/namespaces/engine/flow' namespace and in the 'http://jfreereport.sourceforge.net/namespaces/engine/compatibility' namespace are considered internal. You should only touch them, if you really know what you are doing.

Author: Thomas Morgner

Field Summary
static StringID_ATTRIBUTE
static StringNAMESPACE_ATTRIBUTE
See XML-Namespaces for the idea of that one ...
static StringNAME_ATTRIBUTE
static StringTYPE_ATTRIBUTE
The type corresponds (somewhat) to the tagname of HTML.
static StringVIRTUAL_ATTRIBUTE
Constructor Summary
protected Element()
Constructs an element.
Method Summary
voidaddExpression(Expression function)
Adds a function to the report's collection of expressions.
Objectclone()
ObjectgetAttribute(String name)
ObjectgetAttribute(String namespace, String name)
ExpressiongetAttributeExpression(String attr)
Returns the expressions for the report.
ExpressiongetAttributeExpression(String namespace, String attr)
AttributeMapgetAttributeExpressionMap()
MapgetAttributeExpressions(String namespace)
AttributeMapgetAttributeMap()
ExpressiongetDisplayCondition()
Expression[]getExpressions()
Returns the expressions for the report.
StringgetId()
LocalegetLocale()
protected LocalegetLocaleFromAttributes()
StringgetName()
Returns the name of the Element.
StringgetNamespace()
CSSStyleRulegetStyle()
Returns this elements private stylesheet.
ExpressiongetStyleExpression(String property)
Returns the expressions for the report.
MapgetStyleExpressions()
StringgetType()
CSSConstantgetVisibility()
booleanisEnabled()
Returns true, if the element is enabled.
booleanisVirtual()
voidsetAttribute(String name, Object value)
voidsetAttribute(String namespace, String name, Object value)
voidsetAttributeExpression(String attr, Expression function)
voidsetAttributeExpression(String namespace, String attr, Expression function)
Adds a function to the report's collection of expressions.
voidsetDisplayCondition(Expression displayCondition)
voidsetEnabled(boolean enabled)
Defines whether the element is enabled.
voidsetExpressions(Expression[] expressions)
Sets the expressions for the report.
voidsetId(String id)
voidsetName(String name)
Defines the name for this Element.
voidsetNamespace(String id)
voidsetStyleExpression(String property, Expression function)
Adds a function to the report's collection of expressions.
voidsetType(String type)
voidsetVirtual(boolean virtual)
voidsetVisibility(CSSConstant v)

Field Detail

ID_ATTRIBUTE

public static final String ID_ATTRIBUTE

NAMESPACE_ATTRIBUTE

public static final String NAMESPACE_ATTRIBUTE
See XML-Namespaces for the idea of that one ...

NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE

TYPE_ATTRIBUTE

public static final String TYPE_ATTRIBUTE
The type corresponds (somewhat) to the tagname of HTML.

VIRTUAL_ATTRIBUTE

public static final String VIRTUAL_ATTRIBUTE

Constructor Detail

Element

protected Element()
Constructs an element.

The element inherits the element's defined default ElementStyleSheet to provide reasonable default values for common stylekeys. When the element is added to the band, the bands stylesheet is set as parent to the element's stylesheet.

A datasource is assigned with this element is set to a default source, which always returns null.

Method Detail

addExpression

public void addExpression(Expression function)
Adds a function to the report's collection of expressions.

Parameters: function the function.

clone

public Object clone()

getAttribute

public Object getAttribute(String name)

getAttribute

public Object getAttribute(String namespace, String name)

getAttributeExpression

public Expression getAttributeExpression(String attr)
Returns the expressions for the report.

Parameters: attr

Returns: the expressions.

getAttributeExpression

public Expression getAttributeExpression(String namespace, String attr)

getAttributeExpressionMap

public AttributeMap getAttributeExpressionMap()

getAttributeExpressions

public Map getAttributeExpressions(String namespace)

getAttributeMap

public AttributeMap getAttributeMap()

getDisplayCondition

public Expression getDisplayCondition()

getExpressions

public Expression[] getExpressions()
Returns the expressions for the report.

Returns: the expressions.

getId

public String getId()

getLocale

public Locale getLocale()

getLocaleFromAttributes

protected Locale getLocaleFromAttributes()

getName

public String getName()
Returns the name of the Element. The name of the Element is never null.

Returns: the name.

getNamespace

public String getNamespace()

getStyle

public CSSStyleRule getStyle()
Returns this elements private stylesheet. This sheet can be used to override the default values set in one of the parent-stylesheets.

Returns: the Element's stylesheet

getStyleExpression

public Expression getStyleExpression(String property)
Returns the expressions for the report.

Parameters: property

Returns: the expressions.

getStyleExpressions

public Map getStyleExpressions()

UNKNOWN: ReturnOfCollectionOrArrayField

getType

public String getType()

getVisibility

public CSSConstant getVisibility()

isEnabled

public boolean isEnabled()
Returns true, if the element is enabled.

Returns: true or false

isVirtual

public boolean isVirtual()

setAttribute

public void setAttribute(String name, Object value)

setAttribute

public void setAttribute(String namespace, String name, Object value)

setAttributeExpression

public void setAttributeExpression(String attr, Expression function)

setAttributeExpression

public void setAttributeExpression(String namespace, String attr, Expression function)
Adds a function to the report's collection of expressions.

Parameters: namespace attr function the function.

setDisplayCondition

public void setDisplayCondition(Expression displayCondition)

setEnabled

public void setEnabled(boolean enabled)
Defines whether the element is enabled. Disabled elements will be fully ignored by the report processor. This is a design time property to exclude elements from the processing without actually having to deal with the other complex properties.

Parameters: enabled

setExpressions

public void setExpressions(Expression[] expressions)
Sets the expressions for the report.

Parameters: expressions the expressions (null not permitted).

setId

public void setId(String id)

setName

public void setName(String name)
Defines the name for this Element. The name must not be empty, or a NullPointerException is thrown.

Names can be used to lookup an element within a band. There is no requirement for element names to be unique.

Parameters: name the name of this element

setNamespace

public void setNamespace(String id)

setStyleExpression

public void setStyleExpression(String property, Expression function)
Adds a function to the report's collection of expressions.

Parameters: function the function. property

setType

public void setType(String type)

setVirtual

public void setVirtual(boolean virtual)

setVisibility

public void setVisibility(CSSConstant v)