* @param schema
* only used for type complexdata
* @return the created DataType input object
*/
public static DataType createInputDataType(Object obj, int type, String schema, String mimeType) {
DataType dt = Wps10Factory.eINSTANCE.createDataType();
if (type == INPUTTYPE_LITERAL)
{
LiteralDataType ldt = Wps10Factory.eINSTANCE.createLiteralDataType();
ldt.setValue(obj.toString());
dt.setLiteralData(ldt);
}
else
{
// assume complex data
ComplexDataType cdt = Wps10Factory.eINSTANCE.createComplexDataType();
// do I need to add a FeatureMap object, or Entry object, or what?
// EStructuralFeature eStructuralFeature = null;
// Entry createEntry = FeatureMapUtil.createEntry(eStructuralFeature, obj);
// cdt.getMixed().add(obj);
cdt.getData().add(obj);
if (schema != null)
{
cdt.setSchema(schema);
}
if(mimeType != null) {
cdt.setMimeType(mimeType);
}
dt.setComplexData(cdt);
}
return dt;
}