}
}
private ClassInfo classNameForUnnamedTraverse(JDefinedClass parentClass, String memberName, DataSchema schema)
{
DataSchema dereferencedDataSchema = schema.getDereferencedDataSchema();
switch (dereferencedDataSchema.getType())
{
case ARRAY:
ArrayDataSchema arraySchema = (ArrayDataSchema) dereferencedDataSchema;
CustomInfo customInfo = firstCustomInfo(arraySchema.getItems());
if (customInfo != null)
{
return new ClassInfo(customInfo.customSchema.getNamespace(), customInfo.customSchema.getName() + ARRAY_SUFFIX);
}
else
{
ClassInfo classInfo = classNameForUnnamedTraverse(parentClass, memberName, arraySchema.getItems());
classInfo.name += ARRAY_SUFFIX;
return classInfo;
}
case MAP:
MapDataSchema mapSchema = (MapDataSchema) dereferencedDataSchema;
customInfo = firstCustomInfo(mapSchema.getValues());
if (customInfo != null)
{
return new ClassInfo(customInfo.customSchema.getNamespace(), customInfo.customSchema.getName() + MAP_SUFFIX);
}
else
{
ClassInfo classInfo = classNameForUnnamedTraverse(parentClass, memberName, mapSchema.getValues());
classInfo.name += MAP_SUFFIX;
return classInfo;
}
case UNION:
if (schema.getType() == DataSchema.Type.TYPEREF)
{
DataSchema referencedDataSchema;
TyperefDataSchema typerefDataSchema = (TyperefDataSchema) schema;
while ((referencedDataSchema = typerefDataSchema.getDereferencedDataSchema()) != dereferencedDataSchema)
{
typerefDataSchema = (TyperefDataSchema) referencedDataSchema;
}