Java 类org.codehaus.jackson.map.util.ClassUtil 实例源码

项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
protected BeanPropertyWriter _constructWriter(SerializationConfig paramSerializationConfig, TypeBindings paramTypeBindings, PropertyBuilder paramPropertyBuilder, boolean paramBoolean, String paramString, AnnotatedMember paramAnnotatedMember)
  throws JsonMappingException
{
  if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS))
    paramAnnotatedMember.fixAccess();
  JavaType localJavaType = paramAnnotatedMember.getType(paramTypeBindings);
  BeanProperty.Std localStd = new BeanProperty.Std(paramString, localJavaType, paramPropertyBuilder.getClassAnnotations(), paramAnnotatedMember);
  JsonSerializer localJsonSerializer = findSerializerFromAnnotation(paramSerializationConfig, paramAnnotatedMember, localStd);
  boolean bool = ClassUtil.isCollectionMapOrArray(localJavaType.getRawClass());
  TypeSerializer localTypeSerializer = null;
  if (bool)
    localTypeSerializer = findPropertyContentTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd);
  BeanPropertyWriter localBeanPropertyWriter = paramPropertyBuilder.buildWriter(paramString, localJavaType, localJsonSerializer, findPropertyTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd), localTypeSerializer, paramAnnotatedMember, paramBoolean);
  localBeanPropertyWriter.setViews(paramSerializationConfig.getAnnotationIntrospector().findSerializationViews(paramAnnotatedMember));
  return localBeanPropertyWriter;
}
项目:12306-android-Decompile    文件:BasicBeanDescription.java   
public AnnotatedMethod findJsonValueMethod()
{
  Object localObject = null;
  Iterator localIterator = this._classInfo.memberMethods().iterator();
  while (localIterator.hasNext())
  {
    AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator.next();
    if (!this._annotationIntrospector.hasAsValueAnnotation(localAnnotatedMethod))
      continue;
    if (localObject != null)
      throw new IllegalArgumentException("Multiple methods with active 'as-value' annotation (" + localObject.getName() + "(), " + localAnnotatedMethod.getName() + ")");
    if (!ClassUtil.hasGetterSignature(localAnnotatedMethod.getAnnotated()))
      throw new IllegalArgumentException("Method " + localAnnotatedMethod.getName() + "() marked with an 'as-value' annotation, but does not have valid getter signature (non-static, takes no args, returns a value)");
    localObject = localAnnotatedMethod;
  }
  return localObject;
}
项目:12306-android-Decompile    文件:AnnotatedClass.java   
protected void _addClassMixIns(AnnotationMap paramAnnotationMap, Class<?> paramClass1, Class<?> paramClass2)
{
  if (paramClass2 == null)
    return;
  for (Annotation localAnnotation2 : paramClass2.getDeclaredAnnotations())
  {
    if (!this._annotationIntrospector.isHandled(localAnnotation2))
      continue;
    paramAnnotationMap.addIfNotPresent(localAnnotation2);
  }
  Iterator localIterator = ClassUtil.findSuperTypes(paramClass2, paramClass1).iterator();
  while (localIterator.hasNext())
    for (Annotation localAnnotation1 : ((Class)localIterator.next()).getDeclaredAnnotations())
    {
      if (!this._annotationIntrospector.isHandled(localAnnotation1))
        continue;
      paramAnnotationMap.addIfNotPresent(localAnnotation1);
    }
}
项目:12306-android-Decompile    文件:EnumDeserializer.java   
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (paramJsonParser.getCurrentToken() != JsonToken.VALUE_STRING)
    throw paramDeserializationContext.mappingException(this._enumClass);
  String str = paramJsonParser.getText();
  try
  {
    Object localObject = this._factory.invoke(this._enumClass, new Object[] { str });
    return localObject;
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return null;
}
项目:12306-android-Decompile    文件:BeanDeserializerFactory.java   
protected CreatorContainer findDeserializerCreators(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription)
  throws JsonMappingException
{
  boolean bool = paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS);
  CreatorContainer localCreatorContainer = new CreatorContainer(paramBasicBeanDescription, bool);
  AnnotationIntrospector localAnnotationIntrospector = paramDeserializationConfig.getAnnotationIntrospector();
  if (paramBasicBeanDescription.getType().isConcrete())
  {
    Constructor localConstructor = paramBasicBeanDescription.findDefaultConstructor();
    if (localConstructor != null)
    {
      if (bool)
        ClassUtil.checkAndFixAccess(localConstructor);
      localCreatorContainer.setDefaultConstructor(localConstructor);
    }
  }
  VisibilityChecker localVisibilityChecker1 = paramDeserializationConfig.getDefaultVisibilityChecker();
  if (!paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.AUTO_DETECT_CREATORS))
    localVisibilityChecker1 = localVisibilityChecker1.withCreatorVisibility(JsonAutoDetect.Visibility.NONE);
  VisibilityChecker localVisibilityChecker2 = paramDeserializationConfig.getAnnotationIntrospector().findAutoDetectVisibility(paramBasicBeanDescription.getClassInfo(), localVisibilityChecker1);
  _addDeserializerConstructors(paramDeserializationConfig, paramBasicBeanDescription, localVisibilityChecker2, localAnnotationIntrospector, localCreatorContainer);
  _addDeserializerFactoryMethods(paramDeserializationConfig, paramBasicBeanDescription, localVisibilityChecker2, localAnnotationIntrospector, localCreatorContainer);
  return localCreatorContainer;
}
项目:12306-android-Decompile    文件:Creator.java   
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  Object localObject1 = this._deserializer.deserialize(paramJsonParser, paramDeserializationContext);
  try
  {
    if (this._ctor != null)
      return this._ctor.newInstance(new Object[] { localObject1 });
    Object localObject2 = this._factoryMethod.invoke(null, new Object[] { localObject1 });
    return localObject2;
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return null;
}
项目:12306-android-Decompile    文件:Creator.java   
public Object build(PropertyValueBuffer paramPropertyValueBuffer)
  throws Exception
{
  Object localObject1 = null;
  try
  {
    Object localObject3;
    if (this._ctor != null)
      localObject3 = this._ctor.newInstance(paramPropertyValueBuffer.getParameters(this._defaultValues));
    Object localObject2;
    for (localObject1 = localObject3; ; localObject1 = localObject2)
    {
      for (PropertyValue localPropertyValue = paramPropertyValueBuffer.buffered(); localPropertyValue != null; localPropertyValue = localPropertyValue.next)
        localPropertyValue.assign(localObject1);
      localObject2 = this._factoryMethod.invoke(null, paramPropertyValueBuffer.getParameters(this._defaultValues));
    }
  }
  catch (Exception localException)
  {
    ClassUtil.throwRootCause(localException);
  }
  return localObject1;
}
项目:12306-android-Decompile    文件:Creator.java   
public Object construct(String paramString)
{
  try
  {
    if (this._ctor != null)
      return this._ctor.newInstance(new Object[] { paramString });
    if (this._factoryMethod != null)
    {
      Object localObject = this._factoryMethod.invoke(this._valueClass, new Object[] { paramString });
      return localObject;
    }
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return null;
}
项目:conqueso-client-java    文件:IntrospectorPropertyDefinitionsProvider.java   
private void addFieldPropertyDefinition(Map<String, PropertyDefinition> targetPropertyDefinitionMap, 
        Field propertyField) {
    // Hack the Java permissions to allow us to access a private field
    ClassUtil.checkAndFixAccess(propertyField);
    try {
        // Read the static property field value from the target class
        Property<?> property = (Property<?>)propertyField.get(null);
        // Skip null field values
        if (property == null) {
            return;
        }

        addPropertyDefinition(targetPropertyDefinitionMap, propertyField, property);            
    } catch (IllegalAccessException e) {
        throw new IllegalArgumentException(String.format("Failed to read field %s from class %s", 
                propertyField.getName(), propertyField.getDeclaringClass().getName()), e);
    }
}
项目:RHome    文件:BeanSerializerFactory.java   
/**
 * Secondary helper method for constructing {@link BeanPropertyWriter} for
 * given member (field or method).
 */
protected BeanPropertyWriter _constructWriter(SerializationConfig config, TypeBindings typeContext,
        PropertyBuilder pb, boolean staticTyping, String name, AnnotatedMember propertyMember)
{
    if (config.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) {
        propertyMember.fixAccess();
    }
    // Does member specify a serializer? If so, let's use it.
    JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, propertyMember);
    // And how about polymorphic typing? First special to cover JAXB per-field settings:
    TypeSerializer contentTypeSer = null;
    JavaType type = propertyMember.getType(typeContext);
    if (ClassUtil.isCollectionMapOrArray(type.getRawClass())) {
        contentTypeSer = findPropertyContentTypeSerializer(type, config, propertyMember);
    }

    // and if not JAXB collection/array with annotations, maybe regular type info?
    TypeSerializer typeSer = findPropertyTypeSerializer(type, config, propertyMember);
    BeanPropertyWriter pbw = pb.buildProperty(name, annotatedSerializer,
            typeSer, contentTypeSer, propertyMember, staticTyping);
    // how about views? (1.4+)
    AnnotationIntrospector intr = config.getAnnotationIntrospector();
    pbw.setViews(intr.findSerializationViews(propertyMember));
    return pbw;
}
项目:RHome    文件:BasicSerializerFactory.java   
/**
 * Helper method called to check if a class or method
 * has an annotation
 * (@link org.codehaus.jackson.map.ser.JsonSerialize#using)
 * that tells the class to use for serialization.
 * Returns null if no such annotation found.
 */
@SuppressWarnings("unchecked")
protected JsonSerializer<Object> findSerializerFromAnnotation(SerializationConfig config, Annotated a)
{
    Object serDef = config.getAnnotationIntrospector().findSerializer(a);
    if (serDef != null) {
        if (serDef instanceof JsonSerializer) {
            return (JsonSerializer<Object>) serDef;
        }
        /* Alas, there's no way to force return type of "either class
         * X or Y" -- need to throw an exception after the fact
         */
        if (!(serDef instanceof Class)) {
            throw new IllegalStateException("AnnotationIntrospector returned value of type "+serDef.getClass().getName()+"; expected type JsonSerializer or Class<JsonSerializer> instead");
        }
        Class<?> cls = (Class<?>) serDef;
        if (!JsonSerializer.class.isAssignableFrom(cls)) {
            throw new IllegalStateException("AnnotationIntrospector returned Class "+cls.getName()+"; expected Class<JsonSerializer>");
        }
        return (JsonSerializer<Object>) ClassUtil.createInstance(cls, config.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS));
    }
    return null;
}
项目:RHome    文件:BasicBeanDescription.java   
/**
 * Method for locating the getter method that is annotated with
 * {@link org.codehaus.jackson.annotate.JsonValue} annotation,
 * if any. If multiple ones are found,
 * an error is reported by throwing {@link IllegalArgumentException}
 */
public AnnotatedMethod findJsonValueMethod()
{
    AnnotatedMethod found = null;
    for (AnnotatedMethod am : _classInfo.memberMethods()) {
        // must be marked with "JsonValue" (or similar)
        if (!_annotationIntrospector.hasAsValueAnnotation(am)) {
            continue;
        }
        if (found != null) {
            throw new IllegalArgumentException("Multiple methods with active 'as-value' annotation ("+found.getName()+"(), "+am.getName()+")");
        }
        // Also, must have getter signature
        /* 18-May-2009, tatu: Should this be moved to annotation
         *  introspector, to give better error message(s)? For now
         *  will leave here, may want to reconsider in future.
         */
        if (!ClassUtil.hasGetterSignature(am.getAnnotated())) {
            throw new IllegalArgumentException("Method "+am.getName()+"() marked with an 'as-value' annotation, but does not have valid getter signature (non-static, takes no args, returns a value)");
        }
        found = am;
    }
    return found;
}
项目:RHome    文件:BasicClassIntrospector.java   
public boolean includeMethod(Method m)
{
    if (super.includeMethod(m)) {
        return true;
    }
    if (!ClassUtil.hasGetterSignature(m)) {
        return false;
    }
    // but furthermore, only accept Collections & Maps, for now
    Class<?> rt = m.getReturnType();
    if (Collection.class.isAssignableFrom(rt)
        || Map.class.isAssignableFrom(rt)) {
        return true; 
    }
    return false;
}
项目:RHome    文件:BasicDeserializerFactory.java   
@SuppressWarnings("unchecked")
JsonDeserializer<Object> _constructDeserializer(DeserializationConfig config, Object deserDef)
{
    if (deserDef instanceof JsonDeserializer) {
        return (JsonDeserializer<Object>) deserDef;
    }
    /* Alas, there's no way to force return type of "either class
     * X or Y" -- need to throw an exception after the fact
     */
    if (!(deserDef instanceof Class)) {
        throw new IllegalStateException("AnnotationIntrospector returned deserializer definition of type "+deserDef.getClass().getName()+"; expected type JsonDeserializer or Class<JsonDeserializer> instead");
    }
    Class<?> cls = (Class<?>) deserDef;
    if (!JsonDeserializer.class.isAssignableFrom(cls)) {
        throw new IllegalStateException("AnnotationIntrospector returned Class "+cls.getName()+"; expected Class<JsonDeserializer>");
    }
    return (JsonDeserializer<Object>) ClassUtil.createInstance(cls, config.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS));
}
项目:RHome    文件:BeanDeserializerFactory.java   
/**
 * Helper method used to skip processing for types that we know
 * can not be (i.e. are never consider to be) beans: 
 * things like primitives, Arrays, Enums, and proxy types.
 *<p>
 * Note that usually we shouldn't really be getting these sort of
 * types anyway; but better safe than sorry.
 */
protected boolean isPotentialBeanType(Class<?> type)
{
    String typeStr = ClassUtil.canBeABeanType(type);
    if (typeStr != null) {
        throw new IllegalArgumentException("Can not deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");
    }
    if (ClassUtil.isProxyType(type)) {
        throw new IllegalArgumentException("Can not deserialize Proxy class "+type.getName()+" as a Bean");
    }
    // also: can't deserialize local (in-method, anonymous, non-static-enclosed) classes
    typeStr = ClassUtil.isLocalType(type);
    if (typeStr != null) {
        throw new IllegalArgumentException("Can not deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");
    }
    return true;
}
项目:RHome    文件:Creator.java   
public Object construct(int value)
{
    // First: "native" int methods work best:
    try {
        if (_intCtor != null) {
            return _intCtor.newInstance(value);
        }
        if (_intFactoryMethod != null) {
            return _intFactoryMethod.invoke(_valueClass, Integer.valueOf(value));
        }
    } catch (Exception e) {
        ClassUtil.unwrapAndThrowAsIAE(e);
    }
    // but if not, can do widening conversion
    return construct((long) value);
}
项目:RHome    文件:Creator.java   
public Object construct(long value)
{
    /* For longs we don't even try casting down to ints;
     * theoretically could try if value fits... but let's
     * leave that as a future improvement
     */
    try {
        if (_longCtor != null) {
            return _longCtor.newInstance(value);
        }
        if (_longFactoryMethod != null) {
            return _longFactoryMethod.invoke(_valueClass, Long.valueOf(value));
        }
    } catch (Exception e) {
        ClassUtil.unwrapAndThrowAsIAE(e);
    }
    return null;
}
项目:RHome    文件:Creator.java   
public Object build(PropertyValueBuffer buffer)
    throws IOException, JsonProcessingException
{
    Object bean;
    try {
        if (_ctor != null) {
            bean = _ctor.newInstance(buffer.getParameters());
        } else {
            bean =  _factoryMethod.invoke(null, buffer.getParameters());
        }
    } catch (Exception e) {
        ClassUtil.unwrapAndThrowAsIAE(e);
        return null; // never gets here
    }
    // Anything buffered?
    for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) {
        pv.assign(bean);
    }
    return bean;
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
protected BeanPropertyWriter _constructWriter(SerializationConfig paramSerializationConfig, TypeBindings paramTypeBindings, PropertyBuilder paramPropertyBuilder, boolean paramBoolean, String paramString, AnnotatedMember paramAnnotatedMember)
  throws JsonMappingException
{
  if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS))
    paramAnnotatedMember.fixAccess();
  JavaType localJavaType = paramAnnotatedMember.getType(paramTypeBindings);
  BeanProperty.Std localStd = new BeanProperty.Std(paramString, localJavaType, paramPropertyBuilder.getClassAnnotations(), paramAnnotatedMember);
  JsonSerializer localJsonSerializer = findSerializerFromAnnotation(paramSerializationConfig, paramAnnotatedMember, localStd);
  boolean bool = ClassUtil.isCollectionMapOrArray(localJavaType.getRawClass());
  TypeSerializer localTypeSerializer = null;
  if (bool)
    localTypeSerializer = findPropertyContentTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd);
  BeanPropertyWriter localBeanPropertyWriter = paramPropertyBuilder.buildWriter(paramString, localJavaType, localJsonSerializer, findPropertyTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd), localTypeSerializer, paramAnnotatedMember, paramBoolean);
  localBeanPropertyWriter.setViews(paramSerializationConfig.getAnnotationIntrospector().findSerializationViews(paramAnnotatedMember));
  return localBeanPropertyWriter;
}
项目:12306-android-Decompile    文件:BasicBeanDescription.java   
public AnnotatedMethod findJsonValueMethod()
{
  Object localObject = null;
  Iterator localIterator = this._classInfo.memberMethods().iterator();
  while (localIterator.hasNext())
  {
    AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator.next();
    if (!this._annotationIntrospector.hasAsValueAnnotation(localAnnotatedMethod))
      continue;
    if (localObject != null)
      throw new IllegalArgumentException("Multiple methods with active 'as-value' annotation (" + localObject.getName() + "(), " + localAnnotatedMethod.getName() + ")");
    if (!ClassUtil.hasGetterSignature(localAnnotatedMethod.getAnnotated()))
      throw new IllegalArgumentException("Method " + localAnnotatedMethod.getName() + "() marked with an 'as-value' annotation, but does not have valid getter signature (non-static, takes no args, returns a value)");
    localObject = localAnnotatedMethod;
  }
  return localObject;
}
项目:12306-android-Decompile    文件:AnnotatedClass.java   
protected void _addClassMixIns(AnnotationMap paramAnnotationMap, Class<?> paramClass1, Class<?> paramClass2)
{
  if (paramClass2 == null)
    return;
  for (Annotation localAnnotation2 : paramClass2.getDeclaredAnnotations())
  {
    if (!this._annotationIntrospector.isHandled(localAnnotation2))
      continue;
    paramAnnotationMap.addIfNotPresent(localAnnotation2);
  }
  Iterator localIterator = ClassUtil.findSuperTypes(paramClass2, paramClass1).iterator();
  while (localIterator.hasNext())
    for (Annotation localAnnotation1 : ((Class)localIterator.next()).getDeclaredAnnotations())
    {
      if (!this._annotationIntrospector.isHandled(localAnnotation1))
        continue;
      paramAnnotationMap.addIfNotPresent(localAnnotation1);
    }
}
项目:12306-android-Decompile    文件:EnumDeserializer.java   
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (paramJsonParser.getCurrentToken() != JsonToken.VALUE_STRING)
    throw paramDeserializationContext.mappingException(this._enumClass);
  String str = paramJsonParser.getText();
  try
  {
    Object localObject = this._factory.invoke(this._enumClass, new Object[] { str });
    return localObject;
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return null;
}
项目:12306-android-Decompile    文件:BeanDeserializerFactory.java   
protected CreatorContainer findDeserializerCreators(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription)
  throws JsonMappingException
{
  boolean bool = paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS);
  CreatorContainer localCreatorContainer = new CreatorContainer(paramBasicBeanDescription, bool);
  AnnotationIntrospector localAnnotationIntrospector = paramDeserializationConfig.getAnnotationIntrospector();
  if (paramBasicBeanDescription.getType().isConcrete())
  {
    Constructor localConstructor = paramBasicBeanDescription.findDefaultConstructor();
    if (localConstructor != null)
    {
      if (bool)
        ClassUtil.checkAndFixAccess(localConstructor);
      localCreatorContainer.setDefaultConstructor(localConstructor);
    }
  }
  VisibilityChecker localVisibilityChecker1 = paramDeserializationConfig.getDefaultVisibilityChecker();
  if (!paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.AUTO_DETECT_CREATORS))
    localVisibilityChecker1 = localVisibilityChecker1.withCreatorVisibility(JsonAutoDetect.Visibility.NONE);
  VisibilityChecker localVisibilityChecker2 = paramDeserializationConfig.getAnnotationIntrospector().findAutoDetectVisibility(paramBasicBeanDescription.getClassInfo(), localVisibilityChecker1);
  _addDeserializerConstructors(paramDeserializationConfig, paramBasicBeanDescription, localVisibilityChecker2, localAnnotationIntrospector, localCreatorContainer);
  _addDeserializerFactoryMethods(paramDeserializationConfig, paramBasicBeanDescription, localVisibilityChecker2, localAnnotationIntrospector, localCreatorContainer);
  return localCreatorContainer;
}
项目:12306-android-Decompile    文件:Creator.java   
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  Object localObject1 = this._deserializer.deserialize(paramJsonParser, paramDeserializationContext);
  try
  {
    if (this._ctor != null)
      return this._ctor.newInstance(new Object[] { localObject1 });
    Object localObject2 = this._factoryMethod.invoke(null, new Object[] { localObject1 });
    return localObject2;
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return null;
}
项目:12306-android-Decompile    文件:Creator.java   
public Object build(PropertyValueBuffer paramPropertyValueBuffer)
  throws Exception
{
  Object localObject1 = null;
  try
  {
    Object localObject3;
    if (this._ctor != null)
      localObject3 = this._ctor.newInstance(paramPropertyValueBuffer.getParameters(this._defaultValues));
    Object localObject2;
    for (localObject1 = localObject3; ; localObject1 = localObject2)
    {
      for (PropertyValue localPropertyValue = paramPropertyValueBuffer.buffered(); localPropertyValue != null; localPropertyValue = localPropertyValue.next)
        localPropertyValue.assign(localObject1);
      localObject2 = this._factoryMethod.invoke(null, paramPropertyValueBuffer.getParameters(this._defaultValues));
    }
  }
  catch (Exception localException)
  {
    ClassUtil.throwRootCause(localException);
  }
  return localObject1;
}
项目:12306-android-Decompile    文件:Creator.java   
public Object construct(String paramString)
{
  try
  {
    if (this._ctor != null)
      return this._ctor.newInstance(new Object[] { paramString });
    if (this._factoryMethod != null)
    {
      Object localObject = this._factoryMethod.invoke(this._valueClass, new Object[] { paramString });
      return localObject;
    }
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return null;
}
项目:ingress-indonesia-dev    文件:EnumDeserializer$FactoryBasedDeserializer.java   
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
{
  if (paramJsonParser.getCurrentToken() != JsonToken.VALUE_STRING)
    throw paramDeserializationContext.mappingException(this._enumClass);
  String str = paramJsonParser.getText();
  try
  {
    Object localObject = this._factory.invoke(this._enumClass, new Object[] { str });
    return localObject;
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return null;
}
项目:ingress-indonesia-dev    文件:StdKeyDeserializers.java   
public static KeyDeserializer findStringBasedKeyDeserializer(DeserializationConfig paramDeserializationConfig, JavaType paramJavaType)
{
  BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramDeserializationConfig.introspect(paramJavaType);
  Constructor localConstructor = localBasicBeanDescription.findSingleArgConstructor(new Class[] { String.class });
  if (localConstructor != null)
  {
    if (paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS))
      ClassUtil.checkAndFixAccess(localConstructor);
    return new StdKeyDeserializer.StringCtorKeyDeserializer(localConstructor);
  }
  Method localMethod = localBasicBeanDescription.findFactoryMethod(new Class[] { String.class });
  if (localMethod != null)
  {
    if (paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS))
      ClassUtil.checkAndFixAccess(localMethod);
    return new StdKeyDeserializer.StringFactoryKeyDeserializer(localMethod);
  }
  return null;
}
项目:ingress-indonesia-dev    文件:BeanDeserializerFactory.java   
protected ValueInstantiator constructDefaultValueInstantiator(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription)
{
  boolean bool = paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS);
  CreatorCollector localCreatorCollector = new CreatorCollector(paramBasicBeanDescription, bool);
  AnnotationIntrospector localAnnotationIntrospector = paramDeserializationConfig.getAnnotationIntrospector();
  if (paramBasicBeanDescription.getType().isConcrete())
  {
    AnnotatedConstructor localAnnotatedConstructor = paramBasicBeanDescription.findDefaultConstructor();
    if (localAnnotatedConstructor != null)
    {
      if (bool)
        ClassUtil.checkAndFixAccess(localAnnotatedConstructor.getAnnotated());
      localCreatorCollector.setDefaultConstructor(localAnnotatedConstructor);
    }
  }
  VisibilityChecker localVisibilityChecker1 = paramDeserializationConfig.getDefaultVisibilityChecker();
  VisibilityChecker localVisibilityChecker2 = paramDeserializationConfig.getAnnotationIntrospector().findAutoDetectVisibility(paramBasicBeanDescription.getClassInfo(), localVisibilityChecker1);
  _addDeserializerFactoryMethods(paramDeserializationConfig, paramBasicBeanDescription, localVisibilityChecker2, localAnnotationIntrospector, localCreatorCollector);
  _addDeserializerConstructors(paramDeserializationConfig, paramBasicBeanDescription, localVisibilityChecker2, localAnnotationIntrospector, localCreatorCollector);
  return localCreatorCollector.constructValueInstantiator(paramDeserializationConfig);
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
protected void _reportIncompatibleRootType(Object paramObject, JavaType paramJavaType)
  throws IOException, JsonProcessingException
{
  if ((paramJavaType.isPrimitive()) && (ClassUtil.wrapperType(paramJavaType.getRawClass()).isAssignableFrom(paramObject.getClass())))
    return;
  throw new JsonMappingException("Incompatible types: declared root type (" + paramJavaType + ") vs " + paramObject.getClass().getName());
}
项目:12306-android-Decompile    文件:SerializationConfig.java   
public JsonSerializer<Object> serializerInstance(Annotated paramAnnotated, Class<? extends JsonSerializer<?>> paramClass)
{
  HandlerInstantiator localHandlerInstantiator = getHandlerInstantiator();
  if (localHandlerInstantiator != null)
  {
    JsonSerializer localJsonSerializer = localHandlerInstantiator.serializerInstance(this, paramAnnotated, paramClass);
    if (localJsonSerializer != null)
      return localJsonSerializer;
  }
  return (JsonSerializer)ClassUtil.createInstance(paramClass, canOverrideAccessModifiers());
}
项目:12306-android-Decompile    文件:BasicClassIntrospector.java   
public boolean includeMethod(Method paramMethod)
{
  if (super.includeMethod(paramMethod));
  Class localClass;
  do
  {
    return true;
    if (!ClassUtil.hasGetterSignature(paramMethod))
      return false;
    localClass = paramMethod.getReturnType();
  }
  while ((Collection.class.isAssignableFrom(localClass)) || (Map.class.isAssignableFrom(localClass)));
  return false;
}
项目:12306-android-Decompile    文件:BasicDeserializerFactory.java   
public JsonDeserializer<?> createCollectionDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, CollectionType paramCollectionType, BeanProperty paramBeanProperty)
  throws JsonMappingException
{
  CollectionType localCollectionType1 = (CollectionType)mapAbstractType(paramDeserializationConfig, paramCollectionType);
  Object localObject = localCollectionType1.getRawClass();
  BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramDeserializationConfig.introspectClassAnnotations((Class)localObject);
  JsonDeserializer localJsonDeserializer1 = findDeserializerFromAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
  if (localJsonDeserializer1 != null)
    return localJsonDeserializer1;
  CollectionType localCollectionType2 = (CollectionType)modifyTypeByAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), localCollectionType1, null);
  JavaType localJavaType = localCollectionType2.getContentType();
  JsonDeserializer localJsonDeserializer2 = (JsonDeserializer)localJavaType.getValueHandler();
  TypeDeserializer localTypeDeserializer = (TypeDeserializer)localJavaType.getTypeHandler();
  if (localTypeDeserializer == null)
    localTypeDeserializer = findTypeDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty);
  JsonDeserializer localJsonDeserializer3 = _findCustomCollectionDeserializer(localCollectionType2, paramDeserializationConfig, paramDeserializerProvider, localBasicBeanDescription, paramBeanProperty, localTypeDeserializer, localJsonDeserializer2);
  if (localJsonDeserializer3 != null)
    return localJsonDeserializer3;
  if (localJsonDeserializer2 == null)
  {
    if (EnumSet.class.isAssignableFrom((Class)localObject))
      return new EnumSetDeserializer(constructEnumResolver(localJavaType.getRawClass(), paramDeserializationConfig));
    localJsonDeserializer2 = paramDeserializerProvider.findValueDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty);
  }
  if ((localCollectionType2.isInterface()) || (localCollectionType2.isAbstract()))
  {
    Class localClass = (Class)_collectionFallbacks.get(((Class)localObject).getName());
    if (localClass == null)
      throw new IllegalArgumentException("Can not find a deserializer for non-concrete Collection type " + localCollectionType2);
    localObject = localClass;
  }
  Constructor localConstructor = ClassUtil.findConstructor((Class)localObject, paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS));
  if (localJavaType.getRawClass() == String.class)
    return new StringCollectionDeserializer(localCollectionType2, localJsonDeserializer2, localConstructor);
  return (JsonDeserializer<?>)new CollectionDeserializer(localCollectionType2, localJsonDeserializer2, localTypeDeserializer, localConstructor);
}
项目:12306-android-Decompile    文件:CreatorContainer.java   
protected AnnotatedConstructor verifyNonDup(AnnotatedConstructor paramAnnotatedConstructor1, AnnotatedConstructor paramAnnotatedConstructor2, String paramString)
{
  if (paramAnnotatedConstructor2 != null)
    throw new IllegalArgumentException("Conflicting " + paramString + " constructors: already had " + paramAnnotatedConstructor2 + ", encountered " + paramAnnotatedConstructor1);
  if (this._canFixAccess)
    ClassUtil.checkAndFixAccess(paramAnnotatedConstructor1.getAnnotated());
  return paramAnnotatedConstructor1;
}
项目:12306-android-Decompile    文件:CreatorContainer.java   
protected AnnotatedMethod verifyNonDup(AnnotatedMethod paramAnnotatedMethod1, AnnotatedMethod paramAnnotatedMethod2, String paramString)
{
  if (paramAnnotatedMethod2 != null)
    throw new IllegalArgumentException("Conflicting " + paramString + " factory methods: already had " + paramAnnotatedMethod2 + ", encountered " + paramAnnotatedMethod1);
  if (this._canFixAccess)
    ClassUtil.checkAndFixAccess(paramAnnotatedMethod1.getAnnotated());
  return paramAnnotatedMethod1;
}
项目:12306-android-Decompile    文件:BeanDeserializer.java   
protected Object constructDefaultInstance()
{
  try
  {
    Object localObject = this._defaultConstructor.newInstance(new Object[0]);
    return localObject;
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return null;
}
项目:12306-android-Decompile    文件:StdDeserializerProvider.java   
protected JsonDeserializer<Object> _handleUnknownValueDeserializer(JavaType paramJavaType)
  throws JsonMappingException
{
  if (!ClassUtil.isConcrete(paramJavaType.getRawClass()))
    throw new JsonMappingException("Can not find a Value deserializer for abstract type " + paramJavaType);
  throw new JsonMappingException("Can not find a Value deserializer for type " + paramJavaType);
}
项目:12306-android-Decompile    文件:EnumDeserializer.java   
public static JsonDeserializer<?> deserializerForCreator(DeserializationConfig paramDeserializationConfig, Class<?> paramClass, AnnotatedMethod paramAnnotatedMethod)
{
  if (paramAnnotatedMethod.getParameterType(0) != String.class)
    throw new IllegalArgumentException("Parameter #0 type for factory method (" + paramAnnotatedMethod + ") not suitable, must be java.lang.String");
  if (paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS))
    ClassUtil.checkAndFixAccess(paramAnnotatedMethod.getMember());
  return new FactoryBasedDeserializer(paramClass, paramAnnotatedMethod);
}
项目:12306-android-Decompile    文件:BeanDeserializerFactory.java   
protected boolean isPotentialBeanType(Class<?> paramClass)
{
  String str1 = ClassUtil.canBeABeanType(paramClass);
  if (str1 != null)
    throw new IllegalArgumentException("Can not deserialize Class " + paramClass.getName() + " (of type " + str1 + ") as a Bean");
  if (ClassUtil.isProxyType(paramClass))
    throw new IllegalArgumentException("Can not deserialize Proxy class " + paramClass.getName() + " as a Bean");
  String str2 = ClassUtil.isLocalType(paramClass);
  if (str2 != null)
    throw new IllegalArgumentException("Can not deserialize Class " + paramClass.getName() + " (of type " + str2 + ") as a Bean");
  return true;
}
项目:12306-android-Decompile    文件:Creator.java   
public Object construct(int paramInt)
{
  try
  {
    if (this._intCtor != null)
    {
      Constructor localConstructor = this._intCtor;
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = Integer.valueOf(paramInt);
      return localConstructor.newInstance(arrayOfObject2);
    }
    if (this._intFactoryMethod != null)
    {
      Method localMethod = this._intFactoryMethod;
      Class localClass = this._valueClass;
      Object[] arrayOfObject1 = new Object[1];
      arrayOfObject1[0] = Integer.valueOf(paramInt);
      Object localObject = localMethod.invoke(localClass, arrayOfObject1);
      return localObject;
    }
  }
  catch (Exception localException)
  {
    ClassUtil.unwrapAndThrowAsIAE(localException);
  }
  return construct(paramInt);
}