本文整理汇总了Java中com.fasterxml.jackson.databind.util.NameTransformer类的典型用法代码示例。如果您正苦于以下问题:Java NameTransformer类的具体用法?Java NameTransformer怎么用?Java NameTransformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NameTransformer类属于com.fasterxml.jackson.databind.util包,在下文中一共展示了NameTransformer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: renameAll
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
public final BeanPropertyMap renameAll(NameTransformer paramNameTransformer)
{
if ((paramNameTransformer == null) || (paramNameTransformer == NameTransformer.NOP))
return this;
Iterator localIterator = iterator();
ArrayList localArrayList = new ArrayList();
while (localIterator.hasNext())
{
SettableBeanProperty localSettableBeanProperty1 = (SettableBeanProperty)localIterator.next();
SettableBeanProperty localSettableBeanProperty2 = localSettableBeanProperty1.withName(paramNameTransformer.transform(localSettableBeanProperty1.getName()));
SettableBeanProperty localSettableBeanProperty3 = localSettableBeanProperty2;
JsonDeserializer localJsonDeserializer1 = localSettableBeanProperty2.getValueDeserializer();
if (localJsonDeserializer1 != null)
{
JsonDeserializer localJsonDeserializer2 = localJsonDeserializer1.unwrappingDeserializer(paramNameTransformer);
if (localJsonDeserializer2 != localJsonDeserializer1)
localSettableBeanProperty3 = localSettableBeanProperty3.withValueDeserializer(localJsonDeserializer2);
}
localArrayList.add(localSettableBeanProperty3);
}
return new BeanPropertyMap(localArrayList);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:23,代码来源:BeanPropertyMap.java
示例2: renameAll
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
public UnwrappedPropertyHandler renameAll(NameTransformer paramNameTransformer)
{
ArrayList localArrayList = new ArrayList(this._properties.size());
Iterator localIterator = this._properties.iterator();
while (localIterator.hasNext())
{
SettableBeanProperty localSettableBeanProperty1 = (SettableBeanProperty)localIterator.next();
SettableBeanProperty localSettableBeanProperty2 = localSettableBeanProperty1.withName(paramNameTransformer.transform(localSettableBeanProperty1.getName()));
SettableBeanProperty localSettableBeanProperty3 = localSettableBeanProperty2;
JsonDeserializer localJsonDeserializer1 = localSettableBeanProperty2.getValueDeserializer();
if (localJsonDeserializer1 != null)
{
JsonDeserializer localJsonDeserializer2 = localJsonDeserializer1.unwrappingDeserializer(paramNameTransformer);
if (localJsonDeserializer2 != localJsonDeserializer1)
localSettableBeanProperty3 = localSettableBeanProperty3.withValueDeserializer(localJsonDeserializer2);
}
localArrayList.add(localSettableBeanProperty3);
}
return new UnwrappedPropertyHandler(localArrayList);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:21,代码来源:UnwrappedPropertyHandler.java
示例3: _resolveUnwrappedProperty
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
protected SettableBeanProperty _resolveUnwrappedProperty(DeserializationContext paramDeserializationContext, SettableBeanProperty paramSettableBeanProperty)
{
AnnotatedMember localAnnotatedMember = paramSettableBeanProperty.getMember();
if (localAnnotatedMember != null)
{
NameTransformer localNameTransformer = paramDeserializationContext.getAnnotationIntrospector().findUnwrappingNameTransformer(localAnnotatedMember);
if (localNameTransformer != null)
{
JsonDeserializer localJsonDeserializer1 = paramSettableBeanProperty.getValueDeserializer();
JsonDeserializer localJsonDeserializer2 = localJsonDeserializer1.unwrappingDeserializer(localNameTransformer);
if ((localJsonDeserializer2 != localJsonDeserializer1) && (localJsonDeserializer2 != null))
return paramSettableBeanProperty.withValueDeserializer(localJsonDeserializer2);
}
}
return null;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:17,代码来源:BeanDeserializerBase.java
示例4: rename
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
private final static BeanPropertyWriter[] rename(BeanPropertyWriter[] props,
NameTransformer transformer)
{
if (props == null || props.length == 0 || transformer == null || transformer == NameTransformer.NOP) {
return props;
}
final int len = props.length;
BeanPropertyWriter[] result = new BeanPropertyWriter[len];
for (int i = 0; i < len; ++i) {
BeanPropertyWriter bpw = props[i];
if (bpw != null) {
result[i] = bpw.rename(transformer);
}
}
return result;
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:17,代码来源:BeanSerializerBase.java
示例5: _findAndAddDynamic
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
@Override
protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map,
Class<?> type, SerializerProvider provider) throws JsonMappingException
{
JsonSerializer<Object> serializer;
if (_nonTrivialBaseType != null) {
JavaType subtype = provider.constructSpecializedType(_nonTrivialBaseType, type);
serializer = provider.findValueSerializer(subtype, this);
} else {
serializer = provider.findValueSerializer(type, this);
}
NameTransformer t = _nameTransformer;
if (serializer.isUnwrappingSerializer()) {
t = NameTransformer.chainedTransformer(t, ((UnwrappingBeanSerializer) serializer)._nameTransformer);
}
serializer = serializer.unwrappingSerializer(t);
_dynamicSerializers = _dynamicSerializers.newWith(type, serializer);
return serializer;
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:21,代码来源:UnwrappingBeanPropertyWriter.java
示例6: renameAll
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
/**
* Factory method for constructing a map where all entries use given
* prefix
*/
public BeanPropertyMap renameAll(NameTransformer transformer)
{
if (transformer == null || (transformer == NameTransformer.NOP)) {
return this;
}
Iterator<SettableBeanProperty> it = iterator();
ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>();
while (it.hasNext()) {
SettableBeanProperty prop = it.next();
String newName = transformer.transform(prop.getName());
prop = prop.withName(newName);
JsonDeserializer<?> deser = prop.getValueDeserializer();
if (deser != null) {
@SuppressWarnings("unchecked")
JsonDeserializer<Object> newDeser = (JsonDeserializer<Object>)
deser.unwrappingDeserializer(transformer);
if (newDeser != deser) {
prop = prop.withValueDeserializer(newDeser);
}
}
newProps.add(prop);
}
// should we try to re-index? Ordering probably changed but called probably doesn't want changes...
return new BeanPropertyMap(newProps);
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:30,代码来源:BeanPropertyMap.java
示例7: renameAll
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
public void renameAll(NameTransformer transformer)
{
ArrayList<SettableBeanProperty> oldProps = new ArrayList<SettableBeanProperty>(_properties);
Iterator<SettableBeanProperty> it = oldProps.iterator();
_properties.clear();
while (it.hasNext()) {
SettableBeanProperty prop = it.next();
String newName = transformer.transform(prop.getName());
prop = prop.withName(newName);
JsonDeserializer<?> deser = prop.getValueDeserializer();
if (deser != null) {
@SuppressWarnings("unchecked")
JsonDeserializer<Object> newDeser = (JsonDeserializer<Object>)
deser.unwrappingDeserializer(transformer);
if (newDeser != deser) {
prop = prop.withValueDeserializer(newDeser);
}
}
_properties.add(prop);
}
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:22,代码来源:UnwrappedPropertyHandler.java
示例8: unwrappingDeserializer
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* Not used
*/
@Override
public JsonDeserializer<Object> unwrappingDeserializer(
NameTransformer unwrapper) {
// Not used
return null;
}
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:12,代码来源:DataBinderDeserializer.java
示例9: rename
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
public BeanPropertyWriter rename(NameTransformer transformer) {
String newName = transformer.transform(_name.getValue());
if (newName.equals(_name.toString())) {
return this;
}
return new BeanPropertyWriter(this, new SerializedString(newName));
}
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:8,代码来源:BeanPropertyWriter.java
示例10: rename
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
private static final BeanPropertyWriter[] rename(BeanPropertyWriter[] paramArrayOfBeanPropertyWriter, NameTransformer paramNameTransformer)
{
if ((paramArrayOfBeanPropertyWriter == null) || (paramArrayOfBeanPropertyWriter.length == 0) || (paramNameTransformer == null) || (paramNameTransformer == NameTransformer.NOP))
return paramArrayOfBeanPropertyWriter;
int i = paramArrayOfBeanPropertyWriter.length;
BeanPropertyWriter[] arrayOfBeanPropertyWriter = new BeanPropertyWriter[i];
for (int j = 0; j < i; j++)
{
BeanPropertyWriter localBeanPropertyWriter = paramArrayOfBeanPropertyWriter[j];
if (localBeanPropertyWriter != null)
arrayOfBeanPropertyWriter[j] = localBeanPropertyWriter.rename(paramNameTransformer);
}
return arrayOfBeanPropertyWriter;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:15,代码来源:BeanSerializerBase.java
示例11: rename
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
public BeanPropertyWriter rename(NameTransformer paramNameTransformer)
{
String str = paramNameTransformer.transform(this._name.getValue());
if (str.equals(this._name.toString()))
return this;
return new BeanPropertyWriter(this, new SerializedString(str));
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:8,代码来源:BeanPropertyWriter.java
示例12: _findAndAddDynamic
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap paramPropertySerializerMap, Class<?> paramClass, SerializerProvider paramSerializerProvider)
{
JsonSerializer localJsonSerializer1;
if (this._nonTrivialBaseType != null)
localJsonSerializer1 = paramSerializerProvider.findValueSerializer(paramSerializerProvider.constructSpecializedType(this._nonTrivialBaseType, paramClass), this);
else
localJsonSerializer1 = paramSerializerProvider.findValueSerializer(paramClass, this);
NameTransformer localNameTransformer = this._nameTransformer;
if (localJsonSerializer1.isUnwrappingSerializer())
localNameTransformer = NameTransformer.chainedTransformer(localNameTransformer, ((UnwrappingBeanSerializer)localJsonSerializer1)._nameTransformer);
JsonSerializer localJsonSerializer2 = localJsonSerializer1.unwrappingSerializer(localNameTransformer);
this._dynamicSerializers = this._dynamicSerializers.newWith(paramClass, localJsonSerializer2);
return localJsonSerializer2;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:15,代码来源:UnwrappingBeanPropertyWriter.java
示例13: assignSerializer
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
public void assignSerializer(JsonSerializer<Object> paramJsonSerializer)
{
super.assignSerializer(paramJsonSerializer);
if (this._serializer != null)
{
NameTransformer localNameTransformer = this._nameTransformer;
if (this._serializer.isUnwrappingSerializer())
localNameTransformer = NameTransformer.chainedTransformer(localNameTransformer, ((UnwrappingBeanSerializer)this._serializer)._nameTransformer);
this._serializer = this._serializer.unwrappingSerializer(localNameTransformer);
}
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:12,代码来源:UnwrappingBeanPropertyWriter.java
示例14: findUnwrappingNameTransformer
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
public NameTransformer findUnwrappingNameTransformer(AnnotatedMember paramAnnotatedMember)
{
NameTransformer localNameTransformer1 = this._primary.findUnwrappingNameTransformer(paramAnnotatedMember);
NameTransformer localNameTransformer2 = localNameTransformer1;
if (localNameTransformer1 == null)
localNameTransformer2 = this._secondary.findUnwrappingNameTransformer(paramAnnotatedMember);
return localNameTransformer2;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:9,代码来源:AnnotationIntrospectorPair.java
示例15: findUnwrappingNameTransformer
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
public NameTransformer findUnwrappingNameTransformer(AnnotatedMember paramAnnotatedMember)
{
JsonUnwrapped localJsonUnwrapped = (JsonUnwrapped)paramAnnotatedMember.getAnnotation(JsonUnwrapped.class);
if ((localJsonUnwrapped == null) || (!localJsonUnwrapped.enabled()))
return null;
return NameTransformer.simpleTransformer(localJsonUnwrapped.prefix(), localJsonUnwrapped.suffix());
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:8,代码来源:JacksonAnnotationIntrospector.java
示例16: BeanDeserializerBase
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
protected BeanDeserializerBase(BeanDeserializerBase paramBeanDeserializerBase, NameTransformer paramNameTransformer)
{
super(paramBeanDeserializerBase._beanType);
this._classAnnotations = paramBeanDeserializerBase._classAnnotations;
this._beanType = paramBeanDeserializerBase._beanType;
this._valueInstantiator = paramBeanDeserializerBase._valueInstantiator;
this._delegateDeserializer = paramBeanDeserializerBase._delegateDeserializer;
this._propertyBasedCreator = paramBeanDeserializerBase._propertyBasedCreator;
this._backRefs = paramBeanDeserializerBase._backRefs;
this._ignorableProps = paramBeanDeserializerBase._ignorableProps;
boolean bool;
if ((paramNameTransformer != null) || (paramBeanDeserializerBase._ignoreAllUnknown))
bool = true;
else
bool = false;
this._ignoreAllUnknown = bool;
this._anySetter = paramBeanDeserializerBase._anySetter;
this._injectables = paramBeanDeserializerBase._injectables;
this._objectIdReader = paramBeanDeserializerBase._objectIdReader;
this._nonStandardCreation = paramBeanDeserializerBase._nonStandardCreation;
UnwrappedPropertyHandler localUnwrappedPropertyHandler = paramBeanDeserializerBase._unwrappedPropertyHandler;
if (paramNameTransformer != null)
{
if (localUnwrappedPropertyHandler != null)
localUnwrappedPropertyHandler = localUnwrappedPropertyHandler.renameAll(paramNameTransformer);
this._beanProperties = paramBeanDeserializerBase._beanProperties.renameAll(paramNameTransformer);
}
else
{
this._beanProperties = paramBeanDeserializerBase._beanProperties;
}
this._unwrappedPropertyHandler = localUnwrappedPropertyHandler;
this._needViewProcesing = paramBeanDeserializerBase._needViewProcesing;
this._serializationShape = paramBeanDeserializerBase._serializationShape;
this._vanillaProcessing = false;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:37,代码来源:BeanDeserializerBase.java
示例17: rename
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
@Override
public UnwrappingBeanPropertyWriter rename(NameTransformer transformer)
{
String oldName = _name.getValue();
String newName = transformer.transform(oldName);
// important: combine transformers:
transformer = NameTransformer.chainedTransformer(transformer, _nameTransformer);
return new UnwrappingBeanPropertyWriter(this, transformer, new SerializedString(newName));
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:12,代码来源:UnwrappingBeanPropertyWriter.java
示例18: assignSerializer
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
@Override
public void assignSerializer(JsonSerializer<Object> ser)
{
super.assignSerializer(ser);
if (_serializer != null) {
NameTransformer t = _nameTransformer;
if (_serializer.isUnwrappingSerializer()) {
t = NameTransformer.chainedTransformer(t, ((UnwrappingBeanSerializer) _serializer)._nameTransformer);
}
_serializer = _serializer.unwrappingSerializer(t);
}
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:13,代码来源:UnwrappingBeanPropertyWriter.java
示例19: unwrappingSerializer
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
@Override
public JsonSerializer<Object> unwrappingSerializer(NameTransformer transformer) {
/* If this gets called, we will just need delegate to the default
* serializer, to "undo" as-array serialization
*/
return _defaultSerializer.unwrappingSerializer(transformer);
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:8,代码来源:BeanAsArraySerializer.java
示例20: findUnwrappingNameTransformer
import com.fasterxml.jackson.databind.util.NameTransformer; //导入依赖的package包/类
@Override
public NameTransformer findUnwrappingNameTransformer(AnnotatedMember member)
{
NameTransformer value = _primary.findUnwrappingNameTransformer(member);
if (value == null) {
value = _secondary.findUnwrappingNameTransformer(member);
}
return value;
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:10,代码来源:AnnotationIntrospectorPair.java
注:本文中的com.fasterxml.jackson.databind.util.NameTransformer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论