Package org.jfree.report.structure
Class Element
- java.lang.Object
-
- org.jfree.report.structure.Node
-
- org.jfree.report.structure.Element
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.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 java.lang.StringID_ATTRIBUTEstatic java.lang.StringNAME_ATTRIBUTEstatic java.lang.StringNAMESPACE_ATTRIBUTESee XML-Namespaces for the idea of that one ...static java.lang.StringTYPE_ATTRIBUTEThe type corresponds (somewhat) to the tagname of HTML.static java.lang.StringVIRTUAL_ATTRIBUTE
-
Constructor Summary
Constructors Modifier Constructor Description protectedElement()Constructs an element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExpression(Expression function)Adds a function to the report's collection of expressions.java.lang.Objectclone()java.lang.ObjectgetAttribute(java.lang.String name)java.lang.ObjectgetAttribute(java.lang.String namespace, java.lang.String name)ExpressiongetAttributeExpression(java.lang.String attr)Returns the expressions for the report.ExpressiongetAttributeExpression(java.lang.String namespace, java.lang.String attr)org.jfree.layouting.util.AttributeMapgetAttributeExpressionMap()java.util.MapgetAttributeExpressions(java.lang.String namespace)org.jfree.layouting.util.AttributeMapgetAttributeMap()ExpressiongetDisplayCondition()Expression[]getExpressions()Returns the expressions for the report.java.lang.StringgetId()java.util.LocalegetLocale()protected java.util.LocalegetLocaleFromAttributes()java.lang.StringgetName()Returns the name of the Element.java.lang.StringgetNamespace()org.jfree.layouting.input.style.CSSStyleRulegetStyle()Returns this elements private stylesheet.ExpressiongetStyleExpression(java.lang.String property)Returns the expressions for the report.java.util.MapgetStyleExpressions()java.lang.StringgetType()org.jfree.layouting.input.style.values.CSSConstantgetVisibility()booleanisEnabled()Returns true, if the element is enabled.booleanisVirtual()voidsetAttribute(java.lang.String name, java.lang.Object value)voidsetAttribute(java.lang.String namespace, java.lang.String name, java.lang.Object value)voidsetAttributeExpression(java.lang.String namespace, java.lang.String attr, Expression function)Adds a function to the report's collection of expressions.voidsetAttributeExpression(java.lang.String attr, Expression function)voidsetDisplayCondition(Expression displayCondition)voidsetEnabled(boolean enabled)Defines whether the element is enabled.voidsetExpressions(Expression[] expressions)Sets the expressions for the report.voidsetId(java.lang.String id)voidsetName(java.lang.String name)Defines the name for this Element.voidsetNamespace(java.lang.String id)voidsetStyleExpression(java.lang.String property, Expression function)Adds a function to the report's collection of expressions.voidsetType(java.lang.String type)voidsetVirtual(boolean virtual)voidsetVisibility(org.jfree.layouting.input.style.values.CSSConstant v)-
Methods inherited from class org.jfree.report.structure.Node
getGroup, getParent, getReport, getRootReport, setParent, updateParent
-
-
-
-
Field Detail
-
NAME_ATTRIBUTE
public static final java.lang.String NAME_ATTRIBUTE
- See Also:
- Constant Field Values
-
ID_ATTRIBUTE
public static final java.lang.String ID_ATTRIBUTE
- See Also:
- Constant Field Values
-
TYPE_ATTRIBUTE
public static final java.lang.String TYPE_ATTRIBUTE
The type corresponds (somewhat) to the tagname of HTML.- See Also:
- Constant Field Values
-
NAMESPACE_ATTRIBUTE
public static final java.lang.String NAMESPACE_ATTRIBUTE
See XML-Namespaces for the idea of that one ...- See Also:
- Constant Field Values
-
VIRTUAL_ATTRIBUTE
public static final java.lang.String VIRTUAL_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
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
-
getNamespace
public java.lang.String getNamespace()
-
setNamespace
public void setNamespace(java.lang.String id)
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getType
public java.lang.String getType()
-
setType
public void setType(java.lang.String type)
-
setName
public void setName(java.lang.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 java.lang.String getName()
Returns the name of the Element. The name of the Element is never null.- Returns:
- the name.
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
-
setAttribute
public void setAttribute(java.lang.String namespace, java.lang.String name, java.lang.Object value)
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
-
getAttribute
public java.lang.Object getAttribute(java.lang.String namespace, java.lang.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(java.lang.String attr, Expression function)
-
setAttributeExpression
public void setAttributeExpression(java.lang.String namespace, java.lang.String attr, Expression function)Adds a function to the report's collection of expressions.- Parameters:
namespace-attr-function- the function.
-
getAttributeExpression
public Expression getAttributeExpression(java.lang.String attr)
Returns the expressions for the report.- Parameters:
attr-- Returns:
- the expressions.
-
getAttributeExpression
public Expression getAttributeExpression(java.lang.String namespace, java.lang.String attr)
-
getAttributeExpressions
public java.util.Map getAttributeExpressions(java.lang.String namespace)
-
getAttributeExpressionMap
public org.jfree.layouting.util.AttributeMap getAttributeExpressionMap()
-
setStyleExpression
public void setStyleExpression(java.lang.String property, Expression function)Adds a function to the report's collection of expressions.- Parameters:
function- the function.property-
-
getStyleExpression
public Expression getStyleExpression(java.lang.String property)
Returns the expressions for the report.- Parameters:
property-- Returns:
- the expressions.
-
getStyleExpressions
public java.util.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 (nullnot permitted).
-
isEnabled
public boolean isEnabled()
Returns true, if the element is enabled.
-
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:
getDisplayConditionin classNode
-
setDisplayCondition
public void setDisplayCondition(Expression displayCondition)
-
getLocaleFromAttributes
protected java.util.Locale getLocaleFromAttributes()
-
isVirtual
public boolean isVirtual()
-
setVirtual
public void setVirtual(boolean virtual)
-
-