Compare commits

...

2 Commits

View File

@@ -27,6 +27,7 @@ imports="
org.talend.daikon.properties.property.Property
org.talend.designer.codegen.config.CodeGeneratorArgument
org.talend.core.model.utils.NodeUtil
org.talend.core.model.utils.ContextParameterUtils
"
%>
<%@include file="@{org.talend.designer.codegen}/jet_stub/generic/component_util_indexedrecord_to_rowstruct.javajet"%>
@@ -61,8 +62,9 @@ List<Component.CodegenPropInfo> propsToProcess = component.getCodegenPropInfos(c
<%= componentProps.getClass().getName()%> props_<%=cid %> =
(<%= componentProps.getClass().getName()%>) def_<%=cid %>.createRuntimeProperties();
Object propValue_<%=cid%> = null;
<%
for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo
List<NamedThing> properties = propInfo.props.getProperties();
for (NamedThing prop : properties) { // property
@@ -118,6 +120,20 @@ for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo
props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>",
new org.apache.avro.Schema.Parser().parse(<%=component.getCodegenValue(property, property.getStringValue())%>));
<%
} else if (value != null && "java.lang.Integer".equals(property.getType())){
String displayValue = value.toString();
if(ContextParameterUtils.isContainContextParam(displayValue)) {%>
try {
propValue_<%=cid%> = Integer.valueOf(<%=displayValue%>);
} catch (java.lang.NullPointerException re_<%=cid%>) {
propValue_<%=cid%> = null;
}
<%} else {%>
propValue_<%=cid%> = <%=displayValue%>;
<%}%>
props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>",propValue_<%=cid%>);
<%
} else if (!(value instanceof String) || !((String)value).equals("")) { // if
%>
props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>",