Package com.jme3.lwjgl3.utils
Class APIUtil
java.lang.Object
com.jme3.lwjgl3.utils.APIUtil
Utility class useful to API bindings. [INTERNAL USE ONLY]
Method names in this class are prefixed with api
to avoid ambiguities
when used with static imports.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A data class for API versioning information.static interface
Simple interface for Field filtering. -
Method Summary
Modifier and TypeMethodDescriptionstatic APIBuffer
Returns a thread-localAPIBuffer
that has been reset.apiClassTokens
(APIUtil.TokenFilter filter, Map<Integer, String> target, Class<?>... tokenClasses) Returns a map of public static final integer fields in the specified classes, to their String representations.static Class<?>
apiOptionalClass
(String className) static APIUtil.APIVersion
apiParseVersion
(String version) Parses a version string.static APIUtil.APIVersion
apiParseVersion
(String version, String prefix) Parses a version string.static APIBuffer
apiStack()
Returns a thread-localAPIBuffer
, without resetting it.static String
apiUnknownToken
(int token) static String
apiUnknownToken
(String description, int token) static <T> T[]
toArray
(T... arguments) Converts dynamic arguments to object array.
-
Method Details
-
toArray
Converts dynamic arguments to object array.- Parameters:
arguments
- the list of arguments.- Returns:
- the object array.
-
apiBuffer
Returns a thread-localAPIBuffer
that has been reset. -
apiStack
Returns a thread-localAPIBuffer
, without resetting it. This makes the APIBuffer work like a stack when used in nested API calls. The user is responsible for resetting theAPIBuffer
to an appropriate state before the nested call returns.- See Also:
-
apiParseVersion
Parses a version string. The version string must have the formatMAJOR.MINOR.REVISION IMPL
, whereMAJOR
is the major version (integer),MINOR
is the minor version (integer),REVISION
is the revision version (string, optional) andIMPL
is implementation-specific information (string, optional).- Parameters:
version
- the API version string- Returns:
- the parsed
APIUtil.APIVersion
-
apiParseVersion
Parses a version string. The version string must have the formatPREFIX MAJOR.MINOR.REVISION IMPL
, wherePREFIX
is the specified prefix (string, optional),MAJOR
is the major version (integer),MINOR
is the minor version (integer),REVISION
is the revision version (string, optional) andIMPL
is implementation-specific information (string, optional).- Parameters:
version
- the version stringprefix
- the version string prefix, may be null- Returns:
- the parsed
APIUtil.APIVersion
-
apiUnknownToken
-
apiUnknownToken
-
apiClassTokens
public static Map<Integer,String> apiClassTokens(APIUtil.TokenFilter filter, Map<Integer, String> target, Class<?>... tokenClasses) Returns a map of public static final integer fields in the specified classes, to their String representations. An optional filter can be specified to only include specific fields. The target map may be null, in which case a new map is allocated and returned.This method is useful when debugging to quickly identify values returned from an API.
- Parameters:
filter
- the filter to use (optional)target
- the target map (optional)tokenClasses
- the classes to get tokens from- Returns:
- the token map
-
apiOptionalClass
-