public class Info extends Object
Parser
and associated with C++ identifiers.
Info objects are meant to be added by the user to an InfoMap
passed as
argument to InfoMapper.map(InfoMap)
. A class inheriting from the latter
becomes a kind of configuration file entirely written in Java.
For usage examples, one can refer to the source code of the default values defined
in the initializer of InfoMap.defaults
.
Modifier and Type | Field and Description |
---|---|
(package private) String[] |
annotations
Additional Java annotations that should prefix the identifiers on output.
|
(package private) String |
base
Allows to override the base class of
pointerTypes . |
(package private) boolean |
cast
|
(package private) String[] |
cppNames
A list of C++ identifiers, expressions, or header filenames to which this info is to be bound.
|
(package private) String |
cppText
Replaces the code associated with the declaration of C++ identifiers, before parsing.
|
(package private) String[] |
cppTypes
A list of C++ types to supply to or substitute from macros, templates, typedefs, etc.
|
(package private) boolean |
define
Indicates expressions of conditional macro groups to parse, or templates to specialize.
|
(package private) boolean |
enumerate
Maps native C++
enum classes to Java enum types, along with methods using them. |
(package private) boolean |
flatten
Outputs declarations for this class into their subclasses as well.
|
(package private) String[] |
javaNames
The Java identifiers to output corresponding to the C++ identifiers of
cppNames . |
(package private) String |
javaText
Outputs the given code, instead of the result parsed from the declaration of C++ identifiers.
|
(package private) String[] |
linePatterns
A list of regular expressions (start1, end1, start2, end2, ...) that are matched against lines
in header files, where only the ones in between each pair are parsed (or not if
skip is true). |
(package private) boolean |
objectify
Map global functions to instance methods, without
static modifier, to implement an interface, etc. |
(package private) String[] |
pointerTypes
A list of (usually)
Pointer Java subclasses to be used to map C++ pointer types. |
(package private) boolean |
purify
Forces a class to be treated as if it were abstract.
|
(package private) boolean |
skip
Skips entirely all the code associated with the C++ identifiers, expressions, or header filenames.
|
(package private) boolean |
skipDefaults
Ignores default function arguments to avoid ambiguous C++ function calls.
|
(package private) boolean |
translate
Attempts to translate naively the statements of variable-like macros to Java.
|
(package private) String[] |
valueTypes
A list of (usually) primitive Java types to be used to map C++ value types.
|
(package private) boolean |
virtualize
Annotates virtual functions with @
Virtual and adds appropriate constructors. |
Constructor and Description |
---|
Info() |
Info(Info i) |
Info(String... cppNames) |
Modifier and Type | Method and Description |
---|---|
Info |
annotations(String... annotations) |
Info |
base(String base) |
Info |
cast() |
Info |
cast(boolean cast) |
Info |
cppNames(String... cppNames) |
Info |
cppText(String cppText) |
Info |
cppTypes(String... cppTypes) |
Info |
define() |
Info |
define(boolean define) |
Info |
enumerate() |
Info |
enumerate(boolean enumerate) |
Info |
flatten() |
Info |
flatten(boolean flatten) |
Info |
javaNames(String... javaNames) |
Info |
javaText(String javaText) |
Info |
linePatterns(String... linePatterns) |
Info |
objectify() |
Info |
objectify(boolean objectify) |
Info |
pointerTypes(String... pointerTypes) |
Info |
purify() |
Info |
purify(boolean purify) |
Info |
skip() |
Info |
skip(boolean skip) |
Info |
skipDefaults() |
Info |
skipDefaults(boolean skipDefaults) |
Info |
translate() |
Info |
translate(boolean translate) |
Info |
valueTypes(String... valueTypes) |
Info |
virtualize() |
Info |
virtualize(boolean virtualize) |
String[] cppNames
Info(String...)
.String[] javaNames
String[] annotations
String[] cppTypes
String[] valueTypes
pointerTypes
prefixed with @ByVal
are used.String[] pointerTypes
String[] linePatterns
skip
is true).boolean cast
boolean define
boolean enumerate
enum
classes to Java enum
types, along with methods using them.
To use as keys in maps, etc, intern() must be called on instances returned from native code.boolean flatten
boolean objectify
static
modifier, to implement an interface, etc.boolean translate
boolean skip
Info
is provided...boolean skipDefaults
boolean purify
boolean virtualize
Virtual
and adds appropriate constructors.String base
pointerTypes
. Defaults to Pointer
.String cppText
String javaText
public Info cast()
public Info cast(boolean cast)
public Info define()
public Info define(boolean define)
public Info enumerate()
public Info enumerate(boolean enumerate)
public Info flatten()
public Info flatten(boolean flatten)
public Info objectify()
public Info objectify(boolean objectify)
public Info translate()
public Info translate(boolean translate)
public Info skip()
public Info skip(boolean skip)
public Info skipDefaults()
public Info skipDefaults(boolean skipDefaults)
public Info purify()
public Info purify(boolean purify)
public Info virtualize()
public Info virtualize(boolean virtualize)
Copyright © 2020. All rights reserved.