.resolvePolicyExpression(((StyleComponentURI)labelContent).getExpression());
// Create image asset from the policy and get fallback
DefaultComponentImageAssetReference imageAsset = new DefaultComponentImageAssetReference(
policyReference, assetResolver);
TextAssetReference textAsset = imageAsset.getTextFallback();
// If e.g policy file is missing and as consequence textAsset == null,
// throw suitable exception
if (null == textAsset) {
throw new ProtocolException(exceptionLocalizer.format(
"missing-policy-failure", policyReference.getName()));
}
// Return text in plain encoding, or empty string
textLabel = textAsset.getText(TextEncoding.PLAIN);
if (null == textLabel) {
textLabel = "";
}
} else if (labelContent instanceof StyleString) {
textLabel = ((StyleString)labelContent).getString();