- All Known Implementing Classes:
Options.OptionValue
- Enclosing class:
Classfile
An option that affects the writing of classfiles.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic Classfile.OptionReturns an option describing attribute mappers for custom attributes.static Classfile.OptionReturns an option describing the class hierarchy resolver to use when generating stack maps.static Classfile.OptionconstantPoolSharing(boolean b) Returns an option describing whether to preserve the original constant pool when transforming a classfile.static Classfile.OptionfilterDeadLabels(boolean b) Returns an option describing whether or not to filter unresolved labels.static Classfile.OptionfixShortJumps(boolean b) Returns an option describing whether or not to automatically rewrite short jumps to long when necessary.static Classfile.OptiongenerateStackmap(boolean b) Returns an option describing whether or not to generate stackmaps.static Classfile.OptionpatchDeadCode(boolean b) Returns an option describing whether or not to patch out unreachable code.static Classfile.OptionprocessDebug(boolean b) Returns an option describing whether to process or discard debug elements.static Classfile.OptionprocessLineNumbers(boolean b) Returns an option describing whether to process or discard line numbers.static Classfile.OptionprocessUnknownAttributes(boolean b) Returns an option describing whether to process or discard unrecognized attributes.
-
Method Details
-
generateStackmap
Returns an option describing whether or not to generate stackmaps. Default is to generate stack maps.- Parameters:
b- whether to generate stack maps- Returns:
- an option describing whether or not to generate stackmaps
-
processDebug
Returns an option describing whether to process or discard debug elements. Debug elements include the local variable table, local variable type table, and character range table. Discarding debug elements may reduce the overhead of parsing or transforming classfiles. Default is to process debug elements.- Parameters:
b- whether or not to process debug elements- Returns:
- an option describing whether to process or discard debug elements
-
processLineNumbers
Returns an option describing whether to process or discard line numbers. Discarding line numbers may reduce the overhead of parsing or transforming classfiles. Default is to process line numbers.- Parameters:
b- whether or not to process line numbers- Returns:
- an option describing whether to process or discard line numbers
-
processUnknownAttributes
Returns an option describing whether to process or discard unrecognized attributes. Default is to process unrecognized attributes, and deliver as instances ofUnknownAttribute.- Parameters:
b- whether or not to process unrecognized attributes- Returns:
- an option describing whether to process or discard unrecognized attributes
-
constantPoolSharing
Returns an option describing whether to preserve the original constant pool when transforming a classfile. Reusing the constant pool enables significant optimizations in processing time and minimizes differences between the original and transformed classfile, but may result in a bigger classfile when a classfile is significantly transformed. Default is to preserve the original constant pool.- Parameters:
b- whether or not to preserve the original constant pool- Returns:
- an option describing whether to preserve the original constant pool when transforming a classfile
-
fixShortJumps
Returns an option describing whether or not to automatically rewrite short jumps to long when necessary. Default is to automatically rewrite jump instructions.- Parameters:
b- whether or not to automatically rewrite short jumps to long when necessary- Returns:
- an option describing whether or not to automatically rewrite short jumps to long when necessary
-
patchDeadCode
Returns an option describing whether or not to patch out unreachable code. Default is to automatically patch out unreachable code with NOPs.- Parameters:
b- whether or not to automatically patch out unreachable code- Returns:
- an option describing whether or not to patch out unreachable code
-
classHierarchyResolver
Returns an option describing the class hierarchy resolver to use when generating stack maps.- Parameters:
r- the resolver- Returns:
- an option describing the class hierarchy resolver to use when generating stack maps
-
attributeMapper
Returns an option describing attribute mappers for custom attributes. Default is only to process standard attributes.- Parameters:
r- a function mapping attribute names to attribute mappers- Returns:
- an option describing attribute mappers for custom attributes
-
filterDeadLabels
Returns an option describing whether or not to filter unresolved labels. Default is to throw IllegalStateException when anyExceptionCatch,LocalVariableInfo,LocalVariableTypeInfo, orCharacterRangeInforeference to unresolvedLabelduring bytecode serialization. Setting this option to true filters the above elements instead.- Parameters:
b- whether or not to automatically patch out unreachable code- Returns:
- an option describing whether or not to filter unresolved labels
-