ASN.1/二进制注释的具体注释?
我正在 Java 中的 ASN.1 环境中使用“二进制注释”。 首先,我手动创建了一个 asn.1 序列的类。
@ASN1String(name = "", isUCS = false, stringType = UniversalTag.PrintableString)
@ASN1Element(name = "firstName", isOptional = false, hasTag = false, hasDefaultValue = false)
private String firstName = null;
现在我想知道“@”符号是什么意思?我试图在二进制笔记的来源中寻找提示,并发现以下内容:
package org.bn.annotations;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ASN1String {
String name();
boolean isUCS();
int stringType();
}
有人可以向我解释一下这个符号吗? 那就太好了。提前致谢。
尼里基
I am working with "binary notes" a ASN.1 environment in Java.
First I created a class of an asn.1 sequence by hand.
@ASN1String(name = "", isUCS = false, stringType = UniversalTag.PrintableString)
@ASN1Element(name = "firstName", isOptional = false, hasTag = false, hasDefaultValue = false)
private String firstName = null;
Now I am wondering what that "@" sign means? I tried to find hints in the source of binary notes, and found the following:
package org.bn.annotations;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ASN1String {
String name();
boolean isUCS();
int stringType();
}
Can someone explain the notation to me?
Would be nice. Thanks in advance.
nyyrikki
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在Java中,“@Foo”是一个注释。它旨在供您的特定构建环境的一部分来解释它。一般来说,注释会被 Java 代码块所取代。
有关注释的更多信息:http://download.oracle。 com/javase/1.5.0/docs/guide/language/annotations.html
我的猜测是,您需要查找 ASN.1 上的文档才能了解这些特定注释的作用。
In Java, "@Foo" is an annotation. It's intended for a part of your particular build environment to interpret it. Generally annotations get replaced with chunks of Java code.
More information on annotations: http://download.oracle.com/javase/1.5.0/docs/guide/language/annotations.html
My guess is that you need to look up documentation on ASN.1 to know what those specific annotations do.
我是这个框架的作者。这是用于控制某些 ASN.1 功能的字段/类的 Java 注释功能(元信息)。
对于您的示例,它是一个字符串字段,编码为 ASN.1 字节流作为不带标签的 ASCII 字符串(不是 unicode 字符串),并且对于父结构(ASN.1 序列)来说它不是可选(必需)的。
有关详细信息,您可以开始阅读http://en.wikipedia.org/wiki/ASN。 1#标准
I'm author this framework. This is Java annotation feature (meta information) for your fields/classes used to control some ASN.1 features.
For your sample it's a string field encoding to ASN.1 byte stream as ASCII string (not unicode string) without tag and it's not optional (required) for parent structure (ASN.1 sequence).
For details you can start read it http://en.wikipedia.org/wiki/ASN.1#Standards