Class ElementReflectionUtils

java.lang.Object
dev.getelements.elements.sdk.util.reflection.ElementReflectionUtils

public class ElementReflectionUtils extends Object
Some basic utilities for accessing reflections within SDK code.
  • Constructor Details

    • ElementReflectionUtils

      public ElementReflectionUtils()
  • Method Details

    • getInstance

      public static ElementReflectionUtils getInstance()
      Gets the static shared instance.
      Returns:
      the ElementReflectionUtils
    • getPackageInfo

      public Class<?> getPackageInfo(String name)
      Gets the package-info Class for the supplied package name.
      Parameters:
      name - the package name
      Returns:
      the Package
    • getPackageInfo

      public Class<?> getPackageInfo(String name, ClassLoader classLoader)
      Gets the package-info Class for the supplied package name.
      Parameters:
      name - the package name
      classLoader - the ClassLoader to use
      Returns:
      the Package
    • getPackageForElementsAnnotations

      public Package getPackageForElementsAnnotations(String name)
      Gets the Package from the package-info class.
      Parameters:
      name - the package name
      Returns:
      the Package
    • getPackageForElementsAnnotations

      public Package getPackageForElementsAnnotations(String name, ClassLoader classLoader)
      Gets the Package from the package-info class.
      Parameters:
      name - the package name
      classLoader - the ClassLoader to use
      Returns:
      the Package