basicMessage = "Definition " + QNameHelper.pretty(itemName) + " not found.";
break;
}
String helpfulMessage = "";
SchemaComponent foundComponent = findSpelling(itemName);
QName name;
if (foundComponent != null)
{
name = foundComponent.getName();
if (name != null)
{
String sourceName = null;
switch (foundComponent.getComponentType())
{
case SchemaComponent.TYPE:
sourceName = ((SchemaType)foundComponent).getSourceName();
break;
case SchemaComponent.ELEMENT:
sourceName = ((SchemaGlobalElement)foundComponent).getSourceName();
break;
case SchemaComponent.ATTRIBUTE:
sourceName = ((SchemaGlobalAttribute)foundComponent).getSourceName();
break;
}
String source = "";
if (sourceName != null)
{
source = " (in " + sourceName.substring(sourceName.lastIndexOf('/') + 1) + ")";
}
if (name.equals(itemName))
{
switch (foundComponent.getComponentType())
{
case SchemaComponent.TYPE:
helpfulMessage = " Do you mean to refer to the type with that name" + source + "?";
break;
case SchemaComponent.ELEMENT:
helpfulMessage = " Do you mean to refer to the element with that name" + source + "?";
break;
case SchemaComponent.ATTRIBUTE:
helpfulMessage = " Do you mean to refer to the attribute with that name" + source + "?";
break;
case SchemaComponent.ATTRIBUTE_GROUP:
helpfulMessage = " Do you mean to refer to the attribute group with that name" + source + "?";
break;
case SchemaComponent.MODEL_GROUP:
helpfulMessage = " Do you mean to refer to the model group with that name" + source + "?";
break;
}
}
else
{
switch (foundComponent.getComponentType())
{
case SchemaComponent.TYPE:
helpfulMessage = " Do you mean to refer to the type named " + QNameHelper.pretty(name) + source + "?";
break;
case SchemaComponent.ELEMENT: