简体   繁体   English

需要有关单词“ Google云” Apache Beam Beam代码中“ @”符号的详细信息

[英]Need details of how the “@” symbol in words google cloud apache beam code

private interface Options extends PipelineOptions {
    @Description("Path of the file to write to")
    @Validation.Required
    String getOutput();

Take the above code for example. 以上面的代码为例。 It receive file details from user and validates that. 它从用户那里接收文件详细信息并进行验证。 (how?) Does it validate it against the datatype in the next line (String in this case) I don't seem to find any documentation on this. (如何?)是否针对下一行中的数据类型对它进行了验证(在这种情况下为String),我似乎没有找到任何文档。 Is this from Java or specific to Apache Beam? 这是来自Java还是特定于Apache Beam?

The @ syntax denotes an Annotation. @语法表示注释。 Annotations are a feature of Java. 注释是Java的功能。 Annotations can be processed at compile time or deployment time for a number of different effects, such as validation. 可以在编译时或部署时处理批注,以获得多种不同的效果,例如验证。 In this case, command line argument validation for an Apache Beam pipeline. 在这种情况下,将对Apache Beam管道进行命令行参数验证。

References: 参考文献:
1. Java Annotations 1. Java注释
2. PipelineOptions Validation Annotation 2. PipelineOptions验证注释

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM