sysModel.classFile
Class ClassFileTools

java.lang.Object
  extended by sysModel.classFile.ClassFileTools

public class ClassFileTools
extends java.lang.Object

Tools for dealing with class files.

Author:
Mathias Ricken

Constructor Summary
ClassFileTools()
           
 
Method Summary
static java.lang.String getAccessString(short flags)
          Return a string that represents the access flags set.
static java.lang.String getClassName(java.lang.String s)
          Return class name in Java form.
static java.lang.String getNextSignature(java.lang.String sig)
          Return the next descriptor from a string of concatenated signatures.
static java.lang.String getTypeString(java.lang.String typeString, java.lang.String varName)
          Translate a type descriptor descriptor and a variable name into a Java declaration.
static boolean isPrimitive(java.lang.String typeString)
          Return true if this is a primitive type or an array of primitive types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFileTools

public ClassFileTools()
Method Detail

getAccessString

public static java.lang.String getAccessString(short flags)
Return a string that represents the access flags set.

Parameters:
flags - access flags
Returns:
string with access flags as words

getTypeString

public static java.lang.String getTypeString(java.lang.String typeString,
                                             java.lang.String varName)
Translate a type descriptor descriptor and a variable name into a Java declaration.

Parameters:
typeString - type descriptor descriptor
varName - variable name
Returns:
declaration

isPrimitive

public static boolean isPrimitive(java.lang.String typeString)
Return true if this is a primitive type or an array of primitive types.

Parameters:
typeString - type descriptor descriptor
Returns:
true if primitive type or array of primitive types

getNextSignature

public static java.lang.String getNextSignature(java.lang.String sig)
Return the next descriptor from a string of concatenated signatures. For example, if the descriptor was "[BII", this method would return "II".

Parameters:
sig - concatenated signatures
Returns:
next descriptor

getClassName

public static java.lang.String getClassName(java.lang.String s)
Return class name in Java form.

Parameters:
s - mangled class name
Returns:
Java class name