public Object readAttributeValue(String enclosingElement, String nesting, AttributeDefinition attributeDefinition, Object attrValue, B builderInfo) {
      if (attrValue == null) return null;
      Class type = attributeDefinition.getType();
      AttributeSerializer serializerConfig = attributeDefinition.getSerializerConfig();
      SerializationMode serializationMode = serializerConfig.getSerializationMode();

      boolean isElementSerialization = serializationMode == SerializationMode.AS_ELEMENT;
      if (isElementSerialization) return null;

      if (attrValue instanceof Map && type == TypedProperties.class) {
         TypedProperties typedProperties = new TypedProperties();
         typedProperties.putAll((Map) attrValue);
         return typedProperties;
      } else if (type.isEnum() && !attrValue.getClass().isEnum()) {
         return Enum.valueOf(type, attrValue.toString());
      } else if (type == Set.class) {
         if (attrValue instanceof Collection) {
            return new HashSet<>(((Collection) attrValue));
         }
      } else if (type == Integer.class && attrValue instanceof Number) {
         return ((Number) attrValue).intValue();
      } else if (type == Class.class) {
         return Util.loadClass(attrValue.toString(), builderInfo.getClass().getClassLoader());
      }
      return attrValue;
   }
public Object readAttributeValue ( String enclosingElement , String nesting , AttributeDefinition attributeDefinition , Object attrValue , B builderInfo ) { if ( attrValue == null ) return null ; Class type = attributeDefinition . getType ( ) ; AttributeSerializer serializerConfig = attributeDefinition . getSerializerConfig ( ) ; SerializationMode serializationMode = serializerConfig . getSerializationMode ( ) ; boolean isElementSerialization = serializationMode == SerializationMode . AS_ELEMENT ; if ( isElementSerialization ) return null ; if ( attrValue instanceof Map && type == TypedProperties . class ) { TypedProperties typedProperties = new TypedProperties ( ) ; typedProperties . putAll ( ( Map ) attrValue ) ; return typedProperties ; } else if ( type . isEnum ( ) && ! attrValue . getClass ( ) . isEnum ( ) ) { return Enum . valueOf ( type , attrValue . toString ( ) ) ; } else if ( type == Set . class ) { if ( attrValue instanceof Collection ) { return new HashSet < > ( ( ( Collection ) attrValue ) ) ; } } else if ( type == Integer . class && attrValue instanceof Number ) { return ( ( Number ) attrValue ) . intValue ( ) ; } else if ( type == Class . class ) { return Util . loadClass ( attrValue . toString ( ) , builderInfo . getClass ( ) . getClassLoader ( ) ) ; } return attrValue ; }
Read attribute value from serialized format, if {@link #canRead(String, String, String, AttributeDefinition)} is true
for this instance of serializer.

@param enclosingElement The parent element where the attribute is located.
@param nesting In case the attributed is serialized as an element, the name of this element or null otherwise.
@param attributeDefinition The serialized attribute definition.
@param attrValue The serialize attribute value.
@param builderInfo the {@link ConfigurationBuilderInfo} where the attribute is defined.
@return The attribute value deserialized.