
com.sap.cloud.servicesdk.prov.jacksonutil.CustomPropertyNameingStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jacksonutil-sdk3 Show documentation
Show all versions of jacksonutil-sdk3 Show documentation
SAP Cloud Platform SDK for service development
/*******************************************************************************
* (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