001 /******************************************************************************* 002 * Copyright (C) 2009-2011 FuseSource Corp. 003 * Copyright (c) 2000, 2008 IBM Corporation and others. 004 * 005 * All rights reserved. This program and the accompanying materials 006 * are made available under the terms of the Eclipse Public License v1.0 007 * which accompanies this distribution, and is available at 008 * http://www.eclipse.org/legal/epl-v10.html 009 *******************************************************************************/ 010 package org.fusesource.hawtjni.runtime; 011 012 /** 013 * 014 * @author <a href="http://hiramchirino.com">Hiram Chirino</a> 015 */ 016 public enum MethodFlag { 017 /** 018 * Indicate that the item should not be generated. For example, 019 * custom natives are coded by hand. 020 */ 021 METHOD_SKIP, 022 023 /** 024 * Indicate that a native method should be looked up dynamically. It 025 * is useful when having a dependence on a given library is not 026 * desirable. The library name is specified in the *_custom.h file. 027 */ 028 DYNAMIC, 029 030 /** 031 * Indicate that the native method represents a constant or global 032 * variable instead of a function. This omits () from the generated 033 * code. 034 */ 035 CONSTANT_GETTER, 036 037 /** 038 * Indicate that the C function should be casted to a prototype 039 * generated from the parameters of the native method. Useful for 040 * variable argument C functions. 041 */ 042 CAST, 043 044 /** 045 * Indicate that the native is part of the Java Native Interface. For 046 * example: NewGlobalRef(). 047 */ 048 JNI, 049 050 /** 051 * Indicate that the native method represents a structure global 052 * variable and the address of it should be returned to Java. This is 053 * done by prepending &. 054 */ 055 ADDRESS, 056 057 /** 058 * Indicate that the native method is calling a C++ object's method. 059 */ 060 CPP_METHOD, 061 062 /** 063 * Indicate that the native method is a C++ constructor that allocates 064 * an object on the heap. 065 */ 066 CPP_NEW, 067 068 /** 069 * Indicate that the native method is a C++ destructor that 070 * deallocates an object from the heap. 071 */ 072 CPP_DELETE, 073 074 /** 075 * Indicate that the native method is a C# constructor that allocates 076 * an object on the managed (i.e. garbage collected) heap. 077 */ 078 CS_NEW, 079 080 /** 081 * Indicate that the native method's return value is a 082 * C# managed object. 083 */ 084 CS_OBJECT, 085 086 /** 087 * Indicate that the native method represents a setter for a field in 088 * an object or structure 089 */ 090 SETTER, 091 092 /** 093 * Indicate that the native method represents a getter for a field in 094 * an object or structure. 095 */ 096 GETTER, 097 098 /** 099 * Indicate that the native method takes 2 arguments, a collection and 100 * an item, and the += operator is used to add the item to the 101 * collection. 102 */ 103 ADDER, 104 105 /** 106 * Indicate that the return value is a pointer. 107 */ 108 POINTER_RETURN, 109 110 /** 111 * Indicate that this method will be the constant initializer for 112 * the class. When called, it will set all the static constant fields 113 * to the values defined in your platform. 114 */ 115 CONSTANT_INITIALIZER, 116 }