Package org.jfree.report.structure

# Class Element

java.lang.Object
org.jfree.report.structure.Node
org.jfree.report.structure.Element

All Implemented Interfaces:
  `Serializable`, `Cloneable`

Direct Known Subclasses:
  `AutoTableCellContent`, `AutoTableElement`, `ContentElement`, `Section`

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
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ID_ATTRIBUTE`
`static final String`
`NAME_ATTRIBUTE`
`static final String`
`NAMESPACE_ATTRIBUTE`
See XML-Namespaces for the idea of that one ...
`static final String`
`TYPE_ATTRIBUTE`
The type corresponds (somewhat) to the tagname of HTML.
`static final String`
`VIRTUAL_ATTRIBUTE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Element()`
Constructs an element.

## Method Summary

Modifier and Type
Method
Description
`void`
`addExpression(Expression function)`
Adds a function to the report's collection of expressions.
`Object`
`clone()`
`Object`
`getAttribute(String name)`
`Object`
`getAttribute(String namespace, String name)`
`Expression`
`getAttributeExpression(String attr)`
Returns the expressions for the report.
`Expression`
`getAttributeExpression(String namespace, String attr)`
`org.jfree.layouting.util.AttributeMap`
`getAttributeExpressionMap()`
`Map`
`getAttributeExpressions(String namespace)`
`org.jfree.layouting.util.AttributeMap`
`getAttributeMap()`
`Expression`
`getDisplayCondition()`
`Expression[]`
`getExpressions()`
Returns the expressions for the report.
`String`
`getId()`
`Locale`
`getLocale()`
`protected Locale`
`getLocaleFromAttributes()`
`String`
`getName()`
Returns the name of the Element.
`String`
`getNamespace()`
`org.jfree.layouting.input.style.CSSStyleRule`
`getStyle()`
Returns this elements private stylesheet.
`Expression`
`getStyleExpression(String property)`
Returns the expressions for the report.
`Map`
`getStyleExpressions()`
`String`
`getType()`
`org.jfree.layouting.input.style.values.CSSConstant`
`getVisibility()`
`boolean`
`isEnabled()`
Returns true, if the element is enabled.
`boolean`
`isVirtual()`
`void`
`setAttribute(String name, Object value)`
`void`
`setAttribute(String namespace, String name, Object value)`
`void`
`setAttributeExpression(String namespace, String attr, Expression function)`
Adds a function to the report's collection of expressions.
`void`
`setAttributeExpression(String attr, Expression function)`
`void`
`setDisplayCondition(Expression displayCondition)`
`void`
`setEnabled(boolean enabled)`
Defines whether the element is enabled.
`void`
`setExpressions(Expression[] expressions)`
Sets the expressions for the report.
`void`
`setId(String id)`
`void`
`setName(String name)`
Defines the name for this Element.
`void`
`setNamespace(String id)`
`void`
`setStyleExpression(String property, Expression function)`
Adds a function to the report's collection of expressions.
`void`
`setType(String type)`
`void`
`setVirtual(boolean virtual)`
`void`
`setVisibility(org.jfree.layouting.input.style.values.CSSConstant v)`

### Methods inherited from class org.jfree.report.structure.Node

`getGroup, getParent, getReport, getRootReport, setParent, updateParent`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE

See Also:
  - Constant Field Values

### ID_ATTRIBUTE

public static final String ID_ATTRIBUTE

See Also:
  - Constant Field Values

### TYPE_ATTRIBUTE

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

See Also:
  - Constant Field Values

### NAMESPACE_ATTRIBUTE

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

See Also:
  - Constant Field Values

### VIRTUAL_ATTRIBUTE

public static final String VIRTUAL_ATTRIBUTE

See Also:
  - Constant Field Values

## Constructor Details

### 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 Details

### getNamespace

public String getNamespace()

### setNamespace

public void setNamespace(String id)

### getId

public String getId()

### setId

public void setId(String id)

### getType

public String getType()

### setType

public void setType(String type)

### 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

### getName

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

Returns:
  the name.

### setAttribute

public void setAttribute(String name, Object value)

### setAttribute

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

### getAttribute

public Object getAttribute(String name)

### getAttribute

public Object getAttribute(String namespace, String name)

### getAttributeMap

public org.jfree.layouting.util.AttributeMap getAttributeMap()

### getStyle

public org.jfree.layouting.input.style.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

### setVisibility

public void setVisibility(org.jfree.layouting.input.style.values.CSSConstant v)

### getVisibility

public org.jfree.layouting.input.style.values.CSSConstant getVisibility()

### 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.

### 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)

### getAttributeExpressions

public Map getAttributeExpressions(String namespace)

### getAttributeExpressionMap

public org.jfree.layouting.util.AttributeMap getAttributeExpressionMap()

### setStyleExpression

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

Parameters:
  `property` -
  `function` - the function.

### getStyleExpression

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

Parameters:
  `property` -
Returns:
  the expressions.

### getStyleExpressions

public Map getStyleExpressions()

### addExpression

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

Parameters:
  `function` - the function.

### getExpressions

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

Returns:
  the expressions.

### setExpressions

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

Parameters:
  `expressions` - the expressions (`null` not permitted).

### isEnabled

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

Overrides:
  `isEnabled` in class `Node`
Returns:
  true or false

### 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` -

### getDisplayCondition

public Expression getDisplayCondition()

Overrides:
  `getDisplayCondition` in class `Node`

### setDisplayCondition

public void setDisplayCondition(Expression displayCondition)

### getLocale

public Locale getLocale()

Overrides:
  `getLocale` in class `Node`

### getLocaleFromAttributes

protected Locale getLocaleFromAttributes()

### isVirtual

public boolean isVirtual()

### setVirtual

public void setVirtual(boolean virtual)

### clone

public Object clone() throws CloneNotSupportedException

Overrides:
  `clone` in class `Node`
Throws:
  `CloneNotSupportedException`