Class AccessMap

java.lang.Object
net.md_5.specialsource.AccessMap

public class AccessMap extends Object
Access mapper - for modifying access flags on symbols Supports loading _at.cfg files in the following format:
  • comments beginning with '#' extending to end of line
  • symbol pattern, space, then access changes
Symbol pattern format:
 foo              class
 foo/bar          field
 foo/bar ()desc   method
 foo/*            fields in class
 foo/* ()desc     methods in class
 *                all classes
 */*       all fields
 */*()     all methods
 **               all classes, fields, and methods
 
Internal ('/') and source ('.') conventions are accepted, and the space preceding the method descriptor is optional. Access change format: visibility (required) + access flags
See Also:
  • Constructor Details

    • AccessMap

      public AccessMap()
  • Method Details

    • loadAccessTransformer

      public void loadAccessTransformer(BufferedReader reader) throws IOException
      Throws:
      IOException
    • loadAccessTransformer

      public void loadAccessTransformer(File file) throws IOException
      Throws:
      IOException
    • loadAccessTransformer

      public void loadAccessTransformer(String filename) throws IOException
      Load an access transformer into this AccessMap.
      Parameters:
      filename - Location of AT data, one of: - local filename - remote HTTP URL - "pattern:" followed by one transformer line
      Throws:
      IOException
    • convertSymbolPattern

      public static String convertSymbolPattern(String s)
      Convert a symbol name pattern from AT config to internal format
    • addAccessChange

      public void addAccessChange(String line)
    • addAccessChange

      public void addAccessChange(String symbolString, String accessString)
    • addAccessChange

      public void addAccessChange(String key, AccessChange accessChange)
    • applyClassAccess

      public int applyClassAccess(String className, int access)
    • applyFieldAccess

      public int applyFieldAccess(String className, String fieldName, int access)
    • applyMethodAccess

      public int applyMethodAccess(String className, String methodName, String methodDesc, int access)
    • accessApplied

      protected void accessApplied(String key, int oldAccess, int newAccess)
      Called when an access mapping is applied.
      Parameters:
      key - the key which caused the mapping to be matched and applied
      oldAccess - the access which was replaced
      newAccess - the new access which was applied by the mapping