Package com.inet.report
Class SortField
- java.lang.Object
-
- com.inet.report.Field
-
- com.inet.report.SortField
-
- All Implemented Interfaces:
NodeParser
,com.inet.report.ReferencedObject
,com.inet.report.ReferenceHolder
,Validatable
,java.io.Serializable
public class SortField extends Field implements com.inet.report.ReferenceHolder, Validatable
With this field you can only set the sorting of the report data. This field can not be displayed with aFieldElement
.
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 Modifier and Type Field Description static int
ASCENDING_ALPHA_NUMERIC_ORDER
Sort records ascending.static int
ASCENDING_ORDER
Sort records ascending.static int
DESCENDING_ALPHA_NUMERIC_ORDER
Sort records descending.static int
DESCENDING_ORDER
Sort records descending.static int
ORIGINAL_ORDER
Do not sort records, let it unsorted.-
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 void
addReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLYboolean
equals(java.lang.Object obj)
Indicates whether some otherSortField
is "equal to" this one.int
getRealReferencedObjectCount()
FOR INTERNAL USE ONLYint
getReferencedObjectCount()
FOR INTERNAL USE ONLYcom.inet.report.ReferencedObject[]
getReferencedObjects()
FOR INTERNAL USE ONLYint
getSort()
Returns the value of the property 'sort direction'.FormulaField
getSortDirectionFormula()
Returns the formula of sort direction for this sort field.int
getValueType()
Returns the value type (or return type) of the field.boolean
isUsed()
FOR INTERNAL USE ONLYNodeParser
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)
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
removeReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLYvoid
resetReferences()
FOR INTERNAL USE ONLYprotected void
saveFieldXML2(java.io.PrintWriter pw, int depth)
XML2: FOR INTERNAL USE ONLYvoid
setName(java.lang.String name)
Sets the name of the sort field.void
setReferences()
FOR INTERNAL USE ONLYvoid
setSort(int sort)
Sets the value of the property 'sort direction'.void
setSortDirectionFormula(FormulaField formula)
Sets the formula of sort direction.void
updateName()
Updates the field's ref name.Validity
validate()
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, extractReference, getField, getGroup, getName, getPlaceholderName, getRealReferenceCount, getReferenceHolderCount, getReferenceHolders, getRefName, getType, indexOf, isDOMParser, paramString, parseDOM, parseEndElement, parseText, removeReferenceHolder, rename, setField, setGroup, setValueType, trimAwayBrackets
-
-
-
-
Field Detail
-
ASCENDING_ORDER
public static final int ASCENDING_ORDER
Sort records ascending.- See Also:
- Constant Field Values
-
DESCENDING_ORDER
public static final int DESCENDING_ORDER
Sort records descending.- See Also:
- Constant Field Values
-
ORIGINAL_ORDER
public static final int ORIGINAL_ORDER
Do not sort records, let it unsorted.- See Also:
- Constant Field Values
-
ASCENDING_ALPHA_NUMERIC_ORDER
public static final int ASCENDING_ALPHA_NUMERIC_ORDER
Sort records ascending.- See Also:
- Constant Field Values
-
DESCENDING_ALPHA_NUMERIC_ORDER
public static final int DESCENDING_ALPHA_NUMERIC_ORDER
Sort records descending.- See Also:
- Constant Field Values
-
-
Method Detail
-
setName
public void setName(java.lang.String name) throws ReportException
Sets the name of the sort field. The name must be the name of the database field, which should be the sort criterion. The name of the field should start with a special character for instanciation:
- no charcter, if the field is a database field
- a '%', if the field is a SqlExprField
- a '#', if the field is a SummaryField
- a '@', if the field is a FormulaField
- a '?', if the field is a PromptField
- Specified by:
setName
in classField
- Parameters:
name
- The name of the sort field for example, Users.UserID- Throws:
ReportException
- if no database field with this name existsjava.lang.IllegalArgumentException
- if a sort field with name equals name already exists- Since:
- 6.0
-
setSort
public void setSort(int sort)
Sets the value of the property 'sort direction'. The sort direction determines the order of the fetched data in the presented list. It can be ascending, descending or original order.- Parameters:
sort
- The new value of the property 'sort direction'.- Throws:
java.lang.IllegalArgumentException
- on illegal sort direction values- Since:
- 6.0
- See Also:
setSortDirectionFormula(FormulaField formula)
,ASCENDING_ORDER
,DESCENDING_ORDER
,ASCENDING_ALPHA_NUMERIC_ORDER
,DESCENDING_ALPHA_NUMERIC_ORDER
,ORIGINAL_ORDER
-
getSort
public int getSort()
Returns the value of the property 'sort direction'.- Returns:
- The current value of the property 'sort direction'.
- Since:
- 6.0
- See Also:
ASCENDING_ORDER
,DESCENDING_ORDER
,ORIGINAL_ORDER
,setSort(int)
-
setSortDirectionFormula
public void setSortDirectionFormula(FormulaField formula) throws ReportException
Sets the formula of sort direction. This formula must be of type FormulaField.FORMULA_PROPERTY and must return a positive int value. Allowed range of values 0 for ASCENDING_ORDER, 1 for DESCENDING_ORDER, 2 for ORIGINAL_ORDER (data stays unsorted). Other formula will be ignored.- Parameters:
formula
- for sort direction ornull
to remove the sort direction formula.- Throws:
ReportException
- Wrong formula, formula type or return value of formula- Since:
- 6.0
-
getSortDirectionFormula
public FormulaField getSortDirectionFormula()
Returns the formula of sort direction for this sort field.- Returns:
- sort direction formula
- Since:
- 6.0
- See Also:
setSortDirectionFormula(FormulaField formula)
-
saveFieldXML2
protected void saveFieldXML2(java.io.PrintWriter pw, int depth)
XML2: FOR INTERNAL USE ONLY- Specified by:
saveFieldXML2
in classField
- Parameters:
pw
- the print writerdepth
- the current depth
-
addReferencedObject
public final void addReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLY- Specified by:
addReferencedObject
in interfacecom.inet.report.ReferenceHolder
- Parameters:
reference
- a new referenced object- Since:
- 6.0
-
getReferencedObjects
public final com.inet.report.ReferencedObject[] getReferencedObjects()
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjects
in interfacecom.inet.report.ReferenceHolder
- Returns:
- the referenced objects
-
getRealReferencedObjectCount
public final int getRealReferencedObjectCount()
FOR INTERNAL USE ONLY- Specified by:
getRealReferencedObjectCount
in interfacecom.inet.report.ReferenceHolder
- Returns:
- the count of real referenced objects
- Since:
- 6.0
-
getReferencedObjectCount
public final int getReferencedObjectCount()
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjectCount
in interfacecom.inet.report.ReferenceHolder
- Returns:
- the count of referenced objects
-
removeReferencedObject
public final void removeReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLY- Specified by:
removeReferencedObject
in interfacecom.inet.report.ReferenceHolder
- Parameters:
reference
- the object- Since:
- 6.0
-
setReferences
public final void setReferences()
FOR INTERNAL USE ONLY- Specified by:
setReferences
in interfacecom.inet.report.ReferenceHolder
-
resetReferences
public final void resetReferences()
FOR INTERNAL USE ONLY- Specified by:
resetReferences
in interfacecom.inet.report.ReferenceHolder
-
isUsed
public boolean isUsed()
FOR INTERNAL USE ONLY
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether some otherSortField
is "equal to" this one.
-
getValueType
public int getValueType()
Returns the value type (or return type) of the field.- Overrides:
getValueType
in classField
- Returns:
- The value of the property 'value type'. Will be
Field.UNKNOWN
if the current value of the 'field' property is not set. Usevalidate()
to check this. - Since:
- 6.1
- See Also:
Field.NUMBER
,Field.CURRENCY
,Field.BOOLEAN
,Field.DATE
,Field.TIME
,Field.STRING
,Field.DATETIME
-
updateName
public void updateName()
Updates the field's ref name. Note that this method simply updates the name of this SortField by calling {FieldField.getRefName()
.- Since:
- 7.0
- See Also:
Field.getRefName()
-
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:
parseElement
in interfaceNodeParser
- Overrides:
parseElement
in 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:
validate
in interfaceValidatable
- Returns:
- the current state, never null.
-
-