Package org.bytedeco.javacpp.tools
Class Info
java.lang.Object
org.bytedeco.javacpp.tools.Info
Holds information useful to the
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
.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) String[]
Additional Java annotations that should prefix the identifiers on output.(package private) String
Allows to override the base class ofpointerTypes
.(package private) boolean
Adds JavaBeans-style prefixes to getters and setters of public data members of a class(package private) boolean
(package private) String[]
A list of C++ identifiers, expressions, or header filenames to which this info is to be bound.(package private) String
Replaces the code associated with the declaration of C++ identifiers, before parsing.(package private) String[]
A list of C++ types to supply to or substitute from macros, templates, typedefs, etc.(package private) boolean
Indicates expressions of conditional macro groups to parse, or templates to specialize.(package private) boolean
Maps native C++enum
classes to Javaenum
types, along with methods using them.(package private) boolean
Outputs declarations for this class into their subclasses as well.(package private) boolean
Maps friend functions.(package private) boolean
Disables generation of setters for public data members of a class(package private) String[]
The Java identifiers to output corresponding to the C++ identifiers ofcppNames
.(package private) String
Outputs the given code, instead of the result parsed from the declaration of C++ identifiers.(package private) String[]
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 ifskip
is true).(package private) boolean
Map global functions to instance methods, withoutstatic
modifier, to implement an interface, etc.(package private) String[]
A list of (usually)Pointer
Java subclasses to be used to map C++ pointer types.(package private) boolean
Forces a class to be treated as if it were abstract.(package private) boolean
Skips entirely all the code associated with the C++ identifiers, expressions, or header filenames.(package private) boolean
Ignores default type constructors and default function arguments to avoid ambiguous C++ function calls.(package private) boolean
Attempts to translate naively the statements of variable-like macros to Java.(package private) boolean
Whether a static_cast is needed to upcast a pointer to this cppName.(package private) String[]
A list of (usually) primitive Java types to be used to map C++ value types.(package private) boolean
Annotates virtual functions with @Virtual
and adds appropriate constructors. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionannotations
(String... annotations) beanify()
beanify
(boolean beanify) cast()
cast
(boolean cast) define()
define
(boolean define) enumerate
(boolean enumerate) flatten()
flatten
(boolean flatten) friendly()
friendly
(boolean friendly) immutable
(boolean immutable) linePatterns
(String... linePatterns) objectify
(boolean objectify) pointerTypes
(String... pointerTypes) purify()
purify
(boolean purify) skip()
skip
(boolean skip) skipDefaults
(boolean skipDefaults) translate
(boolean translate) upcast()
upcast
(boolean upcast) valueTypes
(String... valueTypes) virtualize
(boolean virtualize)
-
Field Details
-
cppNames
String[] cppNamesA list of C++ identifiers, expressions, or header filenames to which this info is to be bound. Usually set via the constructor parameter ofInfo(String...)
. -
javaNames
String[] javaNames -
annotations
String[] annotationsAdditional Java annotations that should prefix the identifiers on output. -
cppTypes
String[] cppTypesA list of C++ types to supply to or substitute from macros, templates, typedefs, etc. By default, identifiers with missing type information are skipped, except for variable-like macros for which the type is guessed based on the expression. -
valueTypes
String[] valueTypesA list of (usually) primitive Java types to be used to map C++ value types. By default,pointerTypes
prefixed with @ByVal
are used. -
pointerTypes
String[] pointerTypes -
linePatterns
String[] linePatternsA 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 ifskip
is true). -
cast
boolean cast -
define
boolean defineIndicates expressions of conditional macro groups to parse, or templates to specialize. -
enumerate
boolean enumerateMaps native C++enum
classes to Javaenum
types, along with methods using them. To use as keys in maps, etc, intern() must be called on instances returned from native code. -
flatten
boolean flattenOutputs declarations for this class into their subclasses as well. Also adds methods for upcasting, as done for multiple inheritance by default. -
friendly
boolean friendlyMaps friend functions. Only functions having in their argument list an instance of the class they are friend of are currently supported. They are mapped as instance methods of the class. -
immutable
boolean immutableDisables generation of setters for public data members of a class -
beanify
boolean beanifyAdds JavaBeans-style prefixes to getters and setters of public data members of a class -
objectify
boolean objectifyMap global functions to instance methods, withoutstatic
modifier, to implement an interface, etc. -
translate
boolean translateAttempts to translate naively the statements of variable-like macros to Java. -
skip
boolean skipSkips entirely all the code associated with the C++ identifiers, expressions, or header filenames. Unless moreInfo
is provided... -
skipDefaults
boolean skipDefaultsIgnores default type constructors and default function arguments to avoid ambiguous C++ function calls. -
purify
boolean purifyForces a class to be treated as if it were abstract. -
upcast
boolean upcastWhether a static_cast is needed to upcast a pointer to this cppName. This is necessary for polymorphic classes that are virtually inherited from. -
virtualize
boolean virtualizeAnnotates virtual functions with @Virtual
and adds appropriate constructors. -
base
String baseAllows to override the base class ofpointerTypes
. Defaults toPointer
. -
cppText
String cppTextReplaces the code associated with the declaration of C++ identifiers, before parsing. -
javaText
String javaTextOutputs the given code, instead of the result parsed from the declaration of C++ identifiers.
-
-
Constructor Details
-
Info
public Info() -
Info
-
Info
-
-
Method Details
-
cppNames
-
javaNames
-
annotations
-
cppTypes
-
valueTypes
-
pointerTypes
-
linePatterns
-
cast
-
cast
-
define
-
define
-
enumerate
-
enumerate
-
flatten
-
flatten
-
friendly
-
friendly
-
immutable
-
immutable
-
beanify
-
beanify
-
objectify
-
objectify
-
translate
-
translate
-
skip
-
skip
-
skipDefaults
-
skipDefaults
-
purify
-
purify
-
upcast
-
upcast
-
virtualize
-
virtualize
-
base
-
cppText
-
javaText
-