Package com.inet.report
Class GroupField
- java.lang.Object
-
- com.inet.report.Field
-
- com.inet.report.GroupField
-
- All Implemented Interfaces:
NodeParser,com.inet.report.ReferencedObject,com.inet.report.ReferenceHolder,Validatable,java.io.Serializable
public class GroupField extends Field implements com.inet.report.ReferenceHolder, Validatable
TheGroupFieldrepresents a group name field, which is automatically created with the creation of aGroupobject. When evaluating aGroupFieldthe name of the group will returned. So if you have a group then you can print out the name with aFieldElementcontaining theGroupField.
You can get theGroupFieldof each group withFields.getGroupNameField(int)in classFields.
This class is part of the RDC.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inet.report.Field
Field.FieldAttributeTag
-
-
Field Summary
-
Fields inherited from class com.inet.report.Field
BINARY, BOOLEAN, CURRENCY, CURSOR, DATABASE_FIELD, DATE, DATETIME, FORMULA_FIELD, GROUP_NAME_FIELD, NUMBER, PARAMETER_FIELD, SORT_FIELD, SPECIAL_FIELD, SQL_FIELD, STRING, SUMMARY_FIELD, TIME, UNKNOWN
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddReferencedObject(com.inet.report.ReferencedObject reference)FOR INTERNAL USE ONLYFieldgetField()Gets the field definition element (for example, database field element, prompt field element).GroupgetGroup()Returns the group this field is associated with.intgetGroupType()Returns the type of the group, which is associated with this group name field.java.lang.StringgetName()Returns a string which represents the name of the group field.intgetRealReferencedObjectCount()FOR INTERNAL USE ONLYintgetReferencedObjectCount()FOR INTERNAL USE ONLYcom.inet.report.ReferencedObject[]getReferencedObjects()FOR INTERNAL USE ONLYintgetValueType()The return value type of a GroupField is always Field.String, but for formatting the return value type of the group the field is based on is needed.NodeParserparseElement(com.inet.report.parser.XMLTag group, java.lang.String tag, org.xml.sax.Attributes atts, java.util.Map<java.lang.String,java.lang.Object> parserMap)FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLvoidremoveReferencedObject(com.inet.report.ReferencedObject reference)FOR INTERNAL USE ONLYvoidresetReferences()FOR INTERNAL USE ONLYprotected voidsaveFieldXML2(java.io.PrintWriter pw, int depth)FOR INTERNAL USE ONLYprotected voidsaveXML2GroupField(java.io.PrintWriter pw, int depth)FOR INTERNAL USE ONLYvoidsetField(Field newField)Sets the field definition element (for example, DatabaseField element, prompt field element).voidsetName(java.lang.String name)Setting the name of a GroupField is not allowed.voidsetReferences()FOR INTERNAL USE ONLYValidityvalidate()Check if the object is valid and returns the state and details of possible errors.-
Methods inherited from class com.inet.report.Field
addReferenceHolder, checkNameExists, duplicate, equals, extractReference, getPlaceholderName, getRealReferenceCount, getReferenceHolderCount, getReferenceHolders, getRefName, getType, indexOf, isDOMParser, isUsed, paramString, parseDOM, parseEndElement, parseText, removeReferenceHolder, rename, setGroup, setValueType, trimAwayBrackets
-
-
-
-
Method Detail
-
setName
public void setName(java.lang.String name) throws ReportExceptionSetting the name of a GroupField is not allowed. If you want to customize the name of the GroupField use:
GroupField.getGroup().setCustomizeGroupNameField(CUSTOMIZE_GROUP_NAME_FIELD_ENABLED)
andGroupField.getGroup().setGroupNameDbField(<your field>)- or use
GroupField.getGroup().setCustomizeGroupNameField(CUSTOMIZE_GROUP_NAME_FIELD_ENABLED_WITH_FM)
andGroupField.getGroup().setGroupNameFormula(<your field>).
- Specified by:
setNamein classField- Parameters:
name- a name.- Throws:
ReportException- will be thrown when you use this method to set the name of a GroupField.- Since:
- 6.0
- See Also:
getName()
-
getGroup
public Group getGroup()
Returns the group this field is associated with.- Overrides:
getGroupin classField- Returns:
- the group this field belongs to.
- Since:
- 6.0
- See Also:
Field.setGroup(Group)
-
getGroupType
public int getGroupType()
Returns the type of the group, which is associated with this group name field. The following values possible:- 0 - field results from a standard group definition
- 1 - field results from group definition of a cross-tab column
- 2 - field results from group definition of a cross-tab row
- 3 - field results from group definition of a chart
eng.getGroup(getGroupNumber()+1)results the Group object which is associated with this field. Otherwise anullis returned bygetGroup.- Returns:
- the group type.
- Since:
- 6.0
-
getField
public Field getField()
Gets the field definition element (for example, database field element, prompt field element).
-
setField
public void setField(Field newField)
Sets the field definition element (for example, DatabaseField element, prompt field element).
-
saveFieldXML2
protected void saveFieldXML2(java.io.PrintWriter pw, int depth)FOR INTERNAL USE ONLY- Specified by:
saveFieldXML2in classField- Parameters:
pw- the print writerdepth- the current depth
-
getValueType
public int getValueType()
The return value type of a GroupField is always Field.String, but for formatting the return value type of the group the field is based on is needed.- Overrides:
getValueTypein classField- Returns:
- The value of the property 'value type'.
- Since:
- 6.0
- See Also:
Field.NUMBER,Field.CURRENCY,Field.BOOLEAN,Field.DATE,Field.TIME,Field.STRING,Field.DATETIME
-
getName
public java.lang.String getName()
Returns a string which represents the name of the group field. The string returned depends on the settings ofGroup.getCustomizeGroupNameField().- Overrides:
getNamein classField- Returns:
- name of the groupfield
- Since:
- 6.0
- See Also:
setName(String),Group.getCustomizeGroupNameField()
-
addReferencedObject
public final void addReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLY- Specified by:
addReferencedObjectin interfacecom.inet.report.ReferenceHolder- Since:
- 6.0
-
getReferencedObjects
public final com.inet.report.ReferencedObject[] getReferencedObjects()
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjectsin interfacecom.inet.report.ReferenceHolder
-
getRealReferencedObjectCount
public final int getRealReferencedObjectCount()
FOR INTERNAL USE ONLY- Specified by:
getRealReferencedObjectCountin interfacecom.inet.report.ReferenceHolder- Since:
- 6.0
-
getReferencedObjectCount
public final int getReferencedObjectCount()
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjectCountin interfacecom.inet.report.ReferenceHolder
-
removeReferencedObject
public final void removeReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLY- Specified by:
removeReferencedObjectin interfacecom.inet.report.ReferenceHolder- Since:
- 6.0
-
resetReferences
public final void resetReferences()
FOR INTERNAL USE ONLY- Specified by:
resetReferencesin interfacecom.inet.report.ReferenceHolder
-
setReferences
public final void setReferences()
FOR INTERNAL USE ONLY- Specified by:
setReferencesin interfacecom.inet.report.ReferenceHolder
-
saveXML2GroupField
protected void saveXML2GroupField(java.io.PrintWriter pw, int depth)FOR INTERNAL USE ONLY
-
parseElement
public NodeParser parseElement(com.inet.report.parser.XMLTag group, java.lang.String tag, org.xml.sax.Attributes atts, java.util.Map<java.lang.String,java.lang.Object> parserMap) throws FatalParserException
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLParses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.
- Specified by:
parseElementin interfaceNodeParser- Overrides:
parseElementin classField- Parameters:
group- XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.tag- The XMLTag to be parsedatts- The set of attributes in the current XMLTagparserMap- The map of current Parser.- Returns:
- The NodeParser sub-element if one needed to be created, or null if none was created.
- Throws:
FatalParserException- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
validate
public Validity validate()
Check if the object is valid and returns the state and details of possible errors.- Specified by:
validatein interfaceValidatable- Returns:
- the current state, never null.
-
-