Package io.bit3.jsass.function
Class FunctionDeclaration
- java.lang.Object
-
- io.bit3.jsass.function.FunctionDeclaration
-
public class FunctionDeclaration extends java.lang.ObjectContains all informations about a declared custom function.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ArgumentConverter>argumentConvertersList of argument converters that are used to convert the method parameter values.protected java.lang.reflect.MethodmethodThe method to call.protected java.lang.ObjectobjectThe object instance to call the method on.protected java.lang.StringsignatureThe libsass function signature.
-
Constructor Summary
Constructors Constructor Description FunctionDeclaration(ImportStack importStack, Context context, java.lang.String signature, java.lang.Object object, java.lang.reflect.Method method, java.util.List<ArgumentConverter> argumentConverters)Create a new function declaration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ArgumentConverter>getArgumentConverters()Return the list of argument converters.java.lang.reflect.MethodgetMethod()Return the method to call.java.lang.ObjectgetObject()Return the object instance to call the method on.java.lang.StringgetSignature()Return the libsass function signature.SassValueinvoke(java.util.List<?> arguments)Invoke the method with the given list of arguments.
-
-
-
Field Detail
-
signature
protected final java.lang.String signature
The libsass function signature.e.g. hello($name: "world")
-
object
protected final java.lang.Object object
The object instance to call the method on.
-
method
protected final java.lang.reflect.Method method
The method to call.
-
argumentConverters
protected final java.util.List<ArgumentConverter> argumentConverters
List of argument converters that are used to convert the method parameter values.
-
-
Constructor Detail
-
FunctionDeclaration
public FunctionDeclaration(ImportStack importStack, Context context, java.lang.String signature, java.lang.Object object, java.lang.reflect.Method method, java.util.List<ArgumentConverter> argumentConverters)
Create a new function declaration.- Parameters:
importStack- The import stack.context- The context.signature- The libsass function signature.object- The object instance to call the method on.method- The method to call.argumentConverters- List of argument converters.
-
-
Method Detail
-
getSignature
public java.lang.String getSignature()
Return the libsass function signature.- Returns:
- The libsass function signature.
-
getObject
public java.lang.Object getObject()
Return the object instance to call the method on.- Returns:
- The object instance to call the method on.
-
getMethod
public java.lang.reflect.Method getMethod()
Return the method to call.- Returns:
- The method to call.
-
getArgumentConverters
public java.util.List<ArgumentConverter> getArgumentConverters()
Return the list of argument converters.- Returns:
- List of argument converters.
-
invoke
public SassValue invoke(java.util.List<?> arguments)
Invoke the method with the given list of arguments.This will convert the libsass arguments into java value.
- Parameters:
arguments- List of libsass arguments.- Returns:
- The method result.
-
-