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
Nested ClassesModifier and TypeClassDescriptionstatic classA data class for API versioning information.static interfaceSimple interface for Field filtering. -
Method Summary
Modifier and TypeMethodDescriptionstatic APIBufferReturns a thread-localAPIBufferthat 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.APIVersionapiParseVersion(String version) Parses a version string.static APIUtil.APIVersionapiParseVersion(String version, String prefix) Parses a version string.static APIBufferapiStack()Returns a thread-localAPIBuffer, without resetting it.static StringapiUnknownToken(int token) static StringapiUnknownToken(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-localAPIBufferthat 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 theAPIBufferto 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, whereMAJORis the major version (integer),MINORis the minor version (integer),REVISIONis the revision version (string, optional) andIMPLis 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, wherePREFIXis the specified prefix (string, optional),MAJORis the major version (integer),MINORis the minor version (integer),REVISIONis the revision version (string, optional) andIMPLis 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
-