nl.tudelft.simulation.language.reflection
Class FieldSignature

java.lang.Object
  extended by nl.tudelft.simulation.language.reflection.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 .

(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.3
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:54 $
Author:
Peter Jacobs , Niels Lang Alexander Verbraeck
See Also:
Serialized Form

Constructor Summary
FieldSignature(Class clazz)
          constructs a new FieldSignature
FieldSignature(String value)
          constructs a new FieldSignature
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldSignature

public FieldSignature(String value)
constructs a new FieldSignature

Parameters:
value - the value of the descriptor

FieldSignature

public FieldSignature(Class clazz)
constructs a new FieldSignature

Parameters:
clazz - The class
Method Detail

getStringValue

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

getClassValue

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

toString

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

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


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