// resolves without a stream name, return descriptor and null stream name
return new Pair<PropertyResolutionDescriptor, String>(propertyInfo, propertyInfo.getStreamName());
}
// try to resolve the property name and stream name as it is (ie. stream name as a stream name)
StreamTypesException typeExceptionOne;
try
{
propertyInfo = streamTypeService.resolveByStreamAndPropName(streamOrPropertyName, unresolvedPropertyName);
// resolves with a stream name, return descriptor and stream name
return new Pair<PropertyResolutionDescriptor, String>(propertyInfo, streamOrPropertyName);
}
catch (StreamTypesException ex)
{
typeExceptionOne = ex;
}
// try to resolve the property name to a nested property 's0.p0'
StreamTypesException typeExceptionTwo;
String propertyNameCandidate = streamOrPropertyName + '.' + unresolvedPropertyName;
try
{
propertyInfo = streamTypeService.resolveByPropertyName(propertyNameCandidate);
// resolves without a stream name, return null for stream name
return new Pair<PropertyResolutionDescriptor, String>(propertyInfo, null);
}
catch (StreamTypesException ex)
{
typeExceptionTwo = ex;
}
String suggestionOne = getSuggestion(typeExceptionOne);
String suggestionTwo = getSuggestion(typeExceptionTwo);
if (suggestionOne != null)
{
throw new ExprValidationPropertyException(typeExceptionOne.getMessage() + suggestionOne);
}
if (suggestionTwo != null)
{
throw new ExprValidationPropertyException(typeExceptionTwo.getMessage() + suggestionTwo);
}
// fail to resolve
throw new ExprValidationPropertyException("Failed to resolve property '" + propertyNameCandidate + "' to a stream or nested property in a stream");
}