Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.1.2
-
Component/s: Examples / Tutorials
-
Labels:None
-
User impact:Low
-
Affects Docs:Yes
-
Similar Issues:None
Description
Documentation in :
http://www.mulesoft.org/documentation/display/MULE3USER/Creating+Custom+Transformer+Class
Is suggesting to use :
this.registerSourceType(String.class);
this.setReturnClass(NameString.class);
But as in AbstractTransformer.java :
/**
- Register a supported data type with this transformer. The will allow objects that match this data type to be
- transformed by this transformer.
* - @param aClass the source type to allow
- @deprecated use registerSourceType(DataType)
*/
@Deprecated
protected void registerSourceType(Class<?> aClass) { registerSourceType(new SimpleDataType<Object>(aClass)); }
@Deprecated
public void setReturnClass(Class<?> newClass)
So probably :
registerSourceType(DataTypeFactory.OBJECT);
setReturnDataType(DataTypeFactory.create(NameString.class));
Should have been used instead. Also It uses "NameString" which is not imported at the beginning of the example.
Updated all references to deprecated API with valid ones.