Package io.micronaut.inject.writer
Class StringSwitchWriter
java.lang.Object
io.micronaut.inject.writer.StringSwitchWriter
String switch writer.
- Since:
- 3.1
- Author:
- Denis Stepanov
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Generate default statement.protected void
generateValueCase
(org.objectweb.asm.commons.GeneratorAdapter writer, String string, org.objectweb.asm.Label end) Generate the switch case.getKeys()
protected abstract void
Generate on case matches statement.protected abstract void
Push the string value that is being evaluated.void
write
(org.objectweb.asm.commons.GeneratorAdapter writer) Write the string switch implementation.
-
Constructor Details
-
StringSwitchWriter
public StringSwitchWriter()
-
-
Method Details
-
getKeys
- Returns:
- Get cases keys
-
pushStringValue
protected abstract void pushStringValue()Push the string value that is being evaluated. -
onMatch
Generate on case matches statement.- Parameters:
value
- The string that matchedend
- 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 writerstring
- The string matchedend
- The end label
-