fmeobjects.FMEFeature.getAttributeAsType
- FMEFeature.getAttributeAsType(attrName, attrType, fallback)
This method is deprecated as of FME 2021.0. Please use
getAttribute
with desired type instead.Get the value of the named attribute, casted to the specified FME type, then to an appropriate python type.
An optional third parameter can be specified to be returned as a fallback in case type conversion fails.
Example: getAttributeAsType(“output_file_type”, fmeobjects.FME_ATTR_STRING, “png”)
The enum value fmeobjects.FME_ATTR_UNDEFINED can be used to retrieve a list object. If used to try and get a single attribute as a list, or a list as a single type, there is automatic conversion failure.
A return of
None
indicates the attribute does not exist.