Package com.oss.asn1
Class ValueNotationReader
java.lang.Object
com.oss.asn1.ValueNotationReader
Implements ASN.1 value notation parser.
- Since:
- ASN.1/Java 8.5
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Do not enforce constraints checking after a value was read.void
Throw an exception if unknown extension occurs.void
Do not use component relation constraint to determine an open type PDU.void
Enforce constraints checking after a value was read.void
Unknown extensions are ignored rather than an exception is thrown.void
Use component relation constraint to determine an open type PDU.int
final <T extends AbstractData>
TParses the value notation or the value assignment from the input.final <T extends AbstractData>
TParses the value notation or the value assignment from the input.final AbstractData
Parses the next value assignment from the input or returns null if the end of the input is reached.final AbstractData
readValueAssignment
(String notation) Parses the next value assignment from the input or returns null if the end of the input is reached.void
setRecursionLimit
(int limit) Limits the depth of recursive calls when the ASN.1 schema includes types with circular definitions.
-
Method Details
-
readValueAssignment
Parses the next value assignment from the input or returns null if the end of the input is reached.- Parameters:
in
- a text input to read the value notation from.- Returns:
- decoded AbstractData instance.
- Throws:
AVNParseException
- if an error occurs.
-
readValueAssignment
Parses the next value assignment from the input or returns null if the end of the input is reached.- Parameters:
notation
- a string to read the value notation from.- Returns:
- decoded AbstractData instance.
- Throws:
AVNParseException
- if an error occurs.
-
readValue
Parses the value notation or the value assignment from the input. If the value assignment is detected, its left-hand side is ignored and skipped. Returns null if the end of the input is reached.- Type Parameters:
T
- type of decoded value.- Parameters:
in
- a text input to read the value notation from.sink
- the PDU instance that will receive the decoded data.- Returns:
- decoded data.
- Throws:
AVNParseException
- if an error occurs.
-
readValue
Parses the value notation or the value assignment from the input. If the value assignment is detected, its left-hand side is ignored and skipped. Returns null if the end of the input is reached.- Type Parameters:
T
- type of decoded value.- Parameters:
notation
- a string to read the value notation from.sink
- the AbstractData instance that will receive the decoded data.- Returns:
- decoded data.
- Throws:
AVNParseException
- if an error occurs.
-
enableConstraints
public void enableConstraints()Enforce constraints checking after a value was read. -
disableConstraints
public void disableConstraints()Do not enforce constraints checking after a value was read. This can help improve performance. -
enableIgnoreUnknownExtensions
public void enableIgnoreUnknownExtensions()Unknown extensions are ignored rather than an exception is thrown. -
disableIgnoreUnknownExtensions
public void disableIgnoreUnknownExtensions()Throw an exception if unknown extension occurs. -
enableUseComponentRelationConstraints
public void enableUseComponentRelationConstraints()Use component relation constraint to determine an open type PDU. -
disableUseComponentRelationConstraints
public void disableUseComponentRelationConstraints()Do not use component relation constraint to determine an open type PDU. -
setRecursionLimit
public void setRecursionLimit(int limit) Limits the depth of recursive calls when the ASN.1 schema includes types with circular definitions. When the RecursionLimit is set to a positive value and the limit is exceeded, the parser aborts the operation and throws the IllegalStateException. Default value is 16.- Parameters:
limit
- value of recursion limit
-
getRecursionLimit
public int getRecursionLimit()- Returns:
- current recursion limit.
-