|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.asn1.DERPath
public class DERPath
Describes paths to individual elements of an encoded DER object that may be addressed during parsing to associate a parsed element with a handler to handle that element. Consider the following production rule for a complex type that may be DER encoded:
BankAccountSet ::= SET OF {
account BankAccount
}
BankAccount ::= SEQUENCE OF {
accountNumber OCTET STRING,
accountName OCTET STRING,
accountType AccountType,
balance REAL
}
AccountType ::= ENUM {
checking (0),
savings (1)
}
Given an instance of BankAccountSet with two elements, the path to the balance of each bank account in the set is given by the following expression:
/SET/SEQ/REAL
Individual child elements can be accessed by explicitly mentioning the index of the item relative to its parent. For example, the second bank account in the set can be accessed as follows:
/SET/SEQ[1]
Node names in DER paths are constrained to the following:
DERParser| Field Summary | |
|---|---|
static String |
PATH_SEPARATOR
Separates nodes in a path specification. |
| Constructor Summary | |
|---|---|
DERPath()
Creates an empty path specification. |
|
DERPath(DERPath path)
Copy constructor. |
|
DERPath(String pathSpec)
Creates a path specification from its string representation. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
int |
getSize()
Gets the number of nodes in the path. |
int |
hashCode()
|
boolean |
isEmpty()
Determines whether the path contains any nodes. |
String |
peekNode()
Examines the last node in the path without removing it. |
String |
popNode()
Removes the last node in the path. |
DERPath |
pushNode(String name)
Appends a node to the path. |
DERPath |
pushNode(String name,
int index)
Appends a node to the path with the given child index. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PATH_SEPARATOR
| Constructor Detail |
|---|
public DERPath()
public DERPath(DERPath path)
path - to read nodes frompublic DERPath(String pathSpec)
pathSpec - string representation of a path, e.g. /SEQ[1]/CHOICE.| Method Detail |
|---|
public DERPath pushNode(String name)
name - of the path element to add
public DERPath pushNode(String name,
int index)
name - of the path element to addindex - child index
public String peekNode()
public String popNode()
public int getSize()
public boolean isEmpty()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||