Class StringSwitchWriter

java.lang.Object
io.micronaut.inject.writer.StringSwitchWriter

@Internal public abstract class StringSwitchWriter extends Object
String switch writer.
Since:
3.1
Author:
Denis Stepanov
  • Constructor Details

    • StringSwitchWriter

      public StringSwitchWriter()
  • Method Details

    • getKeys

      protected abstract Set<String> getKeys()
      Returns:
      Get cases keys
    • pushStringValue

      protected abstract void pushStringValue()
      Push the string value that is being evaluated.
    • onMatch

      protected abstract void onMatch(String value, org.objectweb.asm.Label end)
      Generate on case matches statement.
      Parameters:
      value - The string that matched
      end - The end label
    • generateDefault

      protected void generateDefault()
      Generate default statement.
    • write

      public void write(org.objectweb.asm.commons.GeneratorAdapter writer)
      Write the string switch implementation.
      Parameters:
      writer - The writer
    • generateValueCase

      protected void generateValueCase(org.objectweb.asm.commons.GeneratorAdapter writer, String string, org.objectweb.asm.Label end)
      Generate the switch case.
      Parameters:
      writer - The writer
      string - The string matched
      end - The end label