Package org.djunits.util
Class FieldSignature
- java.lang.Object
-
- org.djunits.util.FieldSignature
-
- All Implemented Interfaces:
Serializable
public class FieldSignature extends Object implements Serializable
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 Specification .Copyright (c) 2002-2009 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved.
See for project information www.getSI()mulation.tudelft.nl.
The DSOL project is distributed under the following BSD-style license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Delft University of Technology, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- Since:
- 1.5
- Version:
- $Revision: 1.2 $ $Date: 2009/10/21 07:32:43 $
- Author:
- Peter Jacobs, Niels Lang, Alexander Verbraeck
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FieldSignature(Class<?> clazz)
constructs a new FieldSignature.FieldSignature(String value)
constructs a new FieldSignature.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getClassValue()
String
getStringValue()
static Class<?>
toClass(String descriptor)
converts a fieldDescriptor to its class representation.static String
toDescriptor(Class<?> clazz)
converts a field to its descriptor.static String
toDescriptor(Class<?>[] classes)
converts an array of fields to its descriptor.String
toString()
-
-
-
Method Detail
-
getStringValue
public final String getStringValue()
- Returns:
- Returns the value of the field descriptor
-
getClassValue
public final Class<?> getClassValue() throws ClassNotFoundException
- Returns:
- Returns the value of the field descriptor
- Throws:
ClassNotFoundException
- if the class cannot be found.
-
toDescriptor
public static final String toDescriptor(Class<?>[] classes)
converts an array of fields to its descriptor.- Parameters:
classes
- the classes to represent- Returns:
- String the descriptor String
-
toDescriptor
public static final String toDescriptor(Class<?> clazz)
converts a field to its descriptor.- Parameters:
clazz
- the clazz to represent- Returns:
- String the descriptor String
-
toClass
public static final Class<?> toClass(String descriptor) throws ClassNotFoundException
converts a fieldDescriptor to its class representation.- Parameters:
descriptor
- the descriptor- Returns:
- Class the class
- Throws:
ClassNotFoundException
- on failure
-
-