Klasse Field
java.lang.Object
com.inet.report.Field
- Alle implementierten Schnittstellen:
NodeParser, com.inet.report.ReferencedObject, Serializable
- Bekannte direkte Unterklassen:
DatabaseField, Fields.UnknownField, FormulaField, GroupField, PromptField, SortField, SpecialField, SQLField, SummaryField
public abstract class Field
extends Object
implements Serializable, com.inet.report.ReferencedObject, NodeParser
Field is the superclass of the different types of fields which can be used in a report. It summarizes the properties shared by all fields. A field is dynamic content in a report, it
will be evaluated at runtime and deliver static content (text, picture, ...) for each record to the element that uses the field. I.e. if you want to insert a dynamic label into your report, you
have to use a FieldElement or a Text with a FieldPart. Both FieldElement and FieldPart get their content from a
Field. For each kind of source there is a specialized subclass. There are SpecialField s for contents like 'page number' and 'current date/time',
DatabaseField s for content that comes from a database, PromptField s for content that the user will be asked for at runtime, FormulaField s for content
that is calculated by a formula, ... .All fields are collected within the class
Fields, so you can not create an instance of Field or subclasses. If you want to instantiate a field by name, the name of the field should start with a special character:
- no character, if the field is a
DatabaseField - 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
- Seit:
- 6.0
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Feldübersicht
FelderModifikator und TypFeldBeschreibungstatic final intThe constant that identifies a Binary value.static final intThe constant that identifies a Boolean value.static final intThe constant that identifies a Currency value.static final intThe constant that identifies a Cursor value.static final intField is a database field.static final intThe constant that identifies a Date value.static final intThe constant that identifies a DateTime value.static final intField is a formula field.static final intField is a group name field.static final intThe constant that identifies a Number value.static final intField is a parameter field.static final intField is a sort field.static final intField is a special field.static final intField is a sql field.static final intThe constant that identifies a String value.static final intField is a summary field.static final intThe constant that identifies a Time value.static final intThe constant that identifies an unspecific type. -
Methodenübersicht
Modifikator und TypMethodeBeschreibungvoidaddReferenceHolder(com.inet.report.ReferenceHolder holder) FOR INTERNAL USE ONLYbooleancheckNameExists(String nameToCheck) Checks whether the string name is the property 'name' of the field.Duplicates this field with all its settings and returns the created Field with the given name.booleanprotected voidextractReference(Attributes atts) extracts the referenced field and sets it for this Field objectgetField()Gets the field definition element (for example, database field element, prompt field element).getGroup()Returns the group this field is associated with.getName()Returns the value of the property 'name'.Returns the placeholder of this field including its brackets, required to use the field in formulas and sql statements.intFOR INTERNAL USE ONLYintFOR INTERNAL USE ONLYcom.inet.report.ReferenceHolder[]FOR INTERNAL USE ONLYReturns the value of the property 'name' with a type marker.intgetType()Returns the value of the property 'type'.intReturns the value type (or return type) of the field.
NOTE:If DefaultAttribute is used within the formula it has to be set before calling this method.intindexOf()Returns the index of the field in the fields set.booleanFOR INTERNAL USE ONLY Internal method for reading report XMLbooleanisUsed()FOR INTERNAL USE ONLYReturns a prettified output of this field's name and type.voidFOR INTERNAL USE ONLY Internal method for reading report XMLparseElement(com.inet.report.parser.XMLTag group, String tag, Attributes atts, Map<String, Object> parserMap) FOR INTERNAL USE ONLY Internal method for reading report XMLvoidparseEndElement(com.inet.report.parser.XMLTag group, String tag, Map<String, Object> parserMap) FOR INTERNAL USE ONLY Internal method for reading report XMLvoidFOR INTERNAL USE ONLY Internal method for reading report XMLvoidremoveReferenceHolder(com.inet.report.ReferenceHolder holder) FOR INTERNAL USE ONLYvoidFOR INTERNAL USE ONLYprotected abstract voidsaveFieldXML2(PrintWriter pw, int depth) XML2: FOR INTERNAL USE ONLYvoidSets the field definition element (for example, DatabaseField element, prompt field element).voidSets the group this field should associated with.abstract voidSets the value of the property 'name'.voidsetValueType(int newValue) Sets the value of the property 'value type'.protected StringtrimAwayBrackets(String refname) trims away "{" before and after string, e.g.
-
Felddetails
-
NUMBER
public static final int NUMBERThe constant that identifies a Number value.- Siehe auch:
-
CURRENCY
public static final int CURRENCYThe constant that identifies a Currency value.- Siehe auch:
-
BOOLEAN
public static final int BOOLEANThe constant that identifies a Boolean value.- Siehe auch:
-
DATE
public static final int DATEThe constant that identifies a Date value.- Siehe auch:
-
TIME
public static final int TIMEThe constant that identifies a Time value.- Siehe auch:
-
STRING
public static final int STRINGThe constant that identifies a String value.- Siehe auch:
-
BINARY
public static final int BINARYThe constant that identifies a Binary value.- Siehe auch:
-
DATETIME
public static final int DATETIMEThe constant that identifies a DateTime value.- Siehe auch:
-
CURSOR
public static final int CURSORThe constant that identifies a Cursor value.- Siehe auch:
-
UNKNOWN
public static final int UNKNOWNThe constant that identifies an unspecific type.- Siehe auch:
-
DATABASE_FIELD
public static final int DATABASE_FIELDField is a database field.- Siehe auch:
-
FORMULA_FIELD
public static final int FORMULA_FIELDField is a formula field.- Siehe auch:
-
SUMMARY_FIELD
public static final int SUMMARY_FIELDField is a summary field.- Siehe auch:
-
SPECIAL_FIELD
public static final int SPECIAL_FIELDField is a special field.- Siehe auch:
-
GROUP_NAME_FIELD
public static final int GROUP_NAME_FIELDField is a group name field.- Siehe auch:
-
PARAMETER_FIELD
public static final int PARAMETER_FIELDField is a parameter field.- Siehe auch:
-
SORT_FIELD
public static final int SORT_FIELDField is a sort field.- Siehe auch:
-
SQL_FIELD
public static final int SQL_FIELDField is a sql field.- Siehe auch:
-
-
Methodendetails
-
paramString
Returns a prettified output of this field's name and type.- Gibt zurück:
- Prettified output of this field's name and type.
- Seit:
- 6.0
-
equals
-
getPlaceholderName
Returns the placeholder of this field including its brackets, required to use the field in formulas and sql statements. To use a field in a formula or in a sql statement, it is necessary to put the placeholder of this field in it.- Gibt zurück:
- The placeholder of this field with its brackets, e.g. "{#mySummary}"
- Seit:
- 6.0
-
getName
Returns the value of the property 'name'.- Gibt zurück:
- The value of the property 'name'.
- Seit:
- 6.0
- Siehe auch:
-
setName
Sets the value of the property 'name'.- Parameter:
newValue-newValueThe new value of the property 'name'.- Löst aus:
ReportException- will thrown if the name already exists or is not allowed.- Seit:
- 6.0
-
getRefName
Returns the value of the property 'name' with a type marker. This is the name that is used in formulas. For example for the formula 'abc' is the return value '@abc'.- Gibt zurück:
- The reference name.
- Seit:
- 6.0
- Siehe auch:
-
getField
Gets the field definition element (for example, database field element, prompt field element).- Gibt zurück:
FieldThe current value of the 'field' property.- Seit:
- 6.0
-
setField
Sets the field definition element (for example, DatabaseField element, prompt field element).- Parameter:
newField- The new field element of the property 'field'.- Seit:
- 6.0
-
getType
public int getType()Returns the value of the property 'type'.- Gibt zurück:
- The value of the property 'type'.
- Seit:
- 6.0
- Siehe auch:
-
getGroup
Returns the group this field is associated with.- Gibt zurück:
- Returns the group based on this field if there is one, else
null. - Seit:
- 6.0
- Siehe auch:
-
setGroup
Sets the group this field should associated with. Use this method for setting the group in summary field. GroupFields are generated and initialised automatically at group creation time. You do not need to change the group reference of this fields.- Parameter:
group- The reference to the group of this field.- Seit:
- 6.0
- Siehe auch:
-
getValueType
public int getValueType()Returns the value type (or return type) of the field.
NOTE:If DefaultAttribute is used within the formula it has to be set before calling this method. A null-value will cause an exception here. If you don't know the exact value of the DefaultAttribute you may use a dummy-value for getValueType. The reason is that getValueType only regards the type of object not their value.- Gibt zurück:
- The value of the property 'value type'.
- Löst aus:
IllegalStateException- if the field is in a state where the value type can not be determined- Seit:
- 6.0
- Siehe auch:
-
setValueType
public void setValueType(int newValue) Sets the value of the property 'value type'.- Parameter:
newValue- The new value of the property 'value type'.- Löst aus:
IllegalArgumentException- If newValue is not one of the types below (NUMBER, CURRENCY, ...):- Seit:
- 6.0
- Siehe auch:
-
saveFieldXML2
XML2: FOR INTERNAL USE ONLY- Parameter:
pw- the print writerdepth- the current depth
-
indexOf
public int indexOf()Returns the index of the field in the fields set. For each field type there is a separate list (DatabaseField, FormulaField, PromptField, SummaryField, SQLField, SortField, GroupField).
Note: Do not call this method for FormulaFields which are either record selection formula, group selection formula or property formulas. If the field was already removed from Engine this will return -1.- Gibt zurück:
- The index of the field in the field set of this engine or -1 if the field was already removed from the engine.
- Seit:
- 6.0
- Siehe auch:
-
isUsed
public boolean isUsed()FOR INTERNAL USE ONLY- Seit:
- 6.0
-
checkNameExists
Checks whether the string name is the property 'name' of the field.- Parameter:
nameToCheck- Name to be checked- Gibt zurück:
- true if name equals the field's property 'name'
- Seit:
- 6.0
-
addReferenceHolder
public void addReferenceHolder(com.inet.report.ReferenceHolder holder) FOR INTERNAL USE ONLY- Angegeben von:
addReferenceHolderin Schnittstellecom.inet.report.ReferencedObject- Seit:
- 6.0
-
getReferenceHolders
public com.inet.report.ReferenceHolder[] getReferenceHolders()FOR INTERNAL USE ONLY- Angegeben von:
getReferenceHoldersin Schnittstellecom.inet.report.ReferencedObject
-
getReferenceHolderCount
public int getReferenceHolderCount()FOR INTERNAL USE ONLY- Angegeben von:
getReferenceHolderCountin Schnittstellecom.inet.report.ReferencedObject
-
getRealReferenceCount
public int getRealReferenceCount()FOR INTERNAL USE ONLY- Angegeben von:
getRealReferenceCountin Schnittstellecom.inet.report.ReferencedObject
-
removeReferenceHolder
public void removeReferenceHolder(com.inet.report.ReferenceHolder holder) FOR INTERNAL USE ONLY- Angegeben von:
removeReferenceHolderin Schnittstellecom.inet.report.ReferencedObject- Seit:
- 6.0
-
rename
FOR INTERNAL USE ONLY- Löst aus:
ReportException- Seit:
- 6.0
-
extractReference
extracts the referenced field and sets it for this Field object- Parameter:
atts- XML attributes containing "name" and "value"- Löst aus:
ReportException- If there are problems setting the field- Seit:
- 8.0
-
trimAwayBrackets
-
parseElement
public NodeParser parseElement(com.inet.report.parser.XMLTag group, String tag, Attributes atts, Map<String, Object> parserMap) throws FatalParserExceptionFOR 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.
- Angegeben von:
parseElementin SchnittstelleNodeParser- Parameter:
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.- Gibt zurück:
- The NodeParser sub-element if one needed to be created, or null if none was created.
- Löst aus:
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.
-
parseText
FOR INTERNAL USE ONLY Internal method for reading report XMLThis method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)
- Angegeben von:
parseTextin SchnittstelleNodeParser- Parameter:
text- text encountered and to be storedparserMap- The map of current Parser.
-
parseEndElement
public void parseEndElement(com.inet.report.parser.XMLTag group, String tag, Map<String, Object> parserMap) throws FatalParserExceptionFOR INTERNAL USE ONLY Internal method for reading report XMLReceive notification of the end of an XML tag.
- Angegeben von:
parseEndElementin SchnittstelleNodeParser- Parameter:
group- XMLTag of the current node to be parsed, or null if there is no such current group.tag- The XMLTag to be parsedparserMap- The map of current Parser.- Löst aus:
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.
-
isDOMParser
public boolean isDOMParser()FOR INTERNAL USE ONLY Internal method for reading report XMLReturns whether this node is to be read via a DOM parser.
- Angegeben von:
isDOMParserin SchnittstelleNodeParser- Gibt zurück:
- true if this node is to be read via a DOM parser, false otherwise.
-
parseDOM
FOR INTERNAL USE ONLY Internal method for reading report XMLParses the node.
- Angegeben von:
parseDOMin SchnittstelleNodeParser- Parameter:
node- the nodeparserMap- The map of current Parser.- Löst aus:
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.
-
duplicate
Duplicates this field with all its settings and returns the created Field with the given name. Note that the new formula field will not initially be referenced by any other report objects. If you duplicate a property formula, you will have to set the new formula as a separate property formula.- Parameter:
name- the name the created field should have.- Gibt zurück:
- the duplicated field.
- Löst aus:
IllegalArgumentException- if an field with the given name already exists .UnsupportedOperationException- if a field which is not a FormulaField, PromptField, SQLField, or SummaryField is attempted to be duplicated- Seit:
- 9.0
-