org.excel4j.reflect
Class ReflectAddin

java.lang.Object
  extended by org.excel4j.reflect.ReflectAddin
All Implemented Interfaces:
Addin
Direct Known Subclasses:
CSVAddin

public class ReflectAddin
extends java.lang.Object
implements Addin

An addin implementation that uses reflection to expose functions.


Field Summary
protected  XLObjectConverter argMapper
           
protected  java.util.Map attributes
           
protected  ParameterNameExtractor pne
           
 
Constructor Summary
ReflectAddin()
          Creates a new ReflectAddin object.
ReflectAddin(XLObjectConverter mapper)
          Creates a new ReflectAddin object.
 
Method Summary
 void close()
          Called on shutdown.
protected  java.lang.String getAddinCategory()
          Returns the addin category.
protected  FunctionAttributes getAttributes(java.lang.reflect.Method method)
          Returns the function attributes for a given method.
protected  FunctionAttributes getAttributes(java.lang.String methodName)
          Returns the function attributes for a given method name (returns the first method with the given name).
 Function[] getFunctions()
          Get the functions.
 java.lang.String getLongName()
          Get the addin name.
 java.lang.String getName()
          Get the addin (short) name.
 void open()
          Called on startup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

argMapper

protected XLObjectConverter argMapper

attributes

protected java.util.Map attributes

pne

protected ParameterNameExtractor pne
Constructor Detail

ReflectAddin

public ReflectAddin()
Creates a new ReflectAddin object.


ReflectAddin

public ReflectAddin(XLObjectConverter mapper)
Creates a new ReflectAddin object.

Parameters:
mapper. -
Method Detail

getFunctions

public Function[] getFunctions()
Description copied from interface: Addin
Get the functions.

Specified by:
getFunctions in interface Addin
Returns:
Function[].

getLongName

public java.lang.String getLongName()
Description copied from interface: Addin
Get the addin name.

Specified by:
getLongName in interface Addin
Returns:
String.

getName

public java.lang.String getName()
Description copied from interface: Addin
Get the addin (short) name.

Specified by:
getName in interface Addin
Returns:
String.

getAddinCategory

protected java.lang.String getAddinCategory()
Returns the addin category. This can be overridden by subclasses to provide more information.

Returns:
String.

getAttributes

protected FunctionAttributes getAttributes(java.lang.reflect.Method method)
Returns the function attributes for a given method.

Parameters:
method. -
Returns:
FunctionAttributes.

getAttributes

protected FunctionAttributes getAttributes(java.lang.String methodName)
Returns the function attributes for a given method name (returns the first method with the given name).

Parameters:
methodName. -
Returns:
FunctionAttributes.

close

public void close()
Description copied from interface: Addin
Called on shutdown.

Specified by:
close in interface Addin

open

public void open()
Description copied from interface: Addin
Called on startup.

Specified by:
open in interface Addin