public class Generator extends Object implements Closeable
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
,
Function
,
Index
,
MemberGetter
,
MemberSetter
,
Name
,
Namespace
,
NoDeallocator
,
NoException
,
NoOffset
,
Opaque
,
Platform
,
Raw
,
ValueGetter
,
ValueSetter
Modifier and Type | Field and Description |
---|---|
(package private) Map<Method,MethodInformation> |
annotationCache |
(package private) IndexedSet<Class> |
arrayDeallocators |
(package private) static List<Class> |
baseClasses |
(package private) IndexedSet<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) ClassProperties |
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,
ClassProperties properties) |
Generator(Logger logger,
ClassProperties 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) 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,
boolean needDefinition,
MethodInformation methodInfo) |
(package private) void |
callbackAllocator(Class cls,
String callbackName) |
(package private) String |
cast(Class<?> type,
Annotation... annotations) |
(package private) String |
cast(MethodInformation methodInfo,
int j) |
(package private) boolean |
checkPlatform(Class<?> cls) |
(package private) boolean |
checkPlatform(Platform platform,
String[] defaultNames) |
(package private) boolean |
classes(boolean handleExceptions,
boolean defineAdapters,
boolean convertStrings,
String classPath,
Class<?>... classes) |
void |
close() |
(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 String |
functionClassName(Class<?> cls) |
(package private) static Method[] |
functionMethods(Class<?> cls,
boolean[] callbackAllocators) |
boolean |
generate(String sourceFilename,
String headerFilename,
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 ClassProperties properties
final String encoding
PrintWriter out
PrintWriter out2
IndexedSet<String> callbacks
IndexedSet<Class> functions
IndexedSet<Class> deallocators
IndexedSet<Class> arrayDeallocators
IndexedSet<Class> jclasses
Map<Method,MethodInformation> annotationCache
boolean mayThrowExceptions
boolean usesAdapters
boolean passesStrings
public Generator(Logger logger, ClassProperties properties)
public Generator(Logger logger, ClassProperties properties, String encoding)
public boolean generate(String sourceFilename, String headerFilename, String classPath, Class<?>... classes) throws IOException
IOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
boolean classes(boolean handleExceptions, boolean defineAdapters, boolean convertStrings, 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, boolean needDefinition, MethodInformation methodInfo)
boolean checkPlatform(Class<?> cls)
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 © 2017. All rights reserved.