directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [09/17] directory-kerby git commit: Added some javadoc
Date Fri, 27 Nov 2015 08:18:19 GMT
Added some javadoc


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/4d4be896
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/4d4be896
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/4d4be896

Branch: refs/heads/pkinit-support
Commit: 4d4be896d4e08cee1af88218210056ed32dde65d
Parents: a8a0769
Author: Kai Zheng <kai.zheng@intel.com>
Authored: Fri Nov 27 13:33:26 2015 +0800
Committer: Kai Zheng <kai.zheng@intel.com>
Committed: Fri Nov 27 13:33:26 2015 +0800

----------------------------------------------------------------------
 .../apache/kerby/asn1/type/Asn1FieldInfo.java   | 29 +++++++++++++++++++-
 .../apache/kerby/asn1/type/ExplicitField.java   | 13 +++++++++
 .../apache/kerby/asn1/type/ImplicitField.java   | 13 +++++++++
 3 files changed, 54 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/4d4be896/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1FieldInfo.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1FieldInfo.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1FieldInfo.java
index 3c844e1..fb3c885 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1FieldInfo.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1FieldInfo.java
@@ -21,17 +21,33 @@ package org.apache.kerby.asn1.type;
 
 import org.apache.kerby.asn1.TaggingOption;
 
+/**
+ * Representing a field in a ASN1 collection or choice.
+ */
 public class Asn1FieldInfo {
     private int index;
-    private int tagNo;
+    private int tagNo = -1; // Indicate a non-tagged field
     private boolean isImplicit;
     private Class<? extends Asn1Type> type;
 
+    /**
+     * Constructor for a tagged field, the tagNo being the same of index.
+     * @param index
+     * @param type
+     * @param isImplicit
+     */
     public Asn1FieldInfo(int index, Class<? extends Asn1Type> type,
                          boolean isImplicit) {
         this(index, index, type, isImplicit);
     }
 
+    /**
+     * Constructor for a tagged field.
+     * @param index
+     * @param tagNo
+     * @param type
+     * @param isImplicit
+     */
     public Asn1FieldInfo(int index, int tagNo, Class<? extends Asn1Type> type,
                          boolean isImplicit) {
         this.index = index;
@@ -40,6 +56,17 @@ public class Asn1FieldInfo {
         this.isImplicit = isImplicit;
     }
 
+    /**
+     * Constructor for a non-tagged field.
+     * @param index
+     * @param type
+     */
+    public Asn1FieldInfo(int index, Class<? extends Asn1Type> type) {
+        this.index = index;
+        this.type = type;
+        this.tagNo = -1; // Indicate a non-tagged field
+    }
+
     public boolean isTagged() {
         return tagNo != -1;
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/4d4be896/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ExplicitField.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ExplicitField.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ExplicitField.java
index 7628fdc..abb42ce 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ExplicitField.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ExplicitField.java
@@ -19,12 +19,25 @@
  */
 package org.apache.kerby.asn1.type;
 
+/**
+ * Representing an explicitly tagged field in a ASN1 collection or choice.
+ */
 public class ExplicitField extends Asn1FieldInfo {
 
+    /**
+     * Constructor for an explicitly tagged field.
+     * @param index
+     * @param type
+     */
     public ExplicitField(int index, int tagNo, Class<? extends Asn1Type> type) {
         super(index, tagNo, type, false);
     }
 
+    /**
+     * Constructor for an explicitly tagged field, the tagNo being the same of index.
+     * @param index
+     * @param type
+     */
     public ExplicitField(int index, Class<? extends Asn1Type> type) {
         super(index, index, type, false);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/4d4be896/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ImplicitField.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ImplicitField.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ImplicitField.java
index 128df68..b64bc4f 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ImplicitField.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/ImplicitField.java
@@ -19,12 +19,25 @@
  */
 package org.apache.kerby.asn1.type;
 
+/**
+ * Representing an implicitly tagged field in a ASN1 collection or choice.
+ */
 public class ImplicitField extends Asn1FieldInfo {
 
+    /**
+     * Constructor for an implicitly tagged field.
+     * @param index
+     * @param type
+     */
     public ImplicitField(int index, int tagNo, Class<? extends Asn1Type> type) {
         super(index, tagNo, type, true);
     }
 
+    /**
+     * Constructor for an implicitly tagged field, the tagNo being the same of index.
+     * @param index
+     * @param type
+     */
     public ImplicitField(int index, Class<? extends Asn1Type> type) {
         super(index, index, type, true);
     }


Mime
View raw message