All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.servicesdk.prov.jacksonutil.CustomPropertyNameingStrategy Maven / Gradle / Ivy

There is a newer version: 1.40.11
Show newest version
/*******************************************************************************
 * (c) 201X SAP SE or an SAP affiliate company. All rights reserved.
 ******************************************************************************/
package com.sap.cloud.servicesdk.prov.jacksonutil;

import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.cfg.MapperConfig;
import com.fasterxml.jackson.databind.introspect.AnnotatedField;
import com.sap.cloud.sdk.result.ElementName;

public class CustomPropertyNameingStrategy extends PropertyNamingStrategy {
	@Override
	public String nameForField(MapperConfig config, AnnotatedField field, String defaultName) {
				
		ElementName elementName = field.getAnnotation(ElementName.class); 
		if (elementName!=null)
			 return elementName.value();
		else
			return defaultName ;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy