當前位置: 首頁>>代碼示例>>Java>>正文


Java Annotated.hasAnnotation方法代碼示例

本文整理匯總了Java中com.fasterxml.jackson.databind.introspect.Annotated.hasAnnotation方法的典型用法代碼示例。如果您正苦於以下問題:Java Annotated.hasAnnotation方法的具體用法?Java Annotated.hasAnnotation怎麽用?Java Annotated.hasAnnotation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.fasterxml.jackson.databind.introspect.Annotated的用法示例。


在下文中一共展示了Annotated.hasAnnotation方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findSerializer

import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Object findSerializer( Annotated annotated ) {

    if( ! annotated.hasAnnotation(Column.class) || ! isStringType(annotated) ) {
        return super.findSerializer( annotated );
    }

    Class classType = annotated.getRawType();

    if( Types.isNotString(classType) ) {
        if( Types.isBoolean(classType) ) {
            return ColumnBooleanSerializer.class;
        } else if( ! Types.isPrimitive(classType) ) {
            return ColumnBeanSerializer.class;
        }
    }

    return super.findSerializer( annotated );

}
 
開發者ID:NyBatis,項目名稱:NyBatisCore,代碼行數:21,代碼來源:ColumnAnnotationInspector.java

示例2: findDeserializer

import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Object findDeserializer( Annotated annotated ) {

    if( ! annotated.hasAnnotation(Column.class) || ! isStringType(annotated) ) {
        return super.findDeserializer( annotated );
    }

    Class classType;
    try {
        classType = ( (AnnotatedMethod) annotated ).getRawParameterType( 0 );
    } catch( Exception e ) {
        classType = annotated.getRawType();
    }

    if( Types.isNotString(classType) ) {
        if( Types.isBoolean(classType) ) {
            return ColumnBooleanDeserializer.class;
        } else if( ! Types.isPrimitive(classType) ) {
            return ColumnBeanDeserializer.class;
        }
    }

    return super.findDeserializer( annotated );

}
 
開發者ID:NyBatis,項目名稱:NyBatisCore,代碼行數:26,代碼來源:ColumnAnnotationInspector.java

示例3: findSerializer

import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public Object findSerializer(Annotated am) {
	if (am.hasAnnotation(ManyToOne.class)) {
		return new ManyToOneSerializer((Class<AbstractEntity>) am.getRawType());
	} else {
		return super.findDeserializer(am);
	}
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:10,代碼來源:HibernateAnnotationIntrospector.java

示例4: findDeserializer

import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Object findDeserializer(Annotated am) {
	if (am.hasAnnotation(ManyToOne.class)) {
		return new ManyToOneDeserializer(am.getRawType());
	} else {
		return super.findDeserializer(am);
	}
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:9,代碼來源:HibernateAnnotationIntrospector.java

示例5: findSerializer

import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Object findSerializer(Annotated am) {
  if (am.hasAnnotation(Obfuscate.class)) {
    return OBFUSCATE_SERIALIZER;
  } else {
    return null;
  }
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Mesos,代碼行數:9,代碼來源:ObfuscateAnnotationIntrospector.java

示例6: getMappedName

import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
private PropertyName getMappedName(Annotated annotated) {
    if (annotated.hasAnnotation(Table.class)) {
        Table table = annotated.getAnnotation(Table.class);
        return new PropertyName(table.name());
    } if (annotated.hasAnnotation(View.class)) {
        View view = annotated.getAnnotation(View.class);
        return new PropertyName(view.name());
    } else if (annotated.hasAnnotation(Column.class)) {
        Column column = annotated.getAnnotation(Column.class);
        return new PropertyName(column.name());
    } else {
        return null;
    }
}
 
開發者ID:requery,項目名稱:requery,代碼行數:15,代碼來源:EntityAnnotationIntrospector.java


注:本文中的com.fasterxml.jackson.databind.introspect.Annotated.hasAnnotation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。