本文整理汇总了Java中org.codehaus.jackson.map.AnnotationIntrospector.hasCreatorAnnotation方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationIntrospector.hasCreatorAnnotation方法的具体用法?Java AnnotationIntrospector.hasCreatorAnnotation怎么用?Java AnnotationIntrospector.hasCreatorAnnotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.jackson.map.AnnotationIntrospector
的用法示例。
在下文中一共展示了AnnotationIntrospector.hasCreatorAnnotation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
}
示例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;
}
示例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);
}
}
示例4: _handleSingleArgumentFactory
import org.codehaus.jackson.map.AnnotationIntrospector; //导入方法依赖的package包/类
protected boolean _handleSingleArgumentFactory(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, VisibilityChecker<?> paramVisibilityChecker, AnnotationIntrospector paramAnnotationIntrospector, CreatorCollector paramCreatorCollector, AnnotatedMethod paramAnnotatedMethod, boolean paramBoolean)
{
Class localClass = paramAnnotatedMethod.getParameterClass(0);
if (localClass == String.class)
if ((paramBoolean) || (paramVisibilityChecker.isCreatorVisible(paramAnnotatedMethod)))
paramCreatorCollector.addStringCreator(paramAnnotatedMethod);
do
{
do
{
do
{
do
{
return true;
if ((localClass != Integer.TYPE) && (localClass != Integer.class))
break;
}
while ((!paramBoolean) && (!paramVisibilityChecker.isCreatorVisible(paramAnnotatedMethod)));
paramCreatorCollector.addIntCreator(paramAnnotatedMethod);
return true;
if ((localClass != Long.TYPE) && (localClass != Long.class))
break;
}
while ((!paramBoolean) && (!paramVisibilityChecker.isCreatorVisible(paramAnnotatedMethod)));
paramCreatorCollector.addLongCreator(paramAnnotatedMethod);
return true;
if ((localClass != Double.TYPE) && (localClass != Double.class))
break;
}
while ((!paramBoolean) && (!paramVisibilityChecker.isCreatorVisible(paramAnnotatedMethod)));
paramCreatorCollector.addDoubleCreator(paramAnnotatedMethod);
return true;
if ((localClass != Boolean.TYPE) && (localClass != Boolean.class))
break;
}
while ((!paramBoolean) && (!paramVisibilityChecker.isCreatorVisible(paramAnnotatedMethod)));
paramCreatorCollector.addBooleanCreator(paramAnnotatedMethod);
return true;
if (paramAnnotationIntrospector.hasCreatorAnnotation(paramAnnotatedMethod))
{
paramCreatorCollector.addDelegatingCreator(paramAnnotatedMethod);
return true;
}
return false;
}