Package org.openl.rules.runtime
Class InterfaceGenerator
- java.lang.Object
-
- org.openl.rules.runtime.InterfaceGenerator
-
public class InterfaceGenerator extends Object
The factory class that provides methods to generate interface class using methods (rules) of IOpenClass.
-
-
Field Summary
Fields Modifier and Type Field Description static StringJAVA_LANG_OBJECTstatic intPUBLIC_ABSTRACTstatic intPUBLIC_ABSTRACT_INTERFACE
-
Constructor Summary
Constructors Constructor Description InterfaceGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RuleInfocreateRuleInfo(String ruleName, Class<?>[] paramTypes, Class<?> returnType)Creates rule info using rule name, parameters types and return type.static Class<?>generateInterface(String className, RuleInfo[] rules, ClassLoader classLoader)Generates interface class using collection of rules.static Class<?>generateInterface(String className, IOpenClass openClass, ClassLoader classLoader, String[] includes, String[] excludes)Generates interface class using methods and fields of given IOpenClass instance.
-
-
-
Field Detail
-
PUBLIC_ABSTRACT_INTERFACE
public static final int PUBLIC_ABSTRACT_INTERFACE
- See Also:
- Constant Field Values
-
PUBLIC_ABSTRACT
public static final int PUBLIC_ABSTRACT
- See Also:
- Constant Field Values
-
JAVA_LANG_OBJECT
public static final String JAVA_LANG_OBJECT
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateInterface
public static Class<?> generateInterface(String className, RuleInfo[] rules, ClassLoader classLoader) throws Exception
Generates interface class using collection of rules.- Parameters:
className- name of result classrules- collection of rules what will be used as interface methodsclassLoader- class loader what will be used to load generated interface- Returns:
- generated interface
- Throws:
Exception- if an error has occurred
-
generateInterface
public static Class<?> generateInterface(String className, IOpenClass openClass, ClassLoader classLoader, String[] includes, String[] excludes) throws Exception
Generates interface class using methods and fields of given IOpenClass instance.- Throws:
Exception- if an error has occurred
-
-