Package io.permazen.cli.parse
Class ParseUtil
java.lang.Object
io.permazen.cli.parse.ParseUtil
Parsing utility routines.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRegular expression that matches valid Java identifiers. -
Method Summary
Modifier and TypeMethodDescriptioncomplete(Collection<String> choices, String prefix) Generate completions based on a set of possibilities and the provided input 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(Session session, ObjId id, String fieldName) Locate the field with the given name in the specified object.static PermazenFieldresolveJField(Session session, ObjId id, String name) Locate thePermazenFieldwith the given name in the specified object.
-
Field Details
-
IDENT_PATTERN
Regular expression that matches valid Java identifiers.- See Also:
-
-
Method Details
-
complete
Generate completions based on a set of possibilities and the provided input prefix.- Parameters:
choices- possible choicesprefix- prefix input so far- Returns:
- possible completions
-
complete
Generate completions based on a set of possibilities and the provided input prefix.- Parameters:
choices- possible choicesprefix- prefix input so far- Returns:
- possible completions
-
resolveJField
Locate thePermazenFieldwith the given name in the specified object.- Parameters:
session- current sessionid- object IDname- field name- Returns:
- the specified field
- Throws:
IllegalArgumentException- if object does not existIllegalArgumentException- if object's type does not exist in schemaIllegalArgumentException- if field is not foundIllegalArgumentException- if any parameter is nullIllegalArgumentException- ifstateis not inSessionMode.PERMAZEN
-
resolveField
Locate the field with the given name in the specified object.- Parameters:
session- current sessionid- object IDfieldName- field name- Returns:
- the specified field
- Throws:
IllegalArgumentException- if object does not existIllegalArgumentException- if field is not foundIllegalArgumentException- if any parameter is null
-
getArrayClass
Get the array class with the given non-array base type and dimensions.- Parameters:
base- base typedims- number of dimensions- Returns:
- the corresponding array type, or
baseifdimsis zero - Throws:
IllegalArgumentException- ifbaseis nullIllegalArgumentException- ifbaseis an array typeIllegalArgumentException- ifbaseisvoidanddims > 0IllegalArgumentException- ifdimsis not in the range 0..255
-