Class ChoiceConverter

java.lang.Object
org.asnlab.asndt.runtime.conv.AsnConverter
org.asnlab.asndt.runtime.conv.ChoiceConverter
Direct Known Subclasses:
AbstractChoiceConverter, ChoiceValue.ChoiceValueConverter

public abstract class ChoiceConverter extends AsnConverter
The ChoiceConverter can convert choice value. This class is intent to be extended.
  • Field Details

    • alternativeConverters

      protected AsnConverter[] alternativeConverters
      The alternative converters
  • Constructor Details

    • ChoiceConverter

      public ChoiceConverter()
    • ChoiceConverter

      public ChoiceConverter(AsnConverter[] alternativeConverters)
  • Method Details

    • setAlternativeConverters

      public void setAlternativeConverters(AsnConverter[] alternativeConverters)
      Sets this ChoiceConverter's alternative converters
      Parameters:
      alternativeConverters - The alternative converters
    • getAlternativeConverter

      public AsnConverter getAlternativeConverter(int index)
      Returns this ChoiceConverter's alternative converters.
      Parameters:
      index - The index of alternative
      Returns:
      The alternative converters of this ChoiceConverter
    • createAlternative

      public abstract Object createAlternative(int index, Object alternativeObject)
      Given the choice index, and the alternative object, create the choice value object.
      Parameters:
      index - The choice index
      alternativeObject - The alternative object
      Returns:
      The new choice value object
    • getAlternativeIndex

      public abstract int getAlternativeIndex(Object object)
      Given the choice value object, return the choice index.
      Parameters:
      object - The choice value object
      Returns:
      The choice index
    • getAlternativeObject

      public abstract Object getAlternativeObject(Object object)
      Given the choice value object, return the alternative object.
      Parameters:
      object - The choice value object
      Returns:
      The alternative object