// parse, can be an indexed property
Property property = PropertyParser.parse(propertyName, false);
if (property instanceof IndexedProperty)
{
IndexedProperty indexedProp = (IndexedProperty) property;
Object type = nestableTypes.get(indexedProp.getPropertyNameAtomic());
if (type == null)
{
return null;
}
else if (type instanceof EventType[])
{
EventType eventType = ((EventType[]) type)[0];
return new FragmentEventType(eventType, false, false);
}
else if (type instanceof String)
{
String propTypeName = type.toString();
boolean isArray = EventTypeUtility.isPropertyArray(propTypeName);
if (!isArray) {
return null;
}
propTypeName = EventTypeUtility.getPropertyRemoveArray(propTypeName);
EventType innerType = eventAdapterService.getExistsTypeByName(propTypeName);
if (!(innerType instanceof BaseNestableEventType))
{
return null;
}
return new FragmentEventType(innerType, false, false); // false since an index is present
}
if (!(type instanceof Class))
{
return null;
}
if (!((Class) type).isArray())
{
return null;
}
// its an array
return EventBeanUtility.createNativeFragmentType(((Class)type).getComponentType(), null, eventAdapterService);
}
else if (property instanceof MappedProperty)
{
// No type information available for the inner event
return null;
}
else
{
return null;
}
}
// Map event types allow 2 types of properties inside:
// - a property that is a Java object is interrogated via bean property getters and BeanEventType
// - a property that is a Map itself is interrogated via map property getters
// The property getters therefore act on
// Take apart the nested property into a map key and a nested value class property name
String propertyMap = ASTFilterSpecHelper.unescapeDot(propertyName.substring(0, index));
String propertyNested = propertyName.substring(index + 1, propertyName.length());
// If the property is dynamic, it cannot be a fragment
if (propertyMap.endsWith("?"))
{
return null;
}
Object nestedType = nestableTypes.get(propertyMap);
if (nestedType == null)
{
// parse, can be an indexed property
Property property = PropertyParser.parse(propertyMap, false);
if (property instanceof IndexedProperty)
{
IndexedProperty indexedProp = (IndexedProperty) property;
Object type = nestableTypes.get(indexedProp.getPropertyNameAtomic());
if (type == null)
{
return null;
}
// handle map-in-map case