public abstract class Field extends java.lang.Object implements java.io.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, ... .Fields
, so you can not create an instance of Field
or subclasses. DatabaseField
SqlExprField
SummaryField
FormulaField
PromptField
Fields
,
FieldElement
,
FieldPart
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
BINARY
The constant that identifies a Binary value.
|
static int |
BOOLEAN
The constant that identifies a Boolean value.
|
static int |
CURRENCY
The constant that identifies a Currency value.
|
static int |
CURSOR
The constant that identifies a Cursor value.
|
static int |
DATABASE_FIELD
Field is a database field.
|
static int |
DATE
The constant that identifies a Date value.
|
static int |
DATETIME
The constant that identifies a DateTime value.
|
static int |
FORMULA_FIELD
Field is a formula field.
|
static int |
GROUP_NAME_FIELD
Field is a group name field.
|
static int |
NUMBER
The constant that identifies a Number value.
|
static int |
PARAMETER_FIELD
Field is a parameter field.
|
static int |
SORT_FIELD
Field is a sort field.
|
static int |
SPECIAL_FIELD
Field is a special field.
|
static int |
SQL_FIELD
Field is a sql field.
|
static int |
STRING
The constant that identifies a String value.
|
static int |
SUMMARY_FIELD
Field is a summary field.
|
static int |
TIME
The constant that identifies a Time value.
|
static int |
UNKNOWN
The constant that identifies an unspecific type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkNameExists(java.lang.String nameToCheck)
Checks whether the string name is the property 'name' of the field.
|
Field |
duplicate(java.lang.String name)
Duplicates this field with all its settings and returns the created Field with the given name.
|
protected void |
extractReference(org.xml.sax.Attributes atts)
extracts the referenced field and sets it for this Field object
|
Field |
getField()
Gets the field definition element (for example, database field element, prompt field element).
|
Group |
getGroup()
Returns the group this field is associated with.
|
java.lang.String |
getName()
Returns the value of the property 'name'.
|
java.lang.String |
getPlaceholderName()
Returns the placeholder of this field including its brackets, required to use the field in formulas and sql statements.
|
java.lang.String |
getRefName()
Returns the value of the property 'name' with a type marker.
|
int |
getType()
Returns the value of the property 'type'.
|
int |
getValueType()
Returns the value type (or return type) of the field.
|
int |
indexOf()
Returns the index of the field in the fields set.
|
java.lang.String |
paramString()
Returns a prettified output of this field's name and type.
|
void |
setField(Field newField)
Sets the field definition element (for example, DatabaseField element, prompt field element).
|
void |
setGroup(Group group)
Sets the group this field should associated with.
|
abstract void |
setName(java.lang.String newValue)
Sets the value of the property 'name'.
|
void |
setValueType(int newValue)
Sets the value of the property 'value type'.
|
protected java.lang.String |
trimAwayBrackets(java.lang.String refname)
trims away "{" before and after string, e.g.
|
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
public static final int NUMBER
public static final int CURRENCY
public static final int BOOLEAN
public static final int DATE
public static final int TIME
public static final int STRING
public static final int BINARY
public static final int DATETIME
public static final int CURSOR
public static final int UNKNOWN
public static final int DATABASE_FIELD
public static final int FORMULA_FIELD
public static final int SUMMARY_FIELD
public static final int SPECIAL_FIELD
public static final int GROUP_NAME_FIELD
public static final int PARAMETER_FIELD
public static final int SORT_FIELD
public static final int SQL_FIELD
public java.lang.String paramString()
public java.lang.String getPlaceholderName()
public java.lang.String getName()
setName(java.lang.String)
,
getRefName()
public abstract void setName(java.lang.String newValue) throws ReportException
newValue
- newValue
The new value of the property 'name'.ReportException
- will thrown if the name already exists or is not allowed.public java.lang.String getRefName()
public Field getField()
Field
The current value of the 'field' property.public void setField(Field newField)
newField
- The new field element of the property 'field'.public int getType()
DATABASE_FIELD
,
FORMULA_FIELD
,
SUMMARY_FIELD
,
SPECIAL_FIELD
,
GROUP_NAME_FIELD
,
PARAMETER_FIELD
,
SORT_FIELD
,
SQL_FIELD
,
DatabaseField
,
FormulaField
,
SummaryField
,
SpecialField
,
GroupField
,
PromptField
,
SortField
,
SQLField
public Group getGroup()
null
.SummaryField
,
GroupField
,
Group
public void setGroup(Group group)
group
- The reference to the group of this field.SummaryField
,
GroupField
,
Group
public int getValueType()
public void setValueType(int newValue)
public int indexOf()
Fields.removeDatabaseField(int)
,
Fields.removeFormulaField(int)
,
Fields.removePromptField(int)
,
Fields.removeSummaryField(int)
,
Fields.removeSQLField(int)
,
Fields.removeSortField(int)
,
Fields.getDatabaseField(int)
,
Fields.getFormulaField(int)
,
Fields.getPromptField(int)
,
Fields.getSummaryField(int)
,
Fields.getSQLExpressionField(int)
,
Fields.getSortField(int)
public boolean checkNameExists(java.lang.String nameToCheck)
nameToCheck
- Name to be checkedprotected void extractReference(org.xml.sax.Attributes atts) throws ReportException
atts
- XML attributes containing "name" and "value"ReportException
- If there are problems setting the fieldprotected java.lang.String trimAwayBrackets(java.lang.String refname)
refname
- name to trimpublic Field duplicate(java.lang.String name)
name
- the name the created field should have.java.lang.IllegalArgumentException
- if an field with the given name already exists .java.lang.UnsupportedOperationException
- if a field which is not a FormulaField, PromptField,
SQLField, or SummaryField is attempted to be duplicatedCopyright © 1999-2020 by i-net software GmbH