public class Generator extends Object
When attempting to understand what the Generator does, try to run experiments and inspect the generated code: It is quite readable.
Moreover, although Generator is the one ultimately doing something with the various annotations it relies on, it was easier to describe the behavior its meant to have with them as part of the documentation of the annotations, so we can refer to them to understand more about how Generator should work:
Adapter
,
Allocator
,
ArrayAllocator
,
ByPtr
,
ByPtrPtr
,
ByPtrRef
,
ByRef
,
ByVal
,
Cast
,
Const
,
Convention
,
CriticalRegion
,
Function
,
Index
,
MemberGetter
,
MemberSetter
,
Name
,
Namespace
,
NoDeallocator
,
NoException
,
NoOffset
,
Opaque
,
Platform
,
Raw
,
ValueGetter
,
ValueSetter
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Generator.BooleanEnum |
(package private) static class |
Generator.ByteEnum |
(package private) static class |
Generator.IntEnum |
(package private) static class |
Generator.LongEnum |
(package private) static class |
Generator.ShortEnum |
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
accessesEnums |
(package private) Map<Method,MethodInformation> |
annotationCache |
(package private) IndexedSet<Class> |
arrayDeallocators |
(package private) static List<Class> |
baseClasses |
(package private) Map<String,String> |
callbacks |
(package private) IndexedSet<Class> |
deallocators |
(package private) String |
encoding |
(package private) IndexedSet<Class> |
functions |
(package private) IndexedSet<Class> |
jclasses |
(package private) static String |
JNI_VERSION |
(package private) Logger |
logger |
(package private) boolean |
mayThrowExceptions |
(package private) Map<Class,Set<String>> |
members |
(package private) PrintWriter |
out |
(package private) PrintWriter |
out2 |
(package private) boolean |
passesStrings |
(package private) Properties |
properties |
(package private) boolean |
usesAdapters |
(package private) Map<Class,Set<String>> |
virtualFunctions |
(package private) Map<Class,Set<String>> |
virtualMembers |
Constructor and Description |
---|
Generator(Logger logger,
Properties properties) |
Generator(Logger logger,
Properties properties,
String encoding) |
Modifier and Type | Method and Description |
---|---|
(package private) AdapterInformation |
adapterInformation(boolean out,
MethodInformation methodInfo,
int j) |
(package private) AdapterInformation |
adapterInformation(boolean out,
String valueTypeName,
Annotation... annotations) |
(package private) static int |
allocatorMax(Class<?> cls,
Method method) |
(package private) Annotation |
behavior(Annotation... annotations) |
(package private) Annotation |
by(Annotation... annotations) |
(package private) Annotation |
by(MethodInformation methodInfo,
int j) |
(package private) void |
call(MethodInformation methodInfo,
String returnPrefix,
boolean secondCall) |
(package private) void |
callback(Class<?> cls,
Method callbackMethod,
String callbackName,
int allocatorMax,
boolean needDefinition,
MethodInformation methodInfo) |
(package private) void |
callbackAllocator(Class<?> cls,
String callbackName,
int allocatorMax) |
(package private) String |
cast(Class<?> type,
Annotation... annotations) |
(package private) String |
cast(MethodInformation methodInfo,
int j) |
(package private) boolean |
classes(boolean handleExceptions,
boolean defineAdapters,
boolean convertStrings,
boolean declareEnums,
String loadSuffix,
String baseLoadSuffix,
String classPath,
Class<?>... classes) |
(package private) static boolean |
constFunction(Class<?> classType,
Method functionMethod) |
(package private) static String |
constValueTypeName(String... typeName) |
(package private) String[] |
cppAnnotationTypeName(Class<?> type,
Annotation... annotations) |
(package private) String[] |
cppCastTypeName(Class<?> type,
Annotation... annotations) |
(package private) String[] |
cppFunctionTypeName(Method... functionMethods) |
(package private) static String |
cppScopeName(Class<?> type) |
(package private) static String |
cppScopeName(MethodInformation methodInfo) |
(package private) String[] |
cppTypeName(Class<?> type) |
(package private) static boolean |
criticalRegion(Class<?> cls,
Method method) |
(package private) String |
enumValueType(Class<?> type) |
(package private) static String |
functionClassName(Class<?> cls) |
(package private) static Method[] |
functionMethods(Class<?> cls,
boolean[] callbackAllocators) |
boolean |
generate(String sourceFilename,
String headerFilename,
String loadSuffix,
String baseLoadSuffix,
String classPath,
Class<?>... classes) |
(package private) static String |
jniTypeName(Class type) |
(package private) static String |
mangle(String name) |
(package private) MethodInformation |
methodInformation(Method method) |
(package private) boolean |
methods(Class<?> cls) |
(package private) static boolean |
noException(Class<?> cls,
Method method) |
(package private) void |
parametersAfter(MethodInformation methodInfo) |
(package private) void |
parametersBefore(MethodInformation methodInfo) |
(package private) void |
returnAfter(MethodInformation methodInfo) |
(package private) String |
returnBefore(MethodInformation methodInfo) |
(package private) static String |
signature(Class... types) |
(package private) static String |
valueTypeName(String... typeName) |
static final String JNI_VERSION
final Logger logger
final Properties properties
final String encoding
PrintWriter out
PrintWriter out2
IndexedSet<Class> functions
IndexedSet<Class> deallocators
IndexedSet<Class> arrayDeallocators
IndexedSet<Class> jclasses
Map<Method,MethodInformation> annotationCache
boolean mayThrowExceptions
boolean usesAdapters
boolean passesStrings
boolean accessesEnums
public Generator(Logger logger, Properties properties)
public Generator(Logger logger, Properties properties, String encoding)
public boolean generate(String sourceFilename, String headerFilename, String loadSuffix, String baseLoadSuffix, String classPath, Class<?>... classes) throws IOException
IOException
boolean classes(boolean handleExceptions, boolean defineAdapters, boolean convertStrings, boolean declareEnums, String loadSuffix, String baseLoadSuffix, String classPath, Class<?>... classes)
boolean methods(Class<?> cls)
void parametersBefore(MethodInformation methodInfo)
String returnBefore(MethodInformation methodInfo)
void call(MethodInformation methodInfo, String returnPrefix, boolean secondCall)
void returnAfter(MethodInformation methodInfo)
void parametersAfter(MethodInformation methodInfo)
void callback(Class<?> cls, Method callbackMethod, String callbackName, int allocatorMax, boolean needDefinition, MethodInformation methodInfo)
MethodInformation methodInformation(Method method)
AdapterInformation adapterInformation(boolean out, MethodInformation methodInfo, int j)
AdapterInformation adapterInformation(boolean out, String valueTypeName, Annotation... annotations)
String cast(MethodInformation methodInfo, int j)
String cast(Class<?> type, Annotation... annotations)
Annotation by(MethodInformation methodInfo, int j)
Annotation by(Annotation... annotations)
Annotation behavior(Annotation... annotations)
String[] cppAnnotationTypeName(Class<?> type, Annotation... annotations)
String[] cppCastTypeName(Class<?> type, Annotation... annotations)
static String cppScopeName(MethodInformation methodInfo)
Copyright © 2020. All rights reserved.