Class Info


  • public class Info
    extends java.lang.Object
    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

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.String[] annotations
      Additional Java annotations that should prefix the identifiers on output.
      (package private) java.lang.String base
      Allows to override the base class of pointerTypes.
      (package private) boolean beanify
      Adds JavaBeans-style prefixes to getters and setters of public data members of a class
      (package private) boolean cast
      Annotates Java identifiers with @Cast containing C++ identifier names cppNames.
      (package private) java.lang.String[] cppNames
      A list of C++ identifiers, expressions, or header filenames to which this info is to be bound.
      (package private) java.lang.String cppText
      Replaces the code associated with the declaration of C++ identifiers, before parsing.
      (package private) java.lang.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) boolean friendly
      Maps friend functions.
      (package private) boolean immutable
      Disables generation of setters for public data members of a class
      (package private) java.lang.String[] javaNames
      The Java identifiers to output corresponding to the C++ identifiers of cppNames.
      (package private) java.lang.String javaText
      Outputs the given code, instead of the result parsed from the declaration of C++ identifiers.
      (package private) 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 if skip is true).
      (package private) boolean objectify
      Map global functions to instance methods, without static modifier, to implement an interface, etc.
      (package private) java.lang.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 type constructors and 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) boolean upcast
      Whether a static_cast is needed to upcast a pointer to this cppName.
      (package private) java.lang.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 Summary

      Constructors 
      Constructor Description
      Info()  
      Info​(java.lang.String... cppNames)  
      Info​(Info i)  
    • 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 of Info(String...).
      • javaNames

        java.lang.String[] javaNames
        The Java identifiers to output corresponding to the C++ identifiers of cppNames. By default, the names of C++ identifiers cppNames are used.
      • 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, pointerTypes prefixed with @ByVal are used.
      • pointerTypes

        java.lang.String[] pointerTypes
        A list of (usually) Pointer Java subclasses to be used to map C++ pointer types. By default, the names of the C++ types cppNames are used.
      • 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 if skip is true).
      • cast

        boolean cast
        Annotates Java identifiers with @Cast containing C++ identifier names cppNames.
      • define

        boolean define
        Indicates expressions of conditional macro groups to parse, or templates to specialize.
      • enumerate

        boolean enumerate
        Maps native C++ 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.
      • 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, without static modifier, 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 more Info is 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 @Virtual and adds appropriate constructors.
      • base

        java.lang.String base
        Allows to override the base class of pointerTypes. Defaults to Pointer.
      • 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)