当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationIntrospector.findPropertyNameForParam方法代码示例

本文整理汇总了Java中org.codehaus.jackson.map.AnnotationIntrospector.findPropertyNameForParam方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationIntrospector.findPropertyNameForParam方法的具体用法?Java AnnotationIntrospector.findPropertyNameForParam怎么用?Java AnnotationIntrospector.findPropertyNameForParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.jackson.map.AnnotationIntrospector的用法示例。


在下文中一共展示了AnnotationIntrospector.findPropertyNameForParam方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _addDeserializerFactoryMethods

import org.codehaus.jackson.map.AnnotationIntrospector; //导入方法依赖的package包/类
protected void _addDeserializerFactoryMethods(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, VisibilityChecker<?> paramVisibilityChecker, AnnotationIntrospector paramAnnotationIntrospector, CreatorCollector paramCreatorCollector)
{
  Iterator localIterator = paramBasicBeanDescription.getFactoryMethods().iterator();
  while (localIterator.hasNext())
  {
    AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator.next();
    int i = localAnnotatedMethod.getParameterCount();
    if (i > 0)
    {
      boolean bool = paramAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedMethod);
      if (i == 1)
      {
        AnnotatedParameter localAnnotatedParameter2 = localAnnotatedMethod.getParameter(0);
        String str2 = paramAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter2);
        if ((paramAnnotationIntrospector.findInjectableValueId(localAnnotatedParameter2) == null) && ((str2 == null) || (str2.length() == 0)))
          _handleSingleArgumentFactory(paramDeserializationConfig, paramBasicBeanDescription, paramVisibilityChecker, paramAnnotationIntrospector, paramCreatorCollector, localAnnotatedMethod, bool);
      }
      else if (paramAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedMethod))
      {
        CreatorProperty[] arrayOfCreatorProperty = new CreatorProperty[i];
        for (int j = 0; j < i; j++)
        {
          AnnotatedParameter localAnnotatedParameter1 = localAnnotatedMethod.getParameter(j);
          String str1 = paramAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter1);
          Object localObject = paramAnnotationIntrospector.findInjectableValueId(localAnnotatedParameter1);
          if (((str1 == null) || (str1.length() == 0)) && (localObject == null))
            throw new IllegalArgumentException("Argument #" + j + " of factory method " + localAnnotatedMethod + " has no property name annotation; must have when multiple-paramater static method annotated as Creator");
          arrayOfCreatorProperty[j] = constructCreatorProperty(paramDeserializationConfig, paramBasicBeanDescription, str1, j, localAnnotatedParameter1, localObject);
        }
        paramCreatorCollector.addPropertyCreator(localAnnotatedMethod, arrayOfCreatorProperty);
      }
    }
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:35,代码来源:BeanDeserializerFactory.java

示例2: findMapCreators

import org.codehaus.jackson.map.AnnotationIntrospector; //导入方法依赖的package包/类
protected CreatorContainer findMapCreators(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription)
  throws JsonMappingException
{
  AnnotationIntrospector localAnnotationIntrospector = paramDeserializationConfig.getAnnotationIntrospector();
  CreatorContainer localCreatorContainer = new CreatorContainer(paramBasicBeanDescription, paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS));
  Iterator localIterator1 = paramBasicBeanDescription.getConstructors().iterator();
  while (localIterator1.hasNext())
  {
    AnnotatedConstructor localAnnotatedConstructor = (AnnotatedConstructor)localIterator1.next();
    int m = localAnnotatedConstructor.getParameterCount();
    if ((m < 1) || (!localAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedConstructor)))
      continue;
    SettableBeanProperty[] arrayOfSettableBeanProperty2 = new SettableBeanProperty[m];
    int n = 0;
    for (int i1 = 0; i1 < m; i1++)
    {
      AnnotatedParameter localAnnotatedParameter2 = localAnnotatedConstructor.getParameter(i1);
      if (localAnnotatedParameter2 == null);
      for (String str2 = null; (str2 == null) || (str2.length() == 0); str2 = localAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter2))
        throw new IllegalArgumentException("Parameter #" + i1 + " of constructor " + localAnnotatedConstructor + " has no property name annotation: must have for @JsonCreator for a Map type");
      n++;
      arrayOfSettableBeanProperty2[i1] = constructCreatorProperty(paramDeserializationConfig, paramBasicBeanDescription, str2, i1, localAnnotatedParameter2);
    }
    localCreatorContainer.addPropertyConstructor(localAnnotatedConstructor, arrayOfSettableBeanProperty2);
  }
  Iterator localIterator2 = paramBasicBeanDescription.getFactoryMethods().iterator();
  while (localIterator2.hasNext())
  {
    AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator2.next();
    int i = localAnnotatedMethod.getParameterCount();
    if ((i < 1) || (!localAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedMethod)))
      continue;
    SettableBeanProperty[] arrayOfSettableBeanProperty1 = new SettableBeanProperty[i];
    int j = 0;
    for (int k = 0; k < i; k++)
    {
      AnnotatedParameter localAnnotatedParameter1 = localAnnotatedMethod.getParameter(k);
      if (localAnnotatedParameter1 == null);
      for (String str1 = null; (str1 == null) || (str1.length() == 0); str1 = localAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter1))
        throw new IllegalArgumentException("Parameter #" + k + " of factory method " + localAnnotatedMethod + " has no property name annotation: must have for @JsonCreator for a Map type");
      j++;
      arrayOfSettableBeanProperty1[k] = constructCreatorProperty(paramDeserializationConfig, paramBasicBeanDescription, str1, k, localAnnotatedParameter1);
    }
    localCreatorContainer.addPropertyFactory(localAnnotatedMethod, arrayOfSettableBeanProperty1);
  }
  return localCreatorContainer;
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:48,代码来源:BasicDeserializerFactory.java

示例3: _addDeserializerFactoryMethods

import org.codehaus.jackson.map.AnnotationIntrospector; //导入方法依赖的package包/类
protected void _addDeserializerFactoryMethods(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, VisibilityChecker<?> paramVisibilityChecker, AnnotationIntrospector paramAnnotationIntrospector, CreatorContainer paramCreatorContainer)
  throws JsonMappingException
{
  Iterator localIterator = paramBasicBeanDescription.getFactoryMethods().iterator();
  while (localIterator.hasNext())
  {
    AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator.next();
    int i = localAnnotatedMethod.getParameterCount();
    if (i < 1)
      continue;
    boolean bool = paramAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedMethod);
    if (i == 1)
    {
      String str2 = paramAnnotationIntrospector.findPropertyNameForParam(localAnnotatedMethod.getParameter(0));
      if ((str2 == null) || (str2.length() == 0))
      {
        Class localClass = localAnnotatedMethod.getParameterClass(0);
        if (localClass == String.class)
        {
          if ((!bool) && (!paramVisibilityChecker.isCreatorVisible(localAnnotatedMethod)))
            continue;
          paramCreatorContainer.addStringFactory(localAnnotatedMethod);
          continue;
        }
        if ((localClass == Integer.TYPE) || (localClass == Integer.class))
        {
          if ((!bool) && (!paramVisibilityChecker.isCreatorVisible(localAnnotatedMethod)))
            continue;
          paramCreatorContainer.addIntFactory(localAnnotatedMethod);
          continue;
        }
        if ((localClass == Long.TYPE) || (localClass == Long.class))
        {
          if ((!bool) && (!paramVisibilityChecker.isCreatorVisible(localAnnotatedMethod)))
            continue;
          paramCreatorContainer.addLongFactory(localAnnotatedMethod);
          continue;
        }
        if (!paramAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedMethod))
          continue;
        paramCreatorContainer.addDelegatingFactory(localAnnotatedMethod);
        continue;
      }
    }
    else
    {
      if (!paramAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedMethod))
        continue;
    }
    SettableBeanProperty[] arrayOfSettableBeanProperty = new SettableBeanProperty[i];
    for (int j = 0; j < i; j++)
    {
      AnnotatedParameter localAnnotatedParameter = localAnnotatedMethod.getParameter(j);
      String str1 = paramAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter);
      if ((str1 == null) || (str1.length() == 0))
        throw new IllegalArgumentException("Argument #" + j + " of factory method " + localAnnotatedMethod + " has no property name annotation; must have when multiple-paramater static method annotated as Creator");
      arrayOfSettableBeanProperty[j] = constructCreatorProperty(paramDeserializationConfig, paramBasicBeanDescription, str1, j, localAnnotatedParameter);
    }
    paramCreatorContainer.addPropertyFactory(localAnnotatedMethod, arrayOfSettableBeanProperty);
  }
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:62,代码来源:BeanDeserializerFactory.java

示例4: _addCreators

import org.codehaus.jackson.map.AnnotationIntrospector; //导入方法依赖的package包/类
protected void _addCreators()
{
  AnnotationIntrospector localAnnotationIntrospector = this._annotationIntrospector;
  if (localAnnotationIntrospector == null)
    return;
  Iterator localIterator1 = this._classDef.getConstructors().iterator();
  while (localIterator1.hasNext())
  {
    AnnotatedConstructor localAnnotatedConstructor = (AnnotatedConstructor)localIterator1.next();
    if (this._creatorProperties == null)
      this._creatorProperties = new LinkedList();
    int k = localAnnotatedConstructor.getParameterCount();
    for (int m = 0; m < k; m++)
    {
      AnnotatedParameter localAnnotatedParameter2 = localAnnotatedConstructor.getParameter(m);
      String str2 = localAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter2);
      if (str2 != null)
      {
        POJOPropertyBuilder localPOJOPropertyBuilder2 = _property(str2);
        localPOJOPropertyBuilder2.addCtor(localAnnotatedParameter2, str2, true, false);
        this._creatorProperties.add(localPOJOPropertyBuilder2);
      }
    }
  }
  Iterator localIterator2 = this._classDef.getStaticMethods().iterator();
  while (localIterator2.hasNext())
  {
    AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator2.next();
    if (this._creatorProperties == null)
      this._creatorProperties = new LinkedList();
    int i = localAnnotatedMethod.getParameterCount();
    for (int j = 0; j < i; j++)
    {
      AnnotatedParameter localAnnotatedParameter1 = localAnnotatedMethod.getParameter(j);
      String str1 = localAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter1);
      if (str1 != null)
      {
        POJOPropertyBuilder localPOJOPropertyBuilder1 = _property(str1);
        localPOJOPropertyBuilder1.addCtor(localAnnotatedParameter1, str1, true, false);
        this._creatorProperties.add(localPOJOPropertyBuilder1);
      }
    }
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:45,代码来源:POJOPropertiesCollector.java

示例5: _handleSingleArgumentConstructor

import org.codehaus.jackson.map.AnnotationIntrospector; //导入方法依赖的package包/类
protected boolean _handleSingleArgumentConstructor(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, VisibilityChecker<?> paramVisibilityChecker, AnnotationIntrospector paramAnnotationIntrospector, CreatorCollector paramCreatorCollector, AnnotatedConstructor paramAnnotatedConstructor, boolean paramBoolean1, boolean paramBoolean2)
{
  AnnotatedParameter localAnnotatedParameter = paramAnnotatedConstructor.getParameter(0);
  String str = paramAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter);
  Object localObject = paramAnnotationIntrospector.findInjectableValueId(localAnnotatedParameter);
  if ((localObject != null) || ((str != null) && (str.length() > 0)))
  {
    CreatorProperty[] arrayOfCreatorProperty = new CreatorProperty[1];
    arrayOfCreatorProperty[0] = constructCreatorProperty(paramDeserializationConfig, paramBasicBeanDescription, str, 0, localAnnotatedParameter, localObject);
    paramCreatorCollector.addPropertyCreator(paramAnnotatedConstructor, arrayOfCreatorProperty);
    return true;
  }
  Class localClass = paramAnnotatedConstructor.getParameterClass(0);
  if (localClass == String.class)
  {
    if ((paramBoolean1) || (paramBoolean2))
      paramCreatorCollector.addStringCreator(paramAnnotatedConstructor);
    return true;
  }
  if ((localClass == Integer.TYPE) || (localClass == Integer.class))
  {
    if ((paramBoolean1) || (paramBoolean2))
      paramCreatorCollector.addIntCreator(paramAnnotatedConstructor);
    return true;
  }
  if ((localClass == Long.TYPE) || (localClass == Long.class))
  {
    if ((paramBoolean1) || (paramBoolean2))
      paramCreatorCollector.addLongCreator(paramAnnotatedConstructor);
    return true;
  }
  if ((localClass == Double.TYPE) || (localClass == Double.class))
  {
    if ((paramBoolean1) || (paramBoolean2))
      paramCreatorCollector.addDoubleCreator(paramAnnotatedConstructor);
    return true;
  }
  if (paramBoolean1)
  {
    paramCreatorCollector.addDelegatingCreator(paramAnnotatedConstructor);
    return true;
  }
  return false;
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:45,代码来源:BeanDeserializerFactory.java


注:本文中的org.codehaus.jackson.map.AnnotationIntrospector.findPropertyNameForParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。