loci.plugins.macro

## Class MacroFunctions

- java.lang.Object
- - loci.plugins.macro.MacroFunctions

- All Implemented Interfaces:
    ij.macro.MacroExtension, ij.plugin.PlugIn
  Direct Known Subclasses:
    LociFunctions

      public class MacroFunctions
      extends java.lang.Object
      implements ij.plugin.PlugIn, ij.macro.MacroExtension

  Convenience class that simplifies implemention of ImageJ macro extensions. It uses reflection to create an extension method for each public method in the implementing subclass. See `LociFunctions` for an example.
  Author:
    Curtis Rueden ctrueden at wisc.edu

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ij.macro.ExtensionDescriptor[]` | `extensions`

    - ### Fields inherited from interface ij.macro.MacroExtension

      `ARG_ARRAY, ARG_NUMBER, ARG_OPTIONAL, ARG_OUTPUT, ARG_STRING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MacroFunctions()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected ij.macro.ExtensionDescriptor[]` | `buildExtensions()` Builds the list of extensions, using reflection, from public methods of this class.
    `ij.macro.ExtensionDescriptor[]` | `getExtensionFunctions()`
    `java.lang.String` | `handleExtension(java.lang.String name, java.lang.Object[] args)`
    `void` | `run(java.lang.String arg)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### extensions

          protected ij.macro.ExtensionDescriptor[] extensions

  - ### Constructor Detail

    - #### MacroFunctions

          public MacroFunctions()

  - ### Method Detail

    - #### run

          public void run(java.lang.String arg)

      Specified by:
        `run` in interface `ij.plugin.PlugIn`

    - #### getExtensionFunctions

          public ij.macro.ExtensionDescriptor[] getExtensionFunctions()

      Specified by:
        `getExtensionFunctions` in interface `ij.macro.MacroExtension`

    - #### handleExtension

          public java.lang.String handleExtension(java.lang.String name,
                                                  java.lang.Object[] args)

      Specified by:
        `handleExtension` in interface `ij.macro.MacroExtension`

    - #### buildExtensions

          protected ij.macro.ExtensionDescriptor[] buildExtensions()

      Builds the list of extensions, using reflection, from public methods of this class.

Copyright © 2026 Open Microscopy Environment