else if (objSymbol.supportsCoercion(TypeConstants.TYPE_MAP))
{
EList<ValueType> args = new BasicEList<ValueType>();
args.add(new StringLiteralType(propertyId.toString()));
ISymbol prop = objSymbol.call("get", args, propertyId.toString()); //$NON-NLS-1$
if (prop != null)
{
return prop;
}
typeDesc = objSymbol.coerce(TypeConstants.TYPE_MAP);
// handle string keys into maps that contain dots. Because type descriptor
// handle dotted property ids (i.e. 'x.y.z') as separate properties with
// intermediate parts, we need to handle this specially.
if (propertyId instanceof String && ((String)propertyId).indexOf('.')>-1)
{
factoredProperties = factorKey(propertyId);
}
}
//if symbol is "attrs", add it if applicable
else if (propertyId instanceof String
&& ((String)propertyId).equals(ATTRS_SYMBOL_NAME)) {
return getCCAttrsSymbolIfNecessary(typeDesc);
}
// check unconstrained type
if (typeDesc instanceof IBoundedTypeDescriptor)
{
// TODO: propertyId may need to change when supporting
// template types
if (((IBoundedTypeDescriptor)typeDesc).isUnboundedForType(TypeConstants.TYPE_JAVAOBJECT))
{
// the most we know is that it could be an Object
return ((IBoundedTypeDescriptor)typeDesc).getUnboundedProperty(propertyId, TypeConstants.TYPE_JAVAOBJECT);
}
}
}
int i = 0;
ISymbol matchedSymbol;
do
{
matchedSymbol = null; // always reset so if the for completes without setting, the
// while ends
SEARCH_SEGMENT: for (final Iterator it = getIterator(typeDesc); it.hasNext();)
{
final ISymbol element = (ISymbol) it.next();
if (element.getName().equals(factoredProperties[i])
&& element instanceof IObjectSymbol)
{
matchedSymbol = element;
typeDesc = ((IObjectSymbol)matchedSymbol).getTypeDescriptor();
break SEARCH_SEGMENT;