throw new NullPointerException();
}
final String propertyRole = metaData.getPropertyRole();
if ("Content".equals(propertyRole))
{
final ResourceKey contentBase = reportElement.getContentBase();
final ResourceKey elementSource = reportElement.getDefinitionSource();
if (attributeValue instanceof ResourceKey)
{
final ResourceKey path = (ResourceKey) attributeValue;
final boolean linked = BundleUtilities.isSameBundle(elementSource, path);
return new ResourceReference[]{new ResourceReference(path, linked)};
}
else if (attributeValue instanceof String && contentBase != null)
{
try
{
// not a resource-key, so try to make one ..
final ResourceKey path = resourceManager.deriveKey(contentBase, String.valueOf(attributeValue));
// the content base may not point to a bundle location, so that the path does not point to a
// bundle location as well. If linked is computed to false, we can be sure that the resource is loaded
// from within the bundle, which means that the attribute value was a relative path inside the bundle.
final boolean linked = BundleUtilities.isSameBundle(elementSource, path) == false;
return new ResourceReference[]{new ResourceReference(path, linked)};
}
catch (ResourceKeyCreationException rce)
{
// ignore ..
}
}
else if (attributeValue != null)
{
try
{
// not a resource-key, so try to make one ..
final ResourceKey path = resourceManager.createKey(attributeValue);
final boolean linked = BundleUtilities.isSameBundle(elementSource, path) == false;
return new ResourceReference[]{new ResourceReference(path, linked)};
}
catch (ResourceKeyCreationException rce)
{