Java 类com.fasterxml.jackson.databind.deser.SettableBeanProperty 实例源码
项目:QuizUpWinner
文件:MapDeserializer.java
public void resolve(DeserializationContext paramDeserializationContext)
{
if (this._valueInstantiator.canCreateUsingDelegate())
{
JavaType localJavaType = this._valueInstantiator.getDelegateType(paramDeserializationContext.getConfig());
if (localJavaType == null)
throw new IllegalArgumentException("Invalid delegate-creator definition for " + this._mapType + ": value instantiator (" + this._valueInstantiator.getClass().getName() + ") returned true for 'canCreateUsingDelegate()', but null for 'getDelegateType()'");
this._delegateDeserializer = findDeserializer(paramDeserializationContext, localJavaType, null);
}
if (this._valueInstantiator.canCreateFromObjectWith())
{
SettableBeanProperty[] arrayOfSettableBeanProperty = this._valueInstantiator.getFromObjectArguments(paramDeserializationContext.getConfig());
this._propertyBasedCreator = PropertyBasedCreator.construct(paramDeserializationContext, this._valueInstantiator, arrayOfSettableBeanProperty);
}
this._standardStringKey = _isStdKeyDeser(this._mapType, this._keyDeserializer);
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public BeanPropertyMap(Collection<SettableBeanProperty> paramCollection)
{
this._size = paramCollection.size();
int i = findSize(this._size);
this._hashMask = (i - 1);
Bucket[] arrayOfBucket = new Bucket[i];
Iterator localIterator = paramCollection.iterator();
while (localIterator.hasNext())
{
SettableBeanProperty localSettableBeanProperty = (SettableBeanProperty)localIterator.next();
String str = localSettableBeanProperty.getName();
int j = str.hashCode() & this._hashMask;
Bucket localBucket = arrayOfBucket[j];
int k = this._nextBucketIndex;
this._nextBucketIndex = (k + 1);
arrayOfBucket[j] = new Bucket(localBucket, str, localSettableBeanProperty, k);
}
this._buckets = arrayOfBucket;
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public final SettableBeanProperty find(String paramString)
{
int i = paramString.hashCode() & this._hashMask;
Bucket localBucket1 = this._buckets[i];
Object localObject = localBucket1;
if (localBucket1 == null)
return null;
if (((Bucket)localObject).key == paramString)
return ((Bucket)localObject).value;
do
{
Bucket localBucket2 = ((Bucket)localObject).next;
localObject = localBucket2;
if (localBucket2 == null)
break;
}
while (((Bucket)localObject).key != paramString);
return ((Bucket)localObject).value;
return _findWithEquals(paramString, i);
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
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);
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public final String toString()
{
StringBuilder localStringBuilder = new StringBuilder();
localStringBuilder.append("Properties=[");
int i = 0;
for (SettableBeanProperty localSettableBeanProperty : getPropertiesInInsertionOrder())
if (localSettableBeanProperty != null)
{
int m = i;
i++;
if (m > 0)
localStringBuilder.append(", ");
localStringBuilder.append(localSettableBeanProperty.getName());
localStringBuilder.append('(');
localStringBuilder.append(localSettableBeanProperty.getType());
localStringBuilder.append(')');
}
localStringBuilder.append(']');
return localStringBuilder.toString();
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public final BeanPropertyMap withProperty(SettableBeanProperty paramSettableBeanProperty)
{
int i = this._buckets.length;
Bucket[] arrayOfBucket = new Bucket[i];
System.arraycopy(this._buckets, 0, arrayOfBucket, 0, i);
String str = paramSettableBeanProperty.getName();
if (find(paramSettableBeanProperty.getName()) == null)
{
int j = str.hashCode() & this._hashMask;
Bucket localBucket = arrayOfBucket[j];
int k = this._nextBucketIndex;
this._nextBucketIndex = (k + 1);
arrayOfBucket[j] = new Bucket(localBucket, str, paramSettableBeanProperty, k);
return new BeanPropertyMap(arrayOfBucket, 1 + this._size, this._nextBucketIndex);
}
BeanPropertyMap localBeanPropertyMap = new BeanPropertyMap(arrayOfBucket, i, this._nextBucketIndex);
localBeanPropertyMap.replace(paramSettableBeanProperty);
return localBeanPropertyMap;
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public final SettableBeanProperty next()
{
BeanPropertyMap.Bucket localBucket1 = this._currentBucket;
if (localBucket1 == null)
throw new NoSuchElementException();
BeanPropertyMap.Bucket[] arrayOfBucket;
int i;
for (BeanPropertyMap.Bucket localBucket2 = localBucket1.next; (localBucket2 == null) && (this._nextBucketIndex < this._buckets.length); localBucket2 = arrayOfBucket[i])
{
arrayOfBucket = this._buckets;
i = this._nextBucketIndex;
this._nextBucketIndex = (i + 1);
}
this._currentBucket = localBucket2;
return localBucket1.value;
}
项目:QuizUpWinner
文件:PropertyBasedCreator.java
protected PropertyBasedCreator(ValueInstantiator paramValueInstantiator, SettableBeanProperty[] paramArrayOfSettableBeanProperty, Object[] paramArrayOfObject)
{
this._valueInstantiator = paramValueInstantiator;
this._properties = new HashMap();
SettableBeanProperty[] arrayOfSettableBeanProperty = null;
int i = paramArrayOfSettableBeanProperty.length;
this._propertyCount = i;
for (int j = 0; j < i; j++)
{
SettableBeanProperty localSettableBeanProperty = paramArrayOfSettableBeanProperty[j];
this._properties.put(localSettableBeanProperty.getName(), localSettableBeanProperty);
if (localSettableBeanProperty.getInjectableValueId() != null)
{
if (arrayOfSettableBeanProperty == null)
arrayOfSettableBeanProperty = new SettableBeanProperty[i];
arrayOfSettableBeanProperty[j] = localSettableBeanProperty;
}
}
this._defaultValues = paramArrayOfObject;
this._propertiesWithInjectables = arrayOfSettableBeanProperty;
}
项目:QuizUpWinner
文件:UnwrappedPropertyHandler.java
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);
}
项目:joyplus-tv
文件:BeanPropertyMap.java
/**
* Fluent copy method that creates a new instance that is a copy
* of this instance except for one additional property that is
* passed as the argument.
* Note that method does not modify this instance but constructs
* and returns a new one.
*
* @since 2.0
*/
public BeanPropertyMap withProperty(SettableBeanProperty newProperty)
{
// first things first: can just copy hash area:
final int bcount = _buckets.length;
Bucket[] newBuckets = new Bucket[bcount];
System.arraycopy(_buckets, 0, newBuckets, 0, bcount);
final String propName = newProperty.getName();
// and then see if it's add or replace:
SettableBeanProperty oldProp = find(newProperty.getName());
if (oldProp == null) { // add
// first things first: add or replace?
// can do a straight copy, since all additions are at the front
// and then insert the new property:
int index = propName.hashCode() & _hashMask;
newBuckets[index] = new Bucket(newBuckets[index],
propName, newProperty, _nextBucketIndex++);
return new BeanPropertyMap(newBuckets, _size+1, _nextBucketIndex);
}
// replace: easy, close + replace
BeanPropertyMap newMap = new BeanPropertyMap(newBuckets, bcount, _nextBucketIndex);
newMap.replace(newProperty);
return newMap;
}
项目:joyplus-tv
文件:BeanPropertyMap.java
/**
* 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);
}
项目:joyplus-tv
文件:BeanPropertyMap.java
public SettableBeanProperty find(String key)
{
int index = key.hashCode() & _hashMask;
Bucket bucket = _buckets[index];
// Let's unroll first lookup since that is null or match in 90+% cases
if (bucket == null) {
return null;
}
// Primarily we do just identity comparison as keys should be interned
if (bucket.key == key) {
return bucket.value;
}
while ((bucket = bucket.next) != null) {
if (bucket.key == key) {
return bucket.value;
}
}
// Do we need fallback for non-interned Strings?
return _findWithEquals(key, index);
}
项目:joyplus-tv
文件:BeanPropertyMap.java
/**
* Specialized method for removing specified existing entry.
* NOTE: entry MUST exist, otherwise an exception is thrown.
*/
public void remove(SettableBeanProperty property)
{
// Mostly this is the same as code with 'replace', just bit simpler...
String name = property.getName();
int index = name.hashCode() & (_buckets.length-1);
Bucket tail = null;
boolean found = false;
// slightly complex just because chain is immutable, must recreate
for (Bucket bucket = _buckets[index]; bucket != null; bucket = bucket.next) {
// match to remove?
if (!found && bucket.key.equals(name)) {
found = true;
} else {
tail = new Bucket(tail, bucket.key, bucket.value, bucket.index);
}
}
if (!found) { // must be found
throw new NoSuchElementException("No entry '"+property+"' found, can't remove");
}
_buckets[index] = tail;
}
项目:joyplus-tv
文件:PropertyValueBuffer.java
/**
* Helper method called to handle Object Id value collected earlier, if any
*/
public Object handleIdValue(final DeserializationContext ctxt, Object bean)
throws IOException
{
if (_objectIdReader != null) {
if (_idValue != null) {
ReadableObjectId roid = ctxt.findObjectId(_idValue, _objectIdReader.generator);
roid.bindItem(bean);
// also: may need to set a property value as well
SettableBeanProperty idProp = _objectIdReader.idProperty;
if (idProp != null) {
return idProp.setAndReturn(bean, _idValue);
}
} else {
// TODO: is this an error case?
}
}
return bean;
}
项目:joyplus-tv
文件:PropertyBasedCreator.java
protected PropertyBasedCreator(ValueInstantiator valueInstantiator,
SettableBeanProperty[] creatorProps, Object[] defaultValues)
{
_valueInstantiator = valueInstantiator;
_properties = new HashMap<String, SettableBeanProperty>();
SettableBeanProperty[] propertiesWithInjectables = null;
final int len = creatorProps.length;
_propertyCount = len;
for (int i = 0; i < len; ++i) {
SettableBeanProperty prop = creatorProps[i];
_properties.put(prop.getName(), prop);
Object injectableValueId = prop.getInjectableValueId();
if (injectableValueId != null) {
if (propertiesWithInjectables == null) {
propertiesWithInjectables = new SettableBeanProperty[len];
}
propertiesWithInjectables[i] = prop;
}
}
_defaultValues = defaultValues;
_propertiesWithInjectables = propertiesWithInjectables;
}
项目:joyplus-tv
文件:ExternalTypeHandler.java
public Object complete(JsonParser jp, DeserializationContext ctxt, Object bean)
throws IOException, JsonProcessingException
{
for (int i = 0, len = _properties.length; i < len; ++i) {
if (_typeIds[i] == null) {
// let's allow missing both type and property (may already have been set, too)
if (_tokens[i] == null) {
continue;
}
// but not just one
throw ctxt.mappingException("Missing external type id property '"+_properties[i].getTypePropertyName());
} else if (_tokens[i] == null) {
SettableBeanProperty prop = _properties[i].getProperty();
throw ctxt.mappingException("Missing property '"+prop.getName()+"' for external type id '"+_properties[i].getTypePropertyName());
}
_deserializeAndSet(jp, ctxt, bean, i);
}
return bean;
}
项目:joyplus-tv
文件:UnwrappedPropertyHandler.java
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);
}
}
项目:JglTF
文件:ErrorReportingSettableBeanProperty.java
/**
* Creates a new instance with the given delegate and error consumer
*
* @param delegate The delegate
* @param jsonErrorConsumer The consumer for {@link JsonError}s. If
* this is <code>null</code>, then errors will be ignored.
*/
ErrorReportingSettableBeanProperty(
SettableBeanProperty delegate,
Consumer<? super JsonError> jsonErrorConsumer)
{
super(delegate);
this.delegate = delegate;
this.jsonErrorConsumer = jsonErrorConsumer;
}
项目:JglTF
文件:ErrorReportingSettableBeanProperty.java
@Override
public SettableBeanProperty
withValueDeserializer(JsonDeserializer<?> deser)
{
return new ErrorReportingSettableBeanProperty(
delegate.withValueDeserializer(deser), jsonErrorConsumer);
}
项目:JglTF
文件:JacksonUtils.java
/**
* Creates a BeanDeserializerModifier that replaces the
* SettableBeanProperties in the BeanDeserializerBuilder with
* ErrorReportingSettableBeanProperty instances that forward
* information about errors when setting bean properties to the
* given consumer. (Don't ask ... )
*
* @param jsonErrorConsumer The consumer for {@link JsonError}s.
* If this is <code>null</code>, then no errors will be reported.
* @return The modifier
*/
private static BeanDeserializerModifier
createErrorHandlingBeanDeserializerModifier(
Consumer<? super JsonError> jsonErrorConsumer)
{
return new BeanDeserializerModifier()
{
@Override
public BeanDeserializerBuilder updateBuilder(
DeserializationConfig config,
BeanDescription beanDesc,
BeanDeserializerBuilder builder)
{
Iterator<SettableBeanProperty> propertiesIterator =
builder.getProperties();
while (propertiesIterator.hasNext())
{
SettableBeanProperty property = propertiesIterator.next();
SettableBeanProperty wrappedProperty =
new ErrorReportingSettableBeanProperty(
property, jsonErrorConsumer);
builder.addOrReplaceProperty(wrappedProperty, true);
}
return builder;
}
};
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
private SettableBeanProperty _findWithEquals(String paramString, int paramInt)
{
for (Bucket localBucket = this._buckets[paramInt]; localBucket != null; localBucket = localBucket.next)
if (paramString.equals(localBucket.key))
return localBucket.value;
return null;
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public final BeanPropertyMap assignIndexes()
{
int i = 0;
Bucket[] arrayOfBucket = this._buckets;
int j = arrayOfBucket.length;
for (int k = 0; k < j; k++)
for (Bucket localBucket = arrayOfBucket[k]; localBucket != null; localBucket = localBucket.next)
{
SettableBeanProperty localSettableBeanProperty = localBucket.value;
int m = i;
i++;
localSettableBeanProperty.assignIndex(m);
}
return this;
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public final SettableBeanProperty[] getPropertiesInInsertionOrder()
{
SettableBeanProperty[] arrayOfSettableBeanProperty = new SettableBeanProperty[this._nextBucketIndex];
Bucket[] arrayOfBucket = this._buckets;
int i = arrayOfBucket.length;
for (int j = 0; j < i; j++)
for (Bucket localBucket = arrayOfBucket[j]; localBucket != null; localBucket = localBucket.next)
arrayOfSettableBeanProperty[localBucket.index] = localBucket.value;
return arrayOfSettableBeanProperty;
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public final void remove(SettableBeanProperty paramSettableBeanProperty)
{
String str = paramSettableBeanProperty.getName();
int i = str.hashCode() & -1 + this._buckets.length;
Bucket localBucket1 = null;
int j = 0;
for (Bucket localBucket2 = this._buckets[i]; localBucket2 != null; localBucket2 = localBucket2.next)
if ((j == 0) && (localBucket2.key.equals(str)))
j = 1;
else
localBucket1 = new Bucket(localBucket1, localBucket2.key, localBucket2.value, localBucket2.index);
if (j == 0)
throw new NoSuchElementException("No entry '" + paramSettableBeanProperty + "' found, can't remove");
this._buckets[i] = localBucket1;
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public final void replace(SettableBeanProperty paramSettableBeanProperty)
{
String str = paramSettableBeanProperty.getName();
int i = str.hashCode() & -1 + this._buckets.length;
Bucket localBucket1 = null;
int j = -1;
for (Bucket localBucket2 = this._buckets[i]; localBucket2 != null; localBucket2 = localBucket2.next)
if ((j < 0) && (localBucket2.key.equals(str)))
j = localBucket2.index;
else
localBucket1 = new Bucket(localBucket1, localBucket2.key, localBucket2.value, localBucket2.index);
if (j < 0)
throw new NoSuchElementException("No entry '" + paramSettableBeanProperty + "' found, can't replace");
this._buckets[i] = new Bucket(localBucket1, str, paramSettableBeanProperty, j);
}
项目:QuizUpWinner
文件:BeanPropertyMap.java
public Bucket(Bucket paramBucket, String paramString, SettableBeanProperty paramSettableBeanProperty, int paramInt)
{
this.next = paramBucket;
this.key = paramString;
this.value = paramSettableBeanProperty;
this.index = paramInt;
}
项目:QuizUpWinner
文件:BeanAsArrayDeserializer.java
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
{
if (paramJsonParser.getCurrentToken() != JsonToken.START_ARRAY)
return _deserializeFromNonArray(paramJsonParser, paramDeserializationContext);
if (!this._vanillaProcessing)
return _deserializeNonVanilla(paramJsonParser, paramDeserializationContext);
Object localObject = this._valueInstantiator.createUsingDefault(paramDeserializationContext);
SettableBeanProperty[] arrayOfSettableBeanProperty = this._orderedProperties;
int i = 0;
int j = arrayOfSettableBeanProperty.length;
while (true)
{
if (paramJsonParser.nextToken() == JsonToken.END_ARRAY)
return localObject;
if (i == j)
break;
SettableBeanProperty localSettableBeanProperty = arrayOfSettableBeanProperty[i];
if (localSettableBeanProperty != null)
try
{
localSettableBeanProperty.deserializeAndSet(paramJsonParser, paramDeserializationContext, localObject);
}
catch (Exception localException)
{
wrapAndThrow(localException, localObject, localSettableBeanProperty.getName(), paramDeserializationContext);
}
else
paramJsonParser.skipChildren();
i++;
}
if (!this._ignoreAllUnknown)
throw paramDeserializationContext.mappingException("Unexpected JSON values; expected at most " + j + " properties (in JSON Array)");
while (paramJsonParser.nextToken() != JsonToken.END_ARRAY)
paramJsonParser.skipChildren();
return localObject;
}
项目:QuizUpWinner
文件:BeanAsArrayDeserializer.java
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject)
{
if (this._injectables != null)
injectValues(paramDeserializationContext, paramObject);
SettableBeanProperty[] arrayOfSettableBeanProperty = this._orderedProperties;
int i = 0;
int j = arrayOfSettableBeanProperty.length;
while (true)
{
if (paramJsonParser.nextToken() == JsonToken.END_ARRAY)
return paramObject;
if (i == j)
break;
SettableBeanProperty localSettableBeanProperty = arrayOfSettableBeanProperty[i];
if (localSettableBeanProperty != null)
try
{
localSettableBeanProperty.deserializeAndSet(paramJsonParser, paramDeserializationContext, paramObject);
}
catch (Exception localException)
{
wrapAndThrow(localException, paramObject, localSettableBeanProperty.getName(), paramDeserializationContext);
}
else
paramJsonParser.skipChildren();
i++;
}
if (!this._ignoreAllUnknown)
throw paramDeserializationContext.mappingException("Unexpected JSON values; expected at most " + j + " properties (in JSON Array)");
while (paramJsonParser.nextToken() != JsonToken.END_ARRAY)
paramJsonParser.skipChildren();
return paramObject;
}
项目:QuizUpWinner
文件:PropertyValueBuffer.java
public final Object handleIdValue(DeserializationContext paramDeserializationContext, Object paramObject)
{
if ((this._objectIdReader != null) && (this._idValue != null))
{
paramDeserializationContext.findObjectId(this._idValue, this._objectIdReader.generator).bindItem(paramObject);
SettableBeanProperty localSettableBeanProperty = this._objectIdReader.idProperty;
if (localSettableBeanProperty != null)
return localSettableBeanProperty.setAndReturn(paramObject, this._idValue);
}
return paramObject;
}
项目:QuizUpWinner
文件:PropertyValueBuffer.java
public final void inject(SettableBeanProperty[] paramArrayOfSettableBeanProperty)
{
int i = 0;
int j = paramArrayOfSettableBeanProperty.length;
while (i < j)
{
SettableBeanProperty localSettableBeanProperty = paramArrayOfSettableBeanProperty[i];
if (localSettableBeanProperty != null)
this._creatorParameters[i] = this._context.findInjectableValue(localSettableBeanProperty.getInjectableValueId(), localSettableBeanProperty, null);
i++;
}
}
项目:QuizUpWinner
文件:PropertyBasedCreator.java
public static PropertyBasedCreator construct(DeserializationContext paramDeserializationContext, ValueInstantiator paramValueInstantiator, SettableBeanProperty[] paramArrayOfSettableBeanProperty)
{
int i = paramArrayOfSettableBeanProperty.length;
SettableBeanProperty[] arrayOfSettableBeanProperty = new SettableBeanProperty[i];
Object[] arrayOfObject = null;
for (int j = 0; j < i; j++)
{
SettableBeanProperty localSettableBeanProperty1 = paramArrayOfSettableBeanProperty[j];
SettableBeanProperty localSettableBeanProperty2 = localSettableBeanProperty1;
if (!localSettableBeanProperty1.hasValueDeserializer())
localSettableBeanProperty2 = localSettableBeanProperty2.withValueDeserializer(paramDeserializationContext.findContextualValueDeserializer(localSettableBeanProperty2.getType(), localSettableBeanProperty2));
arrayOfSettableBeanProperty[j] = localSettableBeanProperty2;
JsonDeserializer localJsonDeserializer = localSettableBeanProperty2.getValueDeserializer();
Object localObject1;
if (localJsonDeserializer == null)
localObject1 = null;
else
localObject1 = localJsonDeserializer.getNullValue();
Object localObject2 = localObject1;
if ((localObject1 == null) && (localSettableBeanProperty2.getType().isPrimitive()))
localObject2 = ClassUtil.defaultValue(localSettableBeanProperty2.getType().getRawClass());
if (localObject2 != null)
{
if (arrayOfObject == null)
arrayOfObject = new Object[i];
arrayOfObject[j] = localObject2;
}
}
return new PropertyBasedCreator(paramValueInstantiator, arrayOfSettableBeanProperty, arrayOfObject);
}
项目:QuizUpWinner
文件:ExternalTypeHandler.java
public Object complete(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, PropertyValueBuffer paramPropertyValueBuffer, PropertyBasedCreator paramPropertyBasedCreator)
{
int i = this._properties.length;
Object[] arrayOfObject = new Object[i];
for (int j = 0; j < i; j++)
{
String str1 = this._typeIds[j];
String str2 = str1;
if (str1 == null)
{
if (this._tokens[j] == null)
continue;
if (!this._properties[j].hasDefaultType())
throw paramDeserializationContext.mappingException("Missing external type id property '" + this._properties[j].getTypePropertyName() + "'");
str2 = this._properties[j].getDefaultTypeId();
}
else if (this._tokens[j] == null)
{
SettableBeanProperty localSettableBeanProperty3 = this._properties[j].getProperty();
throw paramDeserializationContext.mappingException("Missing property '" + localSettableBeanProperty3.getName() + "' for external type id '" + this._properties[j].getTypePropertyName());
}
arrayOfObject[j] = _deserialize(paramJsonParser, paramDeserializationContext, j, str2);
}
for (int k = 0; k < i; k++)
{
SettableBeanProperty localSettableBeanProperty2 = this._properties[k].getProperty();
if (paramPropertyBasedCreator.findCreatorProperty(localSettableBeanProperty2.getName()) != null)
paramPropertyValueBuffer.assignParameter(localSettableBeanProperty2.getCreatorIndex(), arrayOfObject[k]);
}
Object localObject = paramPropertyBasedCreator.build(paramDeserializationContext, paramPropertyValueBuffer);
for (int m = 0; m < i; m++)
{
SettableBeanProperty localSettableBeanProperty1 = this._properties[m].getProperty();
if (paramPropertyBasedCreator.findCreatorProperty(localSettableBeanProperty1.getName()) == null)
localSettableBeanProperty1.set(localObject, arrayOfObject[m]);
}
return localObject;
}
项目:QuizUpWinner
文件:ExternalTypeHandler.java
public Object complete(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject)
{
int i = 0;
int j = this._properties.length;
while (i < j)
{
String str1 = this._typeIds[i];
String str2 = str1;
if (str1 == null)
{
TokenBuffer localTokenBuffer = this._tokens[i];
if (localTokenBuffer == null)
break label263;
JsonToken localJsonToken = localTokenBuffer.firstToken();
if ((localJsonToken != null) && (localJsonToken.isScalarValue()))
{
JsonParser localJsonParser = localTokenBuffer.asParser(paramJsonParser);
localJsonParser.nextToken();
SettableBeanProperty localSettableBeanProperty2 = this._properties[i].getProperty();
Object localObject = TypeDeserializer.deserializeIfNatural(localJsonParser, paramDeserializationContext, localSettableBeanProperty2.getType());
if (localObject != null)
{
localSettableBeanProperty2.set(paramObject, localObject);
break label263;
}
if (!this._properties[i].hasDefaultType())
throw paramDeserializationContext.mappingException("Missing external type id property '" + this._properties[i].getTypePropertyName() + "'");
str2 = this._properties[i].getDefaultTypeId();
}
}
else if (this._tokens[i] == null)
{
SettableBeanProperty localSettableBeanProperty1 = this._properties[i].getProperty();
throw paramDeserializationContext.mappingException("Missing property '" + localSettableBeanProperty1.getName() + "' for external type id '" + this._properties[i].getTypePropertyName());
}
_deserializeAndSet(paramJsonParser, paramDeserializationContext, paramObject, i, str2);
label263: i++;
}
return paramObject;
}
项目:QuizUpWinner
文件:ExternalTypeHandler.java
public void addExternal(SettableBeanProperty paramSettableBeanProperty, TypeDeserializer paramTypeDeserializer)
{
Integer localInteger = Integer.valueOf(this._properties.size());
this._properties.add(new ExternalTypeHandler.ExtTypedProperty(paramSettableBeanProperty, paramTypeDeserializer));
this._nameToPropertyIndex.put(paramSettableBeanProperty.getName(), localInteger);
this._nameToPropertyIndex.put(paramTypeDeserializer.getPropertyName(), localInteger);
}
项目:QuizUpWinner
文件:ObjectIdValueProperty.java
public final Object deserializeSetAndReturn(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject)
{
Object localObject = this._valueDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
paramDeserializationContext.findObjectId(localObject, this._objectIdReader.generator).bindItem(paramObject);
SettableBeanProperty localSettableBeanProperty = this._objectIdReader.idProperty;
if (localSettableBeanProperty != null)
return localSettableBeanProperty.setAndReturn(paramObject, localObject);
return paramObject;
}
项目:QuizUpWinner
文件:ObjectIdValueProperty.java
public final Object setAndReturn(Object paramObject1, Object paramObject2)
{
SettableBeanProperty localSettableBeanProperty = this._objectIdReader.idProperty;
if (localSettableBeanProperty == null)
throw new UnsupportedOperationException("Should not call set() on ObjectIdProperty that has no SettableBeanProperty");
return localSettableBeanProperty.setAndReturn(paramObject1, paramObject2);
}
项目:QuizUpWinner
文件:BeanAsArrayBuilderDeserializer.java
public BeanAsArrayBuilderDeserializer(BeanDeserializerBase paramBeanDeserializerBase, SettableBeanProperty[] paramArrayOfSettableBeanProperty, AnnotatedMethod paramAnnotatedMethod)
{
super(paramBeanDeserializerBase);
this._delegate = paramBeanDeserializerBase;
this._orderedProperties = paramArrayOfSettableBeanProperty;
this._buildMethod = paramAnnotatedMethod;
}
项目:QuizUpWinner
文件:BeanAsArrayBuilderDeserializer.java
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
{
if (paramJsonParser.getCurrentToken() != JsonToken.START_ARRAY)
return finishBuild(paramDeserializationContext, _deserializeFromNonArray(paramJsonParser, paramDeserializationContext));
if (!this._vanillaProcessing)
return finishBuild(paramDeserializationContext, _deserializeNonVanilla(paramJsonParser, paramDeserializationContext));
Object localObject = this._valueInstantiator.createUsingDefault(paramDeserializationContext);
SettableBeanProperty[] arrayOfSettableBeanProperty = this._orderedProperties;
int i = 0;
int j = arrayOfSettableBeanProperty.length;
while (true)
{
if (paramJsonParser.nextToken() == JsonToken.END_ARRAY)
return finishBuild(paramDeserializationContext, localObject);
if (i == j)
break;
SettableBeanProperty localSettableBeanProperty = arrayOfSettableBeanProperty[i];
if (localSettableBeanProperty != null)
try
{
localObject = localSettableBeanProperty.deserializeSetAndReturn(paramJsonParser, paramDeserializationContext, localObject);
}
catch (Exception localException)
{
wrapAndThrow(localException, localObject, localSettableBeanProperty.getName(), paramDeserializationContext);
}
else
paramJsonParser.skipChildren();
i++;
}
if (!this._ignoreAllUnknown)
throw paramDeserializationContext.mappingException("Unexpected JSON values; expected at most " + j + " properties (in JSON Array)");
while (paramJsonParser.nextToken() != JsonToken.END_ARRAY)
paramJsonParser.skipChildren();
return finishBuild(paramDeserializationContext, localObject);
}
项目:QuizUpWinner
文件:BeanAsArrayBuilderDeserializer.java
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject)
{
if (this._injectables != null)
injectValues(paramDeserializationContext, paramObject);
SettableBeanProperty[] arrayOfSettableBeanProperty = this._orderedProperties;
int i = 0;
int j = arrayOfSettableBeanProperty.length;
while (true)
{
if (paramJsonParser.nextToken() == JsonToken.END_ARRAY)
return finishBuild(paramDeserializationContext, paramObject);
if (i == j)
break;
SettableBeanProperty localSettableBeanProperty = arrayOfSettableBeanProperty[i];
if (localSettableBeanProperty != null)
try
{
paramObject = localSettableBeanProperty.deserializeSetAndReturn(paramJsonParser, paramDeserializationContext, paramObject);
}
catch (Exception localException)
{
wrapAndThrow(localException, paramObject, localSettableBeanProperty.getName(), paramDeserializationContext);
}
else
paramJsonParser.skipChildren();
i++;
}
if (!this._ignoreAllUnknown)
throw paramDeserializationContext.mappingException("Unexpected JSON values; expected at most " + j + " properties (in JSON Array)");
while (paramJsonParser.nextToken() != JsonToken.END_ARRAY)
paramJsonParser.skipChildren();
return finishBuild(paramDeserializationContext, paramObject);
}
项目:QuizUpWinner
文件:ManagedReferenceProperty.java
public ManagedReferenceProperty(SettableBeanProperty paramSettableBeanProperty1, String paramString, SettableBeanProperty paramSettableBeanProperty2, Annotations paramAnnotations, boolean paramBoolean)
{
super(paramSettableBeanProperty1.getName(), paramSettableBeanProperty1.getType(), paramSettableBeanProperty1.getWrapperName(), paramSettableBeanProperty1.getValueTypeDeserializer(), paramAnnotations, paramSettableBeanProperty1.isRequired());
this._referenceName = paramString;
this._managedProperty = paramSettableBeanProperty1;
this._backProperty = paramSettableBeanProperty2;
this._isContainer = paramBoolean;
}