Class Group
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.Element
-
- org.pentaho.reporting.engine.classic.core.Section
-
- org.pentaho.reporting.engine.classic.core.Group
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Element>
,DataTarget
,ReportElement
- Direct Known Subclasses:
CrosstabColumnGroup
,CrosstabGroup
,CrosstabOtherGroup
,CrosstabRowGroup
,RelationalGroup
public abstract class Group extends Section
A report group. Reports can contain any number of (nested) groups. The order of the fields is not important. If the group does not contain any fields, the group spans the whole report from the first to the last row (such a group is called the default group). The group's field list should not be modified after the group was added to the group list, or the results are undefined. Groups of the same GroupList must have a subgroup relation. The designated child group must contain all fields of the direct parent plus at least one new field. There is no requirement, that the referenced field actually exists, if it doesn't, null is assumed as field value. It is recommended that the name of the group is unique within the report. The name will not be used internally to identify the group, but most functions depend on a recognizable group name to identify the group to be processed.- Author:
- David Gilbert, Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element
ANONYMOUS_ELEMENT_PREFIX
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Group
clone()
Clones this Element.protected abstract GroupBody
createDefaultBody()
Group
derive(boolean preserveElementInstanceIds)
Creates a deep copy of this element and regenerates all instance-ids.GroupBody
getBody()
String
getGeneratedName()
String
getName()
Returns the name of the Element.abstract List<SortConstraint>
getSortingConstraint()
boolean
isAscendingSortOrder()
abstract boolean
isGroupChange(DataRow dataRow)
protected List<SortConstraint>
mapFields(List<String> fields)
boolean
matches(String name)
protected void
notifyElement()
protected void
removeElement(Element element)
Removes an element from the section.void
setAscendingSortOrder(Boolean order)
void
setBody(GroupBody body)
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.Section
getDefaultStyleSheet, getElement, getElementCount, iterator, registerAsChild, setElementAt, unregisterAsChild, unregisterParent, validateLooping
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.Element
copyAttributes, copyInto, derive, getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeExpressions, getAttributeNames, getAttributeNamespaces, getAttributes, getAttributeTyped, getChangeTracker, getChildElementByType, getChildElementsByName, getChildElementsByType, getComputedStyle, getContentBase, getDataSource, getDefinitionSource, getElementContext, getElementType, getElementTypeName, getFirstAttribute, getHRefTarget, getId, getMasterReport, getMetaData, getObjectID, getParent, getParentSection, getReportDefinition, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, isDynamicContent, isVisible, notifyNodeChildAdded, notifyNodeChildRemoved, notifyNodePropertiesChanged, notifyNodePropertiesChanged, notifyNodeStructureChanged, setAttribute, setAttribute, setAttributeExpression, setChangeTracker, setComputedStyle, setDataSource, setDynamicContent, setElementType, setHRefTarget, setId, setName, setParent, setStyleExpression, setVisible, toString, updateChangedFlagInternal, updateInternalChangeFlag
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
Group
protected Group()
Constructs a group with no fields, and an empty header and footer.
-
Group
protected Group(GroupBody body)
-
-
Method Detail
-
getBody
public GroupBody getBody()
-
setBody
public void setBody(GroupBody body)
-
clone
public Group clone()
Clones this Element.- Specified by:
clone
in interfaceDataTarget
- Overrides:
clone
in classSection
- Returns:
- a clone of this element.
-
derive
public Group derive(boolean preserveElementInstanceIds)
Description copied from class:Element
Creates a deep copy of this element and regenerates all instance-ids.- Overrides:
derive
in classSection
- Parameters:
preserveElementInstanceIds
- defines whether this call generates new instance-ids for the derived elements. Instance-IDs are used by the report processor to recognize reoccurring elements and must not changed within the report run. Outside of the report processors new instance ids should be generated at all times to separate instances and to make them uniquely identifiable.- Returns:
- the copy of the element.
-
isGroupChange
public abstract boolean isGroupChange(DataRow dataRow)
-
removeElement
protected void removeElement(Element element)
Description copied from class:Section
Removes an element from the section.- Specified by:
removeElement
in classSection
- Parameters:
element
- the element to be section.
-
createDefaultBody
protected abstract GroupBody createDefaultBody()
-
notifyElement
protected void notifyElement()
- Overrides:
notifyElement
in classElement
-
getGeneratedName
public String getGeneratedName()
-
getName
public String getName()
Description copied from class:Element
Returns the name of the Element. The name of the Element is never null.- Specified by:
getName
in interfaceReportElement
- Overrides:
getName
in classElement
- Returns:
- the name.
-
matches
public boolean matches(String name)
-
getSortingConstraint
public abstract List<SortConstraint> getSortingConstraint()
-
mapFields
protected List<SortConstraint> mapFields(List<String> fields)
-
isAscendingSortOrder
public boolean isAscendingSortOrder()
-
setAscendingSortOrder
public void setAscendingSortOrder(Boolean order)
-
-