Skip navigation links
JNA API 5.6.0
com.sun.jna

Class DefaultTypeMapper

    • Constructor Detail

      • DefaultTypeMapper

        public DefaultTypeMapper()
    • Method Detail

      • addToNativeConverter

        public void addToNativeConverter(java.lang.Class<?> cls,
                                         ToNativeConverter converter)
        Add a ToNativeConverter to define the conversion into a native type from arguments of the given Java type. Converters are checked for in the order added.
        Parameters:
        cls - Java class requiring conversion
        converter - ToNativeConverter to transform an object of the given Java class into its native-compatible form.
      • addFromNativeConverter

        public void addFromNativeConverter(java.lang.Class<?> cls,
                                           FromNativeConverter converter)
        Add a FromNativeConverter to convert a native result type into the given Java type. Converters are checked for in the order added.
        Parameters:
        cls - Java class for the Java representation of a native type.
        converter - FromNativeConverter to transform a native-compatible type into its Java equivalent.
      • addTypeConverter

        public void addTypeConverter(java.lang.Class<?> cls,
                                     TypeConverter converter)
        Add a TypeConverter to provide bidirectional mapping between a native and Java type.
        Parameters:
        cls - Java class representation for a native type
        converter - TypeConverter to translate between native and Java types.
      • getFromNativeConverter

        public FromNativeConverter getFromNativeConverter(java.lang.Class<?> javaType)
        Description copied from interface: TypeMapper
        Return the FromNativeConverter appropriate for the given Java class.
        Specified by:
        getFromNativeConverter in interface TypeMapper
        Parameters:
        javaType - Java class representation of the native type.
        Returns:
        Converter from the native-compatible type.
      • getToNativeConverter

        public ToNativeConverter getToNativeConverter(java.lang.Class<?> javaType)
        Description copied from interface: TypeMapper
        Return the ToNativeConverter appropriate for the given Java class.
        Specified by:
        getToNativeConverter in interface TypeMapper
        Parameters:
        javaType - Java class representation of the native type.
        Returns:
        Converter to the native-compatible type.
JNA API 5.6.0

Copyright © 2007-2018 Timothy Wall. All Rights Reserved.