Class ClassResolver

java.lang.Object
net.covers1624.coffeegrinder.util.resolver.ClassResolver

public class ClassResolver extends Object
Created by covers1624 on 8/4/21.
  • Constructor Details

    • ClassResolver

      public ClassResolver()
  • Method Details

    • setTarget

      public void setTarget(Path target)
      Adds a resolver for a decompilation target.
      Parameters:
      target - The path to add.
      Throws:
      IllegalArgumentException - Thrown when an unknown file type is provided.
    • setTarget

      public void setTarget(Resolver resolver)
    • addResolver

      public void addResolver(Path path)
      Adds a Resolver to the list.
      Parameters:
      path - The path to add.
      Throws:
      IllegalArgumentException - Thrown when an unknown file type is provided.
    • addResolvers

      public void addResolvers(Iterable<Path> paths)
      Add all the provided paths as resolvers.
      Parameters:
      paths - The paths to add.
      Throws:
      IllegalArgumentException - Thrown when an unknown file type is provided.
    • getTargetResolver

      public Resolver getTargetResolver()
    • classExists

      public boolean classExists(String cName)
    • getBytes

      public byte @Nullable [] getBytes(String cName) throws IOException
      Throws:
      IOException
    • getClassNode

      public CachedClassNode getClassNode(String cName)
      Gets a CachedClassNode from this ClassResolver.
      Parameters:
      cName - The Class name to load.
      Returns:
      The CachedClassNode or null if the class could not be loaded.
      Throws:
      RuntimeException - If an error occurred whilst loading the class. TODO refine this throwable.
    • reset

      public void reset()