Package org.djutils.reflection
Class FieldSignature
java.lang.Object
org.djutils.reflection.FieldSignature
A field descriptor represents the type of a class, instance, or local variable. It is a series of characters generated by the
grammar described at The Java Virtual Machine
class File Format .
Copyright (c) 2002-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.
- Author:
- Peter Jacobs, Niels Lang, Alexander Verbraeck
-
Constructor Summary
ConstructorsConstructorDescriptionFieldSignature(Class<?> clazz) constructs a new FieldSignature.FieldSignature(String value) constructs a new FieldSignature. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>static final Class<?>converts a fieldDescriptor to its class representation.static final StringtoDescriptor(Class<?> clazz) converts a field to its descriptor.static final StringtoDescriptor(Class<?>[] classes) converts an array of fields to its descriptor.toString()
-
Constructor Details
-
FieldSignature
constructs a new FieldSignature.- Parameters:
value- the value of the descriptor
-
FieldSignature
constructs a new FieldSignature.- Parameters:
clazz- The class
-
-
Method Details
-
getStringValue
- Returns:
- Returns the value of the field descriptor
-
getClassValue
- Returns:
- Returns the value of the field descriptor
- Throws:
ClassNotFoundException- if the class cannot be found.
-
toString
-
toDescriptor
converts an array of fields to its descriptor.- Parameters:
classes- the classes to represent- Returns:
- String the descriptor String
-
toDescriptor
converts a field to its descriptor.- Parameters:
clazz- the clazz to represent- Returns:
- String the descriptor String
-
toClass
converts a fieldDescriptor to its class representation.- Parameters:
descriptor- the descriptor- Returns:
- Class the class
- Throws:
ClassNotFoundException- on failure
-