Package com.inet.report
Class SQLField
- java.lang.Object
-
- com.inet.report.Field
-
- com.inet.report.SQLField
-
- All Implemented Interfaces:
NodeParser
,com.inet.report.ReferencedObject
,com.inet.report.ReferenceHolder
,Validatable
,java.io.Serializable
public class SQLField extends Field implements com.inet.report.ReferenceHolder, Validatable
- See Also:
- Serialized Form
-
-
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 void
addReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLYvoid
changeAliasName(java.lang.String oldAlias, java.lang.String newAlias)
FOR INTERNAL USE ONLYField
duplicate(java.lang.String copyName)
Duplicates this field with all its settings and returns the created Field with the given name.Datasource
getDatasource()
Returns the datasource.int
getRealReferencedObjectCount()
FOR INTERNAL USE ONLYint
getReferencedObjectCount()
FOR INTERNAL USE ONLYcom.inet.report.ReferencedObject[]
getReferencedObjects()
FOR INTERNAL USE ONLYjava.lang.String
getSQLExpression()
Returns the value of the property 'SQL expression text'.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
parseText(java.lang.String text, 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)
FOR INTERNAL USE ONLYvoid
setName(java.lang.String name)
Sets the name of the SQL field.void
setReferences()
FOR INTERNAL USE ONLYvoid
setSQLExpression(java.lang.String formula)
Sets the value of the property 'SQL expression text'.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, equals, extractReference, getField, getGroup, getName, getPlaceholderName, getRealReferenceCount, getReferenceHolderCount, getReferenceHolders, getRefName, getType, getValueType, indexOf, isDOMParser, paramString, parseDOM, parseEndElement, removeReferenceHolder, rename, setField, setGroup, setValueType, trimAwayBrackets
-
-
-
-
Method Detail
-
setName
public void setName(java.lang.String name) throws ReportException
Sets the name of the SQL field. The name does not exists already, otherwise an exception will be thrown.- Specified by:
setName
in classField
- Parameters:
name
- Name of the SQL field- Throws:
ReportException
- is thrown when name == null or name.length() == 0java.lang.IllegalArgumentException
- is thrown when the name already exists.- Since:
- 6.0
-
getSQLExpression
public java.lang.String getSQLExpression()
Returns the value of the property 'SQL expression text'.- Returns:
- The value of the property 'SQL expression text'.
- Since:
- 6.0
-
setSQLExpression
public void setSQLExpression(java.lang.String formula) throws ReportException
Sets the value of the property 'SQL expression text'. The value type of the result of this SQL expression is fetched by the configured database.- Parameters:
formula
- The new value of the property 'SQL expression text'.- Throws:
ReportException
- is thrown if the SQL expression contains errors or a connection to the configured database fails.- Since:
- 6.0
-
changeAliasName
public void changeAliasName(java.lang.String oldAlias, java.lang.String newAlias)
FOR INTERNAL USE ONLY
-
saveFieldXML2
protected void saveFieldXML2(java.io.PrintWriter pw, int depth)
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
- Since:
- 6.0
-
getReferencedObjects
public final com.inet.report.ReferencedObject[] getReferencedObjects()
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjects
in interfacecom.inet.report.ReferenceHolder
- Since:
- 6.0
-
getRealReferencedObjectCount
public final int getRealReferencedObjectCount()
FOR INTERNAL USE ONLY- Specified by:
getRealReferencedObjectCount
in interfacecom.inet.report.ReferenceHolder
- Since:
- 6.0
-
getReferencedObjectCount
public final int getReferencedObjectCount()
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjectCount
in interfacecom.inet.report.ReferenceHolder
-
removeReferencedObject
public final void removeReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLY- Specified by:
removeReferencedObject
in interfacecom.inet.report.ReferenceHolder
-
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
-
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.
-
parseText
public void parseText(java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY 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)
- Specified by:
parseText
in interfaceNodeParser
- Overrides:
parseText
in classField
- Parameters:
text
- text encountered and to be storedparserMap
- The map of current Parser.
-
duplicate
public Field duplicate(java.lang.String copyName)
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.
-
getDatasource
public Datasource getDatasource()
Returns the datasource. This field use the datasource to get data from the database.- Returns:
- the datasource (not null)
- Since:
- 9.2
-
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.
-
-