@Override public T getValue() { if (actualValue != null) { return actualValue; } if (valueForStorageWhenNotEncoded != null) { actualValue = valueForStorageWhenNotEncoded; return actualValue; } if (valueForStorageWhenEncoded != null) { if (prismContext == null) { throw new IllegalStateException( "PrismContext not set for SerializationSafeContainer holding " + StringUtils.abbreviate(valueForStorageWhenEncoded, MAX_WIDTH)); } if (encodingScheme == EncodingScheme.PRISM) { try { PrismValue prismValue = prismContext.parserFor(valueForStorageWhenEncoded).xml().parseItemValue(); actualValue = prismValue != null ? prismValue.getRealValue() : null; } catch (SchemaException e) { throw new SystemException( "Couldn't deserialize value from JAXB: " + StringUtils.abbreviate(valueForStorageWhenEncoded, MAX_WIDTH), e); } return actualValue; } else { throw new IllegalStateException("Unexpected encoding scheme " + encodingScheme); } } return null; }