nl.tudelft.simulation.language.reflection
Class FieldSignature

java.lang.Object
  extended by nl.tudelft.simulation.language.reflection.FieldSignature
All Implemented Interfaces:
java.io.Serializable

public class FieldSignature
extends java.lang.Object
implements java.io.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 .

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.

See for project information www.simulation.tudelft.nl/language
License of use: Lesser General Public License (LGPL) , no warranty

Since:
1.5
Version:
$Revision: 1.8 $ $Date: 2005/08/04 12:08:54 $
Author:
Peter Jacobs , Niels Lang Alexander Verbraeck
See Also:
Serialized Form

Constructor Summary
FieldSignature(java.lang.Class clazz)
          constructs a new FieldSignature
FieldSignature(java.lang.String value)
          constructs a new FieldSignature
 
Method Summary
 java.lang.Class getClassValue()
           
 java.lang.String getStringValue()
           
static java.lang.Class toClass(java.lang.String descriptor)
          converts a fieldDescriptor to its class representation
static java.lang.String toDescriptor(java.lang.Class clazz)
          converts a field to its descriptor
static java.lang.String toDescriptor(java.lang.Class[] classes)
          converts an array of fields to its descriptor
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldSignature

public FieldSignature(java.lang.String value)
constructs a new FieldSignature

Parameters:
value - the value of the descriptor

FieldSignature

public FieldSignature(java.lang.Class clazz)
constructs a new FieldSignature

Parameters:
clazz - The class
Method Detail

getStringValue

public java.lang.String getStringValue()
Returns:
Returns the value of the field descriptor

getClassValue

public java.lang.Class getClassValue()
                              throws java.lang.ClassNotFoundException
Returns:
Returns the value of the field descriptor
Throws:
java.lang.ClassNotFoundException - if the class cannot be found.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

toDescriptor

public static final java.lang.String toDescriptor(java.lang.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 java.lang.String toDescriptor(java.lang.Class clazz)
converts a field to its descriptor

Parameters:
clazz - the clazz to represent
Returns:
String the descriptor String

toClass

public static final java.lang.Class toClass(java.lang.String descriptor)
                                     throws java.lang.ClassNotFoundException
converts a fieldDescriptor to its class representation

Parameters:
descriptor - the descriptor
Returns:
Class the class
Throws:
java.lang.ClassNotFoundException - on failure


Copyright © 2002-2005 Delft University of Technology, the Netherlands. All Rights Reserved.