Class StringSwitchWriter


  • @Internal
    public abstract class StringSwitchWriter
    extends java.lang.Object
    String switch writer.
    Since:
    3.1
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void generateDefault()
      Generate default statement.
      protected void generateValueCase​(org.objectweb.asm.commons.GeneratorAdapter writer, java.lang.String string, org.objectweb.asm.Label end)
      Generate the switch case.
      protected abstract java.util.Set<java.lang.String> getKeys()  
      protected abstract void onMatch​(java.lang.String value, org.objectweb.asm.Label end)
      Generate on case matches statement.
      protected abstract void pushStringValue()
      Push the string value that is being evaluated.
      void write​(org.objectweb.asm.commons.GeneratorAdapter writer)
      Write the string switch implementation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringSwitchWriter

        public StringSwitchWriter()
    • Method Detail

      • getKeys

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

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

        protected abstract void onMatch​(java.lang.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,
                                         java.lang.String string,
                                         org.objectweb.asm.Label end)
        Generate the switch case.
        Parameters:
        writer - The writer
        string - The string matched
        end - The end label