int inputtype = 0;
// first try to figure out if the input is a literal or complex based
// on the data in the idt
LiteralInputType literalData = idt.getLiteralData();
SupportedComplexDataInputType complexData = idt.getComplexData();
if (literalData != null)
{
inputtype = INPUTTYPE_LITERAL;
}
else if (complexData != null)
{
inputtype = INPUTTYPE_COMPLEXDATA;
}
else
{
// is the value a literal? Do a very basic test here for common
// literal types. TODO: figure out a more thorough test here
if ((obj instanceof String) || (obj instanceof Double) || (obj instanceof Float) ||
(obj instanceof Integer))
{
inputtype = INPUTTYPE_LITERAL;
}
else
{
// assume complex data
inputtype = INPUTTYPE_COMPLEXDATA;
}
}
// now create the input based on its type
String schema = null;
if (inputtype == INPUTTYPE_COMPLEXDATA)
{
ComplexDataCombinationsType supported = complexData.getSupported();
ComplexDataDescriptionType cddt = (ComplexDataDescriptionType) supported.getFormat().get(0);
schema = cddt.getSchema();
}
return createInputDataType(obj, inputtype, schema);