java.lang.Object
kala.compress.harmony.pack200.PackingOptions

public class PackingOptions extends Object
Manages the various options available for pack200.
  • Field Details

    • EMPTY_ATTRIBUTE_ARRAY

      private static final org.objectweb.asm.Attribute[] EMPTY_ATTRIBUTE_ARRAY
    • SEGMENT_LIMIT

      public static final long SEGMENT_LIMIT
      See Also:
    • STRIP

      public static final String STRIP
      See Also:
    • ERROR

      public static final String ERROR
      See Also:
    • PASS

      public static final String PASS
      See Also:
    • KEEP

      public static final String KEEP
      See Also:
    • gzip

      private boolean gzip
    • stripDebug

      private boolean stripDebug
    • keepFileOrder

      private boolean keepFileOrder
    • segmentLimit

      private long segmentLimit
    • effort

      private int effort
    • deflateHint

      private String deflateHint
    • modificationTime

      private String modificationTime
    • passFiles

      private final List<String> passFiles
    • unknownAttributeAction

      private String unknownAttributeAction
    • classAttributeActions

      private final Map<String,String> classAttributeActions
    • fieldAttributeActions

      private final Map<String,String> fieldAttributeActions
    • methodAttributeActions

      private final Map<String,String> methodAttributeActions
    • codeAttributeActions

      private final Map<String,String> codeAttributeActions
    • verbose

      private boolean verbose
    • logFile

      private String logFile
    • unknownAttributeTypes

      private org.objectweb.asm.Attribute[] unknownAttributeTypes
  • Constructor Details

    • PackingOptions

      public PackingOptions()
  • Method Details

    • addClassAttributeAction

      public void addClassAttributeAction(String attributeName, String action)
    • addCodeAttributeAction

      public void addCodeAttributeAction(String attributeName, String action)
    • addFieldAttributeAction

      public void addFieldAttributeAction(String attributeName, String action)
    • addMethodAttributeAction

      public void addMethodAttributeAction(String attributeName, String action)
    • addOrUpdateAttributeActions

      private void addOrUpdateAttributeActions(List<org.objectweb.asm.Attribute> prototypes, Map<String,String> attributeActions, int tag)
    • addPassFile

      public void addPassFile(String passFileName)
      Tell the compressor to pass the file with the given name, or if the name is a directory name all files under that directory will be passed.
      Parameters:
      passFileName - the file name
    • getDeflateHint

      public String getDeflateHint()
    • getEffort

      public int getEffort()
    • getLogFile

      public String getLogFile()
    • getModificationTime

      public String getModificationTime()
    • getOrDefault

      private String getOrDefault(Map<String,String> map, String type, String defaultValue)
    • getSegmentLimit

      public long getSegmentLimit()
    • getUnknownAttributeAction

      public String getUnknownAttributeAction()
    • getUnknownAttributePrototypes

      public org.objectweb.asm.Attribute[] getUnknownAttributePrototypes()
    • getUnknownClassAttributeAction

      public String getUnknownClassAttributeAction(String type)
    • getUnknownCodeAttributeAction

      public String getUnknownCodeAttributeAction(String type)
    • getUnknownFieldAttributeAction

      public String getUnknownFieldAttributeAction(String type)
    • getUnknownMethodAttributeAction

      public String getUnknownMethodAttributeAction(String type)
    • isGzip

      public boolean isGzip()
    • isKeepDeflateHint

      public boolean isKeepDeflateHint()
    • isKeepFileOrder

      public boolean isKeepFileOrder()
    • isPassFile

      public boolean isPassFile(String passFileName)
    • isStripDebug

      public boolean isStripDebug()
    • isVerbose

      public boolean isVerbose()
    • removePassFile

      public void removePassFile(String passFileName)
    • setDeflateHint

      public void setDeflateHint(String deflateHint)
    • setEffort

      public void setEffort(int effort)
      Sets the compression effort level (0-9, equivalent to -E command line option)
      Parameters:
      effort - the compression effort level, 0-9.
    • setGzip

      public void setGzip(boolean gzip)
    • setKeepFileOrder

      public void setKeepFileOrder(boolean keepFileOrder)
    • setLogFile

      public void setLogFile(String logFile)
    • setModificationTime

      public void setModificationTime(String modificationTime)
    • setQuiet

      public void setQuiet(boolean quiet)
    • setSegmentLimit

      public void setSegmentLimit(long segmentLimit)
      Sets the segment limit (equivalent to -S command line option)
      Parameters:
      segmentLimit - the limit in bytes
    • setStripDebug

      public void setStripDebug(boolean stripDebug)
      Sets strip debug attributes. If true, all debug attributes (i.e. LineNumberTable, SourceFile, LocalVariableTable and LocalVariableTypeTable attributes) are stripped when reading the input class files and not included in the output archive.
      Parameters:
      stripDebug - If true, all debug attributes.
    • setUnknownAttributeAction

      public void setUnknownAttributeAction(String unknownAttributeAction)
      Sets the compressor behavior when an unknown attribute is encountered.
      Parameters:
      unknownAttributeAction - the action to perform
    • setVerbose

      public void setVerbose(boolean verbose)