public final class ParseUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
IDENT_PATTERN
Regular expression that matches valid Java identifiers.
|
Modifier and Type | Method and Description |
---|---|
static Stream<String> |
complete(Collection<String> choices,
String prefix)
Generate completions based on a set of possibilities and the provided input prefix.
|
static Stream<String> |
complete(Stream<String> choices,
String prefix)
Generate completions based on a set of possibilities and the provided input prefix.
|
static Class<?> |
getArrayClass(Class<?> base,
int dims)
Get the array class with the given non-array base type and dimensions.
|
static Field<?> |
resolveField(ParseSession session,
ObjId id,
String fieldName)
Locate the field with the given name in the specified object.
|
static JField |
resolveJField(ParseSession session,
ObjId id,
String name)
Locate the
JField with the given name in the specified object. |
public static final String IDENT_PATTERN
public static Stream<String> complete(Collection<String> choices, String prefix)
choices
- possible choicesprefix
- prefix input so farpublic static Stream<String> complete(Stream<String> choices, String prefix)
choices
- possible choicesprefix
- prefix input so farpublic static JField resolveJField(ParseSession session, ObjId id, String name)
JField
with the given name in the specified object.session
- current sessionid
- object IDname
- field nameIllegalArgumentException
- if object does not existIllegalArgumentException
- if object's type does not exist in schemaIllegalArgumentException
- if field is not foundIllegalArgumentException
- if any parameter is nullIllegalArgumentException
- if state
is not in SessionMode.PERMAZEN
public static Field<?> resolveField(ParseSession session, ObjId id, String fieldName)
session
- current sessionid
- object IDfieldName
- field nameIllegalArgumentException
- if object does not existIllegalArgumentException
- if field is not foundIllegalArgumentException
- if any parameter is nullpublic static Class<?> getArrayClass(Class<?> base, int dims)
base
- base typedims
- number of dimensionsbase
if dims
is zeroIllegalArgumentException
- if base
is nullIllegalArgumentException
- if base
is an array typeIllegalArgumentException
- if base
is void
and dims > 0
IllegalArgumentException
- if dims
is not in the range 0..255Copyright © 2022. All rights reserved.