草庐IT

annotation_processors

全部标签

android - Kotlin + Dagger2 : cannot be provided without an @Inject constructor or from an @Provides- or @Produces-annotated method

我收到以下错误:Error:(8,1)error:java.lang.Stringcannotbeprovidedwithoutan@Injectconstructororfroman@Provides-or@Produces-annotatedmethod.我一直在尝试制作一个提供两个合格字符串的模块。这是Dagger的简化设置。@Singleton@Component(modules=[GreetingsModule::class])interfaceAppComponent{funinject(activity:MainActivity)}@Qualifierannotation

windows - Intel 和 AMD 处理器的 PROCESSOR_ARCHITECTURE 的奇怪注册表值

我在安装过程中遇到了一个小任务,要查看系统是32位还是64位机器?我通过获取位于HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Environment\文件夹中的注册表PROCESSOR_ARCHITECTURE的值找到了方法,但我惊讶地发现该值是AMD64但我的处理器是Intel64Family6Model23Stepping10,GenuineIntel?那么为什么AMD64用于Intel64位处理器? 最佳答案 根据documentation

annotations - Kotlin - 如何获取注释属性值

说,我有一个带注释的Kotlin类:@Entity@Table(name="user")dataclassUser(valid:Long,valname:String)如何从@Table注解中获取name属性的值?funtableName(c:KClass):String{//icangetthe@Tableannotationlikethis:valt=c.annotations.find{it.annotationClass==Table::class}//buthowcanigetthevalueof"name"attributefromt?} 最佳答

annotations - Kotlin - 如何获取注释属性值

说,我有一个带注释的Kotlin类:@Entity@Table(name="user")dataclassUser(valid:Long,valname:String)如何从@Table注解中获取name属性的值?funtableName(c:KClass):String{//icangetthe@Tableannotationlikethis:valt=c.annotations.find{it.annotationClass==Table::class}//buthowcanigetthevalueof"name"attributefromt?} 最佳答

windows - 为什么 %processor_architecture% 总是返回 x86 而不是 AMD64

我正在尝试检索环境变量以检测系统是32位还是64位。但是在64位服务器上,环境变量%processor_architecture%返回x86而不是AMD64。有人知道这件事吗? 最佳答案 您可能获取了错误的环境变量。如果您的应用程序是在64位操作系统上运行的32位应用程序,则此环境变量的进程版本将返回x86。如果要查找机器的体系结构,可以从以下注册表项中获取:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\Environment\PROCESSOR

Java Spring Redis : Set time to live with annotation

我正在寻找一种使用spring注释设置TTL的方法。我试过了@CacheEvict(allEntries=true,value={"mycache"})@Scheduled(fixedDelay=5000)然后将@EnableScheduling放在我的Application.java上,但没有成功。我还在类上尝试了@RedisHash(timeToLive=2000)有和没有@TimeToLive(unit=TimeUnit.SECONDS)方法。然后我尝试将@EnableRedisRepositories(keyspaceConfiguration=UserKeySpaceConf

java - hibernate 问题 : @OneToMany annotation returns duplicates

我遇到了Hibernate(4.3.0)的问题,因为单向@OneToMany返回重复项。我的数据库结构(MySQL和InnoDB),其中“入口”表与“入口地址”表具有1:N关系。'entry'表是主表,'entry_address'是'entry'表的子表。CREATETABLEIFNOTEXISTS`entry`(`id`int(10)unsignedNOTNULLAUTO_INCREMENT,`name`varchar(500)NOTNULL,`active`int(1)NOTNULLDEFAULT'0',`modifiedTS`timestampNOTNULLDEFAULT'00

iphone - MKMapView 自定义 UserLocation Annotation

我正在寻找自定义MKMapViewuserLocation注释,以像官方map应用程序一样绘制标题箭头。我正在尝试在viewForAnnotation中执行此操作:-(MKAnnotationView*)mapView:(MKMapView*)theMapViewviewForAnnotation:(id)annotation{if([annotationisKindOfClass:[MKUserLocationclass]]){}}但我无法找到下一步如何获取UserLocationView并对其进行自定义。非常感谢... 最佳答案

annotations - Kotlin 注释 IntDef

我有这个代码示例:classMeasureTextView:TextView{constructor(context:Context?):super(context)constructor(context:Context?,attrs:AttributeSet?):super(context,attrs)constructor(context:Context?,attrs:AttributeSet?,defStyleAttr:Int):super(context,attrs,defStyleAttr)constructor(context:Context?,attrs:Attribut

annotations - Kotlin 注释 IntDef

我有这个代码示例:classMeasureTextView:TextView{constructor(context:Context?):super(context)constructor(context:Context?,attrs:AttributeSet?):super(context,attrs)constructor(context:Context?,attrs:AttributeSet?,defStyleAttr:Int):super(context,attrs,defStyleAttr)constructor(context:Context?,attrs:Attribut