Package com.oss.asn1
Interface Printable
public interface Printable
This interface allows you to override the standard methods that are used to
print the values of ASN.1 types. Whenever the subclass of
AbstractData
implements the Printable
interface,
its print(int, PrintWriter)
method is called to print the value
of the type.- Since:
- ASN.1/Java 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
This mode indicates the customized print method has been called after the invocation of the default printing routine.static final int
This mode indicates the customized print method has been called before the invocation of the default printing routine.static final int
This result code instructs theDataPrinter
to invoke the default print method for the value after return from the customized print routine.static final int
This result code indicates that the value has been printed by the customized print routine and invocation of the default print method for the value is not required. -
Method Summary
-
Field Details
-
CONTINUE
static final int CONTINUEThis result code instructs theDataPrinter
to invoke the default print method for the value after return from the customized print routine.- See Also:
-
DONE
static final int DONEThis result code indicates that the value has been printed by the customized print routine and invocation of the default print method for the value is not required.- See Also:
-
BEFORE
static final int BEFOREThis mode indicates the customized print method has been called before the invocation of the default printing routine.- See Also:
-
AFTER
static final int AFTERThis mode indicates the customized print method has been called after the invocation of the default printing routine.- See Also:
-
-
Method Details
-
print
Prints thedata
value. This method is invoked at most twice: before the invocation of the default printing routine (themode
parameter is set toBEFORE
by the caller) and, optionally, after the default value notation has been printed (the caller sets themode
parameter toAFTER
on this second call). The second invocation does not occur if the first call to the customized print routine returned theDONE
result code. Extra caution should be taken when the customized print method calls thetoString()
method ofAbstractData
. Since thetoString()
implicitly calls the customized print method, an infinite recursion might occur. It is strongly recommended that the customized print method not print any newline characters, since it can cause havoc to the formatting style.- Parameters:
mode
- eitherBEFORE
orAFTER
s
-PrintWriter
to print the value.- Returns:
- the result code, either
CONTINUE
orDONE
. The caller ignores the result code when it invokes the customized print method withmode
argument set toAFTER
. - Throws:
UserPrintFailedException
- thrown if the customized method fails.
-