SPAN8.
SPAN4.
FME 2014介绍了对功能的NULL属性的支持。目前或希望使用空值的插件需要代码更改。其他插件在很大程度上不受影响。
例如,支持数据库格式的读取器/写入器插件可能提供:
The central issue is how FME deals with the concept of “no data”. An attribute may have a concrete value (e.g., the number 5 or the string “hello”), or it may represent a lack of data in one of three ways: it can bemissing(不存在),空的(即,没有文本的字符串),或空值(数据库概念意味着“未知”)。这三个“无数据”概念可以以多种形式和系统以各种形式找到。
Prior to FME 2014, the convention was to represent null values in external data as missing attributes in FME. However, the situation was ambiguous: sometimes nulls became empty strings instead, and many missing attributes were missing for reasons other than being null.
(1)在FME 2014中,存在null属性。
2013年FME之前,null值通常是代表resented as missing attributes. A request to get a missing attribute as a string fails. A request to list the attributes on a feature will not return missing attributes.
在FME 2014中,NULL值表示为NULL;它们存在。将NULL属性作为字符串的请求将成功,返回空字符串。列出要素上的属性的请求将包括null属性。
由于某些插件将接收以前用于接收缺失属性的空属性(例如,来自数据库读取器的功能),因此可能存在一些情况。这些插件通常会将NULL值视为空字符串。例如,在空的属性上失败但跳过缺失的插件将受到影响。
(2) FME 2014 supports null values of all the primitive types.
Each attribute in FME has a type. It can be a string, a 32-bit integer, etc. In FME 2014, an attribute can have any of the normal types, whether or not it is null.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++功能类型:`attr_test_LOGGED '属性(布尔值):`嘘声' 具有值'是属性(布尔值):`boo_null'是属性(编码:utf-16):`enc'有价值`你好世界!'属性(编码:UTF-16):`enc_null'是 属性(字符串):`fme_feature_type'具有值`attr_test'属性(字符串):`fme_type'有值`fme_no_geom'属性(32位真实):`r32'具有值`123.456'属性(32位实数):`r32_null'是 属性(64位实数):`r64'有值`1234567890.12345'属性(64位实real):`r64_null'是 属性(8位整数):`s08'有值`100'属性(8位整数):`s08_null'是 属性(16位整数):`s16'有值`30000'属性(16位整数):`s16_null'是 属性(32位整数):`s32'有值`200000000000'属性(32位整数):`s32_null'是 属性(64位整数):`s64'有值`9000000000000000000'属性(64位整数):`s64_null'是 属性(字符串):`str'有价值`你好世界!'属性(字符串):`str_null'是 属性(8位无符号整数):`u08'具有值`200'属性(8位无符号整数):`u08_null'是 属性(16位无符号整数):“U16”有值`60000'属性(16位无符号整数):`u16_null'是 属性(32位无符号整数):`u32'有值`4000000000'属性(32位无符号整数):`u32_null' 属性(64位无符号整数):`u64'有值`100000000000000000000000'属性(64位无符号整数):`u64_null'是 几何类型:未知(0)============================================================================.
... getAttribute调用将失败为null属性(未检测到),而不设置返回值。这意味着后续代码可以在未初始化,默认或意外值上运行。
As noted above, the previous convention was to represent null values in external data as missing attributes in FME. In FME 2014, those null values are now represented as null.
Examples of the previous behavior:
上述每个的相应FME 2014行为如下:
Developers of existing plug-ins with explicit support for null values should do the following:
第一个是最重要的。未更新的插件可能会遇到向后兼容性中断,因为它们可能开始接收以前接收到缺少属性的NULL属性。这可能会导致失败,或者为空字符串处理空缺。
As plug-ins are modified to deal with more kinds of “no data” (i.e., missing, empty, and null attributes), it can be challenging to track the different states. This is most pronounced for plug-ins that store and extensively manipulate attribute values as strings. In the future, we hope to offer additional tools to assist with these challenges.
虚拟void ifmemeature :: setattributenullwithtype(const char * attrname,const fme_attributetype attrype)
virtual void IFMEFeature::getAttributeNullMissingAndType ( const char * attrName, FME_Boolean & isNull, FME_Boolean & isMissing, FME_AttributeType & attrType ) const
虚拟void settraitnullwithtype(constnmestring&traitname,const fme_attributetype traittype)
虚拟void ifmegometry :: getTraitnullmissinganddype(const Ifmestring&traitname,fme_boolean&isnull,fme_boolean&Ismissing,fme_attributeType&traittype)const
Sample TFS读取器和写入器已扩展为包括对NULL属性的支持。
When retrieving attributes from features (e.g., in a writer plug-in), we recommend that you minimize the number of calls to IFMEFeature to maximize performance. This is why we provided the hybrid getAttributeNullMissingAndType() method. Our expectation is that most plug-ins will be able to make one call to this method, potentially followed by one call to getAttribute() or similar.
附加关键字:pluginBuilder,集成
©2019 S亚搏在线afe Software Inc |法律