MCPcopy Index your code
hub / github.com/beanshell/beanshell / getTypes

Method getTypes

src/bsh/Types.java:138–157  ·  view source on GitHub ↗

Get the Java types of the arguments. @param args object array of argument values. @return class array of argument types.

( Object[] args )

Source from the content-addressed store, hash-verified

136 * @param args object array of argument values.
137 * @return class array of argument types. */
138 public static Class<?>[] getTypes( Object[] args )
139 {
140 if ( args == null )
141 return new Class[0];
142
143 Class<?>[] types = new Class[ args.length ];
144
145 for( int i=0; i<args.length; i++ )
146 {
147 if ( args[i] == null )
148 types[i] = null;
149 else
150 if ( args[i] instanceof Primitive )
151 types[i] = ((Primitive)args[i]).getType();
152 else
153 types[i] = args[i].getClass();
154 }
155
156 return types;
157 }
158
159 /** Find the type of an object.
160 * @param arg the object to query.

Callers 7

getConstructorArgsMethod · 0.95
initInstanceMethod · 0.95
invokeLocalMethodMethod · 0.95
constructObjectMethod · 0.95
invokeMethodMethod · 0.95

Calls 2

getClassMethod · 0.80
getTypeMethod · 0.45

Tested by

no test coverage detected