📄 matchingruleassertion.java
字号:
package org.javaldap.ldapv3;
//-----------------------------------------------------------------------------
// NOTE: this is a machine generated file - editing not recommended
//
// File: ./src/org/javaldap/ldapv3/MatchingRuleAssertion.java
//
// Java class for ASN.1 definition MatchingRuleAssertion as defined in
// module LDAPv3.
// This file was generated by Snacc for Java at Fri Jul 2 18:01:43 1999
// Snacc for Java - Andreas Schade (SAN/ZRL)
//-----------------------------------------------------------------------------
// Import PrintStream class for print methods
import java.io.PrintStream;
// Import ASN.1 basic type representations
import com.ibm.util.*;
// Import ASN.1 decoding/encoding classes
import com.ibm.asn1.*;
/** This class represents the ASN.1 SEQUENCE type <tt>MatchingRuleAssertion</tt>.
* For each sequence member, sequence classes contain a
* public member variable of the corresponding Java type.
* @author Snacc for Java
* @version Fri Jul 2 18:01:43 1999
*/
public class MatchingRuleAssertion implements LDAPv3 {
/** member variable representing the sequence member matchingRule of type byte[] */
public byte[] matchingRule = null;
/** member variable representing the sequence member type of type byte[] */
public byte[] type = null;
/** member variable representing the sequence member matchValue of type byte[] */
public byte[] matchValue;
/** member variable representing the sequence member dnAttributes of type boolean */
public boolean dnAttributes = false;
/** default constructor */
public MatchingRuleAssertion() {}
/** copy constructor */
public MatchingRuleAssertion (MatchingRuleAssertion arg) {
matchingRule = new byte[arg.matchingRule.length];
System.arraycopy(arg.matchingRule,0,matchingRule,0,arg.matchingRule.length);
type = new byte[arg.type.length];
System.arraycopy(arg.type,0,type,0,arg.type.length);
matchValue = new byte[arg.matchValue.length];
System.arraycopy(arg.matchValue,0,matchValue,0,arg.matchValue.length);
dnAttributes = arg.dnAttributes;
}
/** decoding method.
* @param dec
* decoder object derived from com.ibm.asn1.ASN1Decoder
* @exception com.ibm.asn1.ASN1Exception
* decoding error
*/
public void decode (ASN1Decoder dec) throws ASN1Exception {
int seq_nr = dec.decodeSequence();
if (!dec.nextIsOptional(dec.makeTag(dec.CONTEXT_TAG_CLASS,1))) {
dec.nextIsImplicit(dec.makeTag(dec.CONTEXT_TAG_CLASS,1));
matchingRule = dec.decodeOctetString();
}
if (!dec.nextIsOptional(dec.makeTag(dec.CONTEXT_TAG_CLASS,2))) {
dec.nextIsImplicit(dec.makeTag(dec.CONTEXT_TAG_CLASS,2));
type = dec.decodeOctetString();
}
dec.nextIsImplicit(dec.makeTag(dec.CONTEXT_TAG_CLASS,3));
matchValue = dec.decodeOctetString();
if (!dec.nextIsDefault(dec.makeTag(dec.CONTEXT_TAG_CLASS,4))) {
dec.nextIsImplicit(dec.makeTag(dec.CONTEXT_TAG_CLASS,4));
dnAttributes = dec.decodeBoolean();
}
dec.endOf(seq_nr);
}
/** encoding method.
* @param enc
* encoder object derived from com.ibm.asn1.ASN1Encoder
* @exception com.ibm.asn1.ASN1Exception
* encoding error
*/
public void encode (ASN1Encoder enc) throws ASN1Exception {
int seq_nr = enc.encodeSequence();
if (matchingRule != null) {
enc.nextIsImplicit(enc.makeTag(enc.CONTEXT_TAG_CLASS,1));
enc.encodeOctetString(matchingRule);
}
if (type != null) {
enc.nextIsImplicit(enc.makeTag(enc.CONTEXT_TAG_CLASS,2));
enc.encodeOctetString(type);
}
enc.nextIsImplicit(enc.makeTag(enc.CONTEXT_TAG_CLASS,3));
enc.encodeOctetString(matchValue);
if (enc.encodeDefault() || dnAttributes != false) {
enc.nextIsImplicit(enc.makeTag(enc.CONTEXT_TAG_CLASS,4));
enc.encodeBoolean(dnAttributes);
}
enc.endOf(seq_nr);
}
/** default print method (variable indentation)
* @param os
* PrintStream representing the print destination (file, etc)
*/
public void print (PrintStream os) {
print(os,0);
}
/** print method (variable indentation)
* @param os
* PrintStream representing the print destination (file, etc)
* @param indent
* number of blanks that preceed each output line.
*/
public void print (PrintStream os, int indent) {
os.println("{ -- SEQUENCE --");
if (matchingRule != null) {
for(int ii = 0; ii < indent+2; ii++) os.print(' ');
os.print("matchingRule = ");
try {
(new HexOutputStream(os)).write(matchingRule);
} catch (java.io.IOException ex) {
os.print("( unprintable OCTET STRING value )");
}
}
os.println(',');
if (type != null) {
for(int ii = 0; ii < indent+2; ii++) os.print(' ');
os.print("type = ");
try {
(new HexOutputStream(os)).write(type);
} catch (java.io.IOException ex) {
os.print("( unprintable OCTET STRING value )");
}
}
os.println(',');
for(int ii = 0; ii < indent+2; ii++) os.print(' ');
os.print("matchValue = ");
try {
(new HexOutputStream(os)).write(matchValue);
} catch (java.io.IOException ex) {
os.print("( unprintable OCTET STRING value )");
}
os.println(',');
for(int ii = 0; ii < indent+2; ii++) os.print(' ');
os.print("dnAttributes = ");
os.print(dnAttributes);
os.println();
for(int ii = 0; ii < indent; ii++) os.print(' ');
os.print('}');
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -