本文整理汇总了Java中com.fasterxml.jackson.databind.introspect.AnnotatedMember类的典型用法代码示例。如果您正苦于以下问题:Java AnnotatedMember类的具体用法?Java AnnotatedMember怎么用?Java AnnotatedMember使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnnotatedMember类属于com.fasterxml.jackson.databind.introspect包,在下文中一共展示了AnnotatedMember类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultMethodSkippingModuleProvider
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
public DefaultMethodSkippingModuleProvider() {
module = new SimpleModule();
module.setSerializerModifier(new BeanSerializerModifier() {
@Override
public List<BeanPropertyWriter> changeProperties(SerializationConfig config, BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) {
return super.changeProperties(config, beanDesc, beanProperties.stream().filter(bpw -> {
final AnnotatedMember jacksonMember = bpw.getMember();
final Member member = jacksonMember.getMember();
if (member instanceof Method) {
final Method method = (Method) member;
if (method.isDefault()) {
// only exclude default methods if they are defined on interfaces from the core components
return !method.getDeclaringClass().getName().startsWith(PACKAGE_CORE_COMPONENTS);
}
}
return true;
}).collect(Collectors.toList()));
}
});
}
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-core-wcm-components,代码行数:22,代码来源:DefaultMethodSkippingModuleProvider.java
示例2: setupModule
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
context.insertAnnotationIntrospector(new NopAnnotationIntrospector() {
private static final long serialVersionUID = 479313244908256455L;
@Override
public boolean hasIgnoreMarker(AnnotatedMember m) {
if (!(m instanceof AnnotatedMethod)) {
return super.hasIgnoreMarker(m);
}
AnnotatedMethod method = (AnnotatedMethod) m;
return method.getName().startsWith("lambda$") ? true : super.hasIgnoreMarker(m);
}
});
}
示例3: hasRequiredMarker
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
@Override
public Boolean hasRequiredMarker(AnnotatedMember m)
{
ApiParam apiParam = m.getAnnotation(ApiParam.class);
if (apiParam != null) {
return apiParam.required();
}
ApiModelProperty ann = m.getAnnotation(ApiModelProperty.class);
if (ann != null) {
return ann.required();
}
XmlElement elem = m.getAnnotation(XmlElement.class);
if (elem != null) {
if (elem.required()) {
return true;
}
}
return null;
}
示例4: _constructWriter
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
protected BeanPropertyWriter _constructWriter(SerializerProvider paramSerializerProvider, BeanPropertyDefinition paramBeanPropertyDefinition, TypeBindings paramTypeBindings, PropertyBuilder paramPropertyBuilder, boolean paramBoolean, AnnotatedMember paramAnnotatedMember)
{
String str = paramBeanPropertyDefinition.getName();
if (paramSerializerProvider.canOverrideAccessModifiers())
paramAnnotatedMember.fixAccess();
JavaType localJavaType = paramAnnotatedMember.getType(paramTypeBindings);
BeanProperty.Std localStd = new BeanProperty.Std(str, localJavaType, paramBeanPropertyDefinition.getWrapperName(), paramPropertyBuilder.getClassAnnotations(), paramAnnotatedMember, paramBeanPropertyDefinition.isRequired());
JsonSerializer localJsonSerializer1 = findSerializerFromAnnotation(paramSerializerProvider, paramAnnotatedMember);
JsonSerializer localJsonSerializer2 = localJsonSerializer1;
if ((localJsonSerializer1 instanceof ResolvableSerializer))
((ResolvableSerializer)localJsonSerializer2).resolve(paramSerializerProvider);
if ((localJsonSerializer2 instanceof ContextualSerializer))
localJsonSerializer2 = ((ContextualSerializer)localJsonSerializer2).createContextual(paramSerializerProvider, localStd);
boolean bool = ClassUtil.isCollectionMapOrArray(localJavaType.getRawClass());
TypeSerializer localTypeSerializer1 = null;
if (bool)
localTypeSerializer1 = findPropertyContentTypeSerializer(localJavaType, paramSerializerProvider.getConfig(), paramAnnotatedMember);
TypeSerializer localTypeSerializer2 = findPropertyTypeSerializer(localJavaType, paramSerializerProvider.getConfig(), paramAnnotatedMember);
return paramPropertyBuilder.buildWriter(paramBeanPropertyDefinition, localJavaType, localJsonSerializer2, localTypeSerializer2, localTypeSerializer1, paramAnnotatedMember, paramBoolean);
}
示例5: addInjectables
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
protected void addInjectables(DeserializationContext paramDeserializationContext, BeanDescription paramBeanDescription, BeanDeserializerBuilder paramBeanDeserializerBuilder)
{
Map localMap = paramBeanDescription.findInjectables();
if (localMap != null)
{
boolean bool = paramDeserializationContext.canOverrideAccessModifiers();
Iterator localIterator = localMap.entrySet().iterator();
while (localIterator.hasNext())
{
Map.Entry localEntry = (Map.Entry)localIterator.next();
AnnotatedMember localAnnotatedMember = (AnnotatedMember)localEntry.getValue();
if (bool)
localAnnotatedMember.fixAccess();
paramBeanDeserializerBuilder.addInjectable(localAnnotatedMember.getName(), paramBeanDescription.resolveType(localAnnotatedMember.getGenericType()), paramBeanDescription.getClassAnnotations(), localAnnotatedMember, localEntry.getKey());
}
}
}
示例6: addReferenceProperties
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
protected void addReferenceProperties(DeserializationContext paramDeserializationContext, BeanDescription paramBeanDescription, BeanDeserializerBuilder paramBeanDeserializerBuilder)
{
Map localMap = paramBeanDescription.findBackReferenceProperties();
if (localMap != null)
{
Iterator localIterator = localMap.entrySet().iterator();
while (localIterator.hasNext())
{
Map.Entry localEntry = (Map.Entry)localIterator.next();
String str = (String)localEntry.getKey();
AnnotatedMember localAnnotatedMember = (AnnotatedMember)localEntry.getValue();
Object localObject;
if ((localAnnotatedMember instanceof AnnotatedMethod))
localObject = ((AnnotatedMethod)localAnnotatedMember).getGenericParameterType(0);
else
localObject = localAnnotatedMember.getRawType();
paramBeanDeserializerBuilder.addBackReferenceProperty(str, constructSettableProperty(paramDeserializationContext, paramBeanDescription, SimpleBeanPropertyDefinition.construct(paramDeserializationContext.getConfig(), localAnnotatedMember), (Type)localObject));
}
}
}
示例7: constructSettableProperty
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
protected SettableBeanProperty constructSettableProperty(DeserializationContext paramDeserializationContext, BeanDescription paramBeanDescription, BeanPropertyDefinition paramBeanPropertyDefinition, Type paramType)
{
AnnotatedMember localAnnotatedMember = paramBeanPropertyDefinition.getMutator();
if (paramDeserializationContext.canOverrideAccessModifiers())
localAnnotatedMember.fixAccess();
JavaType localJavaType1 = paramBeanDescription.resolveType(paramType);
BeanProperty.Std localStd = new BeanProperty.Std(paramBeanPropertyDefinition.getName(), localJavaType1, paramBeanPropertyDefinition.getWrapperName(), paramBeanDescription.getClassAnnotations(), localAnnotatedMember, paramBeanPropertyDefinition.isRequired());
JavaType localJavaType2 = resolveType(paramDeserializationContext, paramBeanDescription, localJavaType1, localAnnotatedMember);
if (localJavaType2 != localJavaType1)
localStd.withType(localJavaType2);
JsonDeserializer localJsonDeserializer = findDeserializerFromAnnotation(paramDeserializationContext, localAnnotatedMember);
JavaType localJavaType3 = modifyTypeByAnnotation(paramDeserializationContext, localAnnotatedMember, localJavaType2);
TypeDeserializer localTypeDeserializer = (TypeDeserializer)localJavaType3.getTypeHandler();
Object localObject;
if ((localAnnotatedMember instanceof AnnotatedMethod))
localObject = new MethodProperty(paramBeanPropertyDefinition, localJavaType3, localTypeDeserializer, paramBeanDescription.getClassAnnotations(), (AnnotatedMethod)localAnnotatedMember);
else
localObject = new FieldProperty(paramBeanPropertyDefinition, localJavaType3, localTypeDeserializer, paramBeanDescription.getClassAnnotations(), (AnnotatedField)localAnnotatedMember);
if (localJsonDeserializer != null)
localObject = ((SettableBeanProperty)localObject).withValueDeserializer(localJsonDeserializer);
AnnotationIntrospector.ReferenceProperty localReferenceProperty = paramBeanPropertyDefinition.findReferenceType();
if ((localReferenceProperty != null) && (localReferenceProperty.isManagedReference()))
((SettableBeanProperty)localObject).setManagedReferenceName(localReferenceProperty.getName());
return localObject;
}
示例8: _resolveUnwrappedProperty
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
protected SettableBeanProperty _resolveUnwrappedProperty(DeserializationContext paramDeserializationContext, SettableBeanProperty paramSettableBeanProperty)
{
AnnotatedMember localAnnotatedMember = paramSettableBeanProperty.getMember();
if (localAnnotatedMember != null)
{
NameTransformer localNameTransformer = paramDeserializationContext.getAnnotationIntrospector().findUnwrappingNameTransformer(localAnnotatedMember);
if (localNameTransformer != null)
{
JsonDeserializer localJsonDeserializer1 = paramSettableBeanProperty.getValueDeserializer();
JsonDeserializer localJsonDeserializer2 = localJsonDeserializer1.unwrappingDeserializer(localNameTransformer);
if ((localJsonDeserializer2 != localJsonDeserializer1) && (localJsonDeserializer2 != null))
return paramSettableBeanProperty.withValueDeserializer(localJsonDeserializer2);
}
}
return null;
}
示例9: updateBuilder
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
@Override
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BeanDescription beanDesc, BeanDeserializerBuilder builder) {
for (BeanPropertyDefinition propDef : beanDesc.findProperties()) {
if (!propDef.hasGetter() || propDef.hasSetter()) {
continue;
}
AnnotatedMember getter = propDef.getAccessor();
if (!Keeper.class.equals(getter.getRawType())) {
continue;
}
builder.addOrReplaceProperty(new CustomGetterBeanProperty(propDef, getter), true);
}
return builder;
}
示例10: hasIgnoreMarker
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
@Override
public boolean hasIgnoreMarker(AnnotatedMember m) {
if (!(m instanceof AnnotatedField) && !(m instanceof AnnotatedMethod)) return false;
return (m.getAnnotation(IndexableProperty.class) == null
&& m.getAnnotation(IndexableComponent.class) == null && m.getAnnotation(IndexableProperties.class) == null);
}
示例11: hasIgnoreMarker
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
@Override
public boolean hasIgnoreMarker(AnnotatedMember m)
{
ApiModelProperty ann = m.getAnnotation(ApiModelProperty.class);
if (ann != null && ann.hidden()) {
return true;
}
return false;
}
示例12: findImplicitPropertyName
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
@Override
public String findImplicitPropertyName(AnnotatedMember member)
{
ApiParam annotation = member.getAnnotation(ApiParam.class);
if (annotation != null && annotation.value() != "") {
return annotation.value();
}
else {
return super.findImplicitPropertyName(member);
}
}
示例13: Std
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
public Std(String paramString, JavaType paramJavaType, PropertyName paramPropertyName, Annotations paramAnnotations, AnnotatedMember paramAnnotatedMember, boolean paramBoolean)
{
this._name = paramString;
this._type = paramJavaType;
this._wrapperName = paramPropertyName;
this._isRequired = paramBoolean;
this._member = paramAnnotatedMember;
this._contextAnnotations = paramAnnotations;
}
示例14: collectAndResolveSubtypes
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
public Collection<NamedType> collectAndResolveSubtypes(AnnotatedMember paramAnnotatedMember, MapperConfig<?> paramMapperConfig, AnnotationIntrospector paramAnnotationIntrospector, JavaType paramJavaType)
{
Class localClass;
if (paramJavaType == null)
localClass = paramAnnotatedMember.getRawType();
else
localClass = paramJavaType.getRawClass();
HashMap localHashMap = new HashMap();
if (this._registeredSubtypes != null)
{
Iterator localIterator2 = this._registeredSubtypes.iterator();
while (localIterator2.hasNext())
{
NamedType localNamedType3 = (NamedType)localIterator2.next();
if (localClass.isAssignableFrom(localNamedType3.getType()))
_collectAndResolve(AnnotatedClass.constructWithoutSuperTypes(localNamedType3.getType(), paramAnnotationIntrospector, paramMapperConfig), localNamedType3, paramMapperConfig, paramAnnotationIntrospector, localHashMap);
}
}
List localList = paramAnnotationIntrospector.findSubtypes(paramAnnotatedMember);
if (localList != null)
{
Iterator localIterator1 = localList.iterator();
while (localIterator1.hasNext())
{
NamedType localNamedType2 = (NamedType)localIterator1.next();
_collectAndResolve(AnnotatedClass.constructWithoutSuperTypes(localNamedType2.getType(), paramAnnotationIntrospector, paramMapperConfig), localNamedType2, paramMapperConfig, paramAnnotationIntrospector, localHashMap);
}
}
NamedType localNamedType1 = new NamedType(localClass, null);
_collectAndResolve(AnnotatedClass.constructWithoutSuperTypes(localClass, paramAnnotationIntrospector, paramMapperConfig), localNamedType1, paramMapperConfig, paramAnnotationIntrospector, localHashMap);
return new ArrayList(localHashMap.values());
}
示例15: createContextual
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; //导入依赖的package包/类
public JsonSerializer<?> createContextual(SerializerProvider paramSerializerProvider, BeanProperty paramBeanProperty)
{
TypeSerializer localTypeSerializer1 = this._valueTypeSerializer;
TypeSerializer localTypeSerializer2 = localTypeSerializer1;
if (localTypeSerializer1 != null)
localTypeSerializer2 = localTypeSerializer2.forProperty(paramBeanProperty);
JsonSerializer localJsonSerializer1 = null;
if (paramBeanProperty != null)
{
AnnotatedMember localAnnotatedMember = paramBeanProperty.getMember();
localJsonSerializer1 = null;
if (localAnnotatedMember != null)
{
Object localObject = paramSerializerProvider.getAnnotationIntrospector().findContentSerializer(localAnnotatedMember);
localJsonSerializer1 = null;
if (localObject != null)
localJsonSerializer1 = paramSerializerProvider.serializerInstance(localAnnotatedMember, localObject);
}
}
if (localJsonSerializer1 == null)
localJsonSerializer1 = this._elementSerializer;
JsonSerializer localJsonSerializer2 = findConvertingContentSerializer(paramSerializerProvider, paramBeanProperty, localJsonSerializer1);
JsonSerializer localJsonSerializer3 = localJsonSerializer2;
if (localJsonSerializer2 == null)
{
if ((this._elementType != null) && ((this._staticTyping) || (hasContentTypeAnnotation(paramSerializerProvider, paramBeanProperty))))
localJsonSerializer3 = paramSerializerProvider.findValueSerializer(this._elementType, paramBeanProperty);
}
else if ((localJsonSerializer3 instanceof ContextualSerializer))
localJsonSerializer3 = ((ContextualSerializer)localJsonSerializer3).createContextual(paramSerializerProvider, paramBeanProperty);
return withResolved(paramBeanProperty, localTypeSerializer2, localJsonSerializer3);
}