Package org.bytedeco.javacpp.tools
Class Info
- java.lang.Object
-
- org.bytedeco.javacpp.tools.Info
-
public class Info extends java.lang.ObjectHolds information useful to theParserand associated with C++ identifiers. Info objects are meant to be added by the user to anInfoMappassed as argument toInfoMapper.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
Fields Modifier and Type Field Description (package private) java.lang.String[]annotationsAdditional Java annotations that should prefix the identifiers on output.(package private) java.lang.StringbaseAllows to override the base class ofpointerTypes.(package private) booleanbeanifyAdds JavaBeans-style prefixes to getters and setters of public data members of a class(package private) booleancast(package private) java.lang.String[]cppNamesA list of C++ identifiers, expressions, or header filenames to which this info is to be bound.(package private) java.lang.StringcppTextReplaces the code associated with the declaration of C++ identifiers, before parsing.(package private) java.lang.String[]cppTypesA list of C++ types to supply to or substitute from macros, templates, typedefs, etc.(package private) booleandefineIndicates expressions of conditional macro groups to parse, or templates to specialize.(package private) booleanenumerateMaps native C++enumclasses to Javaenumtypes, along with methods using them.(package private) booleanflattenOutputs declarations for this class into their subclasses as well.(package private) booleanfriendlyMaps friend functions.(package private) booleanimmutableDisables generation of setters for public data members of a class(package private) java.lang.String[]javaNamesThe Java identifiers to output corresponding to the C++ identifiers ofcppNames.(package private) java.lang.StringjavaTextOutputs the given code, instead of the result parsed from the declaration of C++ identifiers.(package private) java.lang.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 ifskipis true).(package private) booleanobjectifyMap global functions to instance methods, withoutstaticmodifier, to implement an interface, etc.(package private) java.lang.String[]pointerTypesA list of (usually)PointerJava subclasses to be used to map C++ pointer types.(package private) booleanpurifyForces a class to be treated as if it were abstract.(package private) booleanskipSkips entirely all the code associated with the C++ identifiers, expressions, or header filenames.(package private) booleanskipDefaultsIgnores default type constructors and default function arguments to avoid ambiguous C++ function calls.(package private) booleantranslateAttempts to translate naively the statements of variable-like macros to Java.(package private) booleanupcastWhether a static_cast is needed to upcast a pointer to this cppName.(package private) java.lang.String[]valueTypesA list of (usually) primitive Java types to be used to map C++ value types.(package private) booleanvirtualizeAnnotates virtual functions with @Virtualand adds appropriate constructors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Infoannotations(java.lang.String... annotations)Infobase(java.lang.String base)Infobeanify()Infobeanify(boolean beanify)Infocast()Infocast(boolean cast)InfocppNames(java.lang.String... cppNames)InfocppText(java.lang.String cppText)InfocppTypes(java.lang.String... cppTypes)Infodefine()Infodefine(boolean define)Infoenumerate()Infoenumerate(boolean enumerate)Infoflatten()Infoflatten(boolean flatten)Infofriendly()Infofriendly(boolean friendly)Infoimmutable()Infoimmutable(boolean immutable)InfojavaNames(java.lang.String... javaNames)InfojavaText(java.lang.String javaText)InfolinePatterns(java.lang.String... linePatterns)Infoobjectify()Infoobjectify(boolean objectify)InfopointerTypes(java.lang.String... pointerTypes)Infopurify()Infopurify(boolean purify)Infoskip()Infoskip(boolean skip)InfoskipDefaults()InfoskipDefaults(boolean skipDefaults)Infotranslate()Infotranslate(boolean translate)Infoupcast()Infoupcast(boolean upcast)InfovalueTypes(java.lang.String... valueTypes)Infovirtualize()Infovirtualize(boolean virtualize)
-
-
-
Field Detail
-
cppNames
java.lang.String[] cppNames
A 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
java.lang.String[] javaNames
-
annotations
java.lang.String[] annotations
Additional Java annotations that should prefix the identifiers on output.
-
cppTypes
java.lang.String[] cppTypes
A 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
java.lang.String[] valueTypes
A list of (usually) primitive Java types to be used to map C++ value types. By default,pointerTypesprefixed with @ByValare used.
-
pointerTypes
java.lang.String[] pointerTypes
-
linePatterns
java.lang.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 ifskipis true).
-
cast
boolean cast
-
define
boolean define
Indicates expressions of conditional macro groups to parse, or templates to specialize.
-
enumerate
boolean enumerate
Maps native C++enumclasses to Javaenumtypes, along with methods using them. To use as keys in maps, etc, intern() must be called on instances returned from native code.
-
flatten
boolean flatten
Outputs declarations for this class into their subclasses as well. Also adds methods for upcasting, as done for multiple inheritance by default.
-
friendly
boolean friendly
Maps 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 immutable
Disables generation of setters for public data members of a class
-
beanify
boolean beanify
Adds JavaBeans-style prefixes to getters and setters of public data members of a class
-
objectify
boolean objectify
Map global functions to instance methods, withoutstaticmodifier, to implement an interface, etc.
-
translate
boolean translate
Attempts to translate naively the statements of variable-like macros to Java.
-
skip
boolean skip
Skips entirely all the code associated with the C++ identifiers, expressions, or header filenames. Unless moreInfois provided...
-
skipDefaults
boolean skipDefaults
Ignores default type constructors and default function arguments to avoid ambiguous C++ function calls.
-
purify
boolean purify
Forces a class to be treated as if it were abstract.
-
upcast
boolean upcast
Whether 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 virtualize
Annotates virtual functions with @Virtualand adds appropriate constructors.
-
base
java.lang.String base
Allows to override the base class ofpointerTypes. Defaults toPointer.
-
cppText
java.lang.String cppText
Replaces the code associated with the declaration of C++ identifiers, before parsing.
-
javaText
java.lang.String javaText
Outputs the given code, instead of the result parsed from the declaration of C++ identifiers.
-
-
Constructor Detail
-
Info
public Info()
-
Info
public Info(java.lang.String... cppNames)
-
Info
public Info(Info i)
-
-
Method Detail
-
cppNames
public Info cppNames(java.lang.String... cppNames)
-
javaNames
public Info javaNames(java.lang.String... javaNames)
-
annotations
public Info annotations(java.lang.String... annotations)
-
cppTypes
public Info cppTypes(java.lang.String... cppTypes)
-
valueTypes
public Info valueTypes(java.lang.String... valueTypes)
-
pointerTypes
public Info pointerTypes(java.lang.String... pointerTypes)
-
linePatterns
public Info linePatterns(java.lang.String... linePatterns)
-
cast
public Info cast()
-
cast
public Info cast(boolean cast)
-
define
public Info define()
-
define
public Info define(boolean define)
-
enumerate
public Info enumerate()
-
enumerate
public Info enumerate(boolean enumerate)
-
flatten
public Info flatten()
-
flatten
public Info flatten(boolean flatten)
-
friendly
public Info friendly()
-
friendly
public Info friendly(boolean friendly)
-
immutable
public Info immutable()
-
immutable
public Info immutable(boolean immutable)
-
beanify
public Info beanify()
-
beanify
public Info beanify(boolean beanify)
-
objectify
public Info objectify()
-
objectify
public Info objectify(boolean objectify)
-
translate
public Info translate()
-
translate
public Info translate(boolean translate)
-
skip
public Info skip()
-
skip
public Info skip(boolean skip)
-
skipDefaults
public Info skipDefaults()
-
skipDefaults
public Info skipDefaults(boolean skipDefaults)
-
purify
public Info purify()
-
purify
public Info purify(boolean purify)
-
upcast
public Info upcast()
-
upcast
public Info upcast(boolean upcast)
-
virtualize
public Info virtualize()
-
virtualize
public Info virtualize(boolean virtualize)
-
base
public Info base(java.lang.String base)
-
cppText
public Info cppText(java.lang.String cppText)
-
javaText
public Info javaText(java.lang.String javaText)
-
-