protected void safeAddSystemPropertiesToMessage()

in src/main/java/com/aliyun/mns/model/serialize/XMLDeserializer.java [138:155]


    protected void safeAddSystemPropertiesToMessage(Element root, Message message) {
        Element systemPropertiesElement = safeGetElement(root, SYSTEM_PROPERTIES_TAG);
        if (systemPropertiesElement != null) {
            for (Element propertyValueElement : safeGetElements(systemPropertiesElement, MESSAGE_SYSTEM_PROPERTY_TAG)) {
                String name = safeGetElementContent(propertyValueElement, PROPERTY_NAME_TAG, null);
                String value = safeGetElementContent(propertyValueElement, PROPERTY_VALUE_TAG, null);
                String type = safeGetElementContent(propertyValueElement, PROPERTY_TYPE_TAG, null);

                if (name != null && value != null && type != null) {
                    SystemPropertyType systemPropertyType = SystemPropertyType.valueOf(type);
                    MessageSystemPropertyValue propertyValue = new MessageSystemPropertyValue(systemPropertyType,
                        value);
                    MessageSystemPropertyName propertyName = MessageSystemPropertyName.getByValue(name);
                    message.putSystemProperty(propertyName, propertyValue);
                }
            }
        }
    }