Package com.oss.asn1

Class ValueNotationReader

java.lang.Object
com.oss.asn1.ValueNotationReader

public class ValueNotationReader extends Object
Implements ASN.1 value notation parser.
Since:
ASN.1/Java 8.5
  • Method Details

    • readValueAssignment

      public final AbstractData readValueAssignment(AVNInput in) throws AVNParseException
      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

      public final AbstractData readValueAssignment(String notation) throws AVNParseException
      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

      public final <T extends AbstractData> T readValue(AVNInput in, T sink) throws AVNParseException
      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

      public final <T extends AbstractData> T readValue(String notation, T sink) throws AVNParseException
      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.