| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.core.units.code.asm.type.TypeUtil |
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final Set<String> | keywords | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| TypeUtil() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static INativeType |
buildArrayType(ITypeManager typeman, String lowestElementSignature, int... dimensions)
Convenience routine to create an array type, possibly multi-dimensional.
| ||||||||||
| static String | buildFullyQualifiedTypeNameFromElements(List<String> elements) | ||||||||||
| static IPrototypeItem | buildQuickPrototype(ITypeManager typeman, String protoString) | ||||||||||
| static INativeType |
buildQuickType(ITypeManager typeman, String signature)
Create an array or reference type using an existing base type.
| ||||||||||
| static List<INativeType> | collectTypes(IPrototypeItem proto) | ||||||||||
| static List<INativeType> |
findType(Collection<? extends INativeType> types, String pattern, boolean earlyExitOnFirstMatch)
Find a type by pattern (partial name or signature, original or effective).
| ||||||||||
| static INativeType |
getFirstSimpleType(INativeType type)
Get the first simple type embedded (in the most general sense) in the given type.
| ||||||||||
| static <T extends INativeType> T | getNonAlias(INativeType t, Class<T> expected) | ||||||||||
| static INativeType | getNonAlias(INativeType t) | ||||||||||
| static boolean | isAlias(INativeType t) | ||||||||||
| static boolean | isCharacter(INativeType t) | ||||||||||
| static boolean | isFloat(INativeType t) | ||||||||||
| static boolean | isInteger(INativeType t) | ||||||||||
| static boolean | isKeyword(String s) | ||||||||||
| static boolean | isPointer(INativeType t) | ||||||||||
| static boolean | isPrimitive(INativeType t) | ||||||||||
| static boolean | isPrototype(INativeType t) | ||||||||||
| static boolean | isReference(INativeType t) | ||||||||||
| static boolean | isReservedLiteral(String s) | ||||||||||
| static boolean | isSignedInteger(INativeType t) | ||||||||||
| static boolean | isSimple(INativeType t) | ||||||||||
| static boolean | isUnsignedInteger(INativeType t) | ||||||||||
| static boolean |
isValidFullyQualifiedName(String basesig, List<String> elements, String[] aname)
Parse and validate the elements of a normalized signature (aka fully-qualified name).
| ||||||||||
| static boolean | isValidPackageName(String s) | ||||||||||
| static boolean | isValidTypeName(String s) | ||||||||||
| static boolean | isVoid(INativeType t) | ||||||||||
| static String |
normalizeSignature(boolean alreadyPreNormalized, String signature, List<String> elements, int[] counts)
Normalize a type signature (including reference types).
| ||||||||||
| static String | preNormalizeSignature(String signature) | ||||||||||
| static String |
processSignature(String signature, int[] counts)
Process non array or single-dimension arrays of reference or non-reference types.
| ||||||||||
| static boolean |
structureInStructure(IStructureType structType, INativeType type)
Detect structure cycles: Determine if the second parameter type is or contains the structure
type provided as the first parameter.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Convenience routine to create an array type, possibly multi-dimensional.
| lowestElementSignature | finest element type (ideally, should be a non-array) |
|---|---|
| dimensions | highest dimensions first, eg, (2, 3, 4) -> type[2][3][4] |
Create an array or reference type using an existing base type. This method is for convenience only, and by no means exhaustive. Proper type building requires adequate parsing; refer to TLGen. (TODO: bindings to support string type parsing provided by TLGen).
| signature | accepted signatures: abc, abc*, abc**, abc[6], abc*[10], abc**[20]; other type signatures are not accepted (eg, abc[2][4], abc[4]*, abc**[12], etc.) |
|---|
Find a type by pattern (partial name or signature, original or effective). Does not include primitives.
| types | input types |
|---|---|
| pattern | type "pattern" (partial name or signature) |
| earlyExitOnFirstMatch | exit on first match: the returned list will contain one element |
Get the first simple type embedded (in the most general sense) in the given type.
Parse and validate the elements of a normalized signature (aka fully-qualified name).
| basesig | normalized signature, dimension-less, reference-less |
|---|---|
| elements | optional (output elements) |
| aname | optional (output name) |
Normalize a type signature (including reference types).
What it does: Make sure the type separator is '::' (not '.' or '/'). Remove header and trailer whitespace. Remove header '::' if any. Validate signature elements.
| alreadyPreNormalized | true if the signature has been
pre-normalized |
|---|---|
| signature | a non-canonical type signature |
| elements | optional output list to hold the signature elements of the base type signature |
| counts | optional output two-element array, will hold the reference count and the
dimension count of the provided signature; refer to
processSignature(String, int[]) |
Process non array or single-dimension arrays of reference or non-reference types.
| signature | a pre-normalized signature of the type |
|---|---|
| counts | optional output array, contains the reference count (0 if none) and the single-dimension array count (-1 if none) |
Detect structure cycles: Determine if the second parameter type is or contains the structure type provided as the first parameter.
| structType | the input structure |
|---|---|
| type | the type to be vetted against the provided structure |