Jalopy 1.0b10

de.hunsicker.jalopy.language
Class DeclarationType

java.lang.Object
  |
  +--de.hunsicker.jalopy.language.DeclarationType
All Implemented Interfaces:
Comparable, Type

public class DeclarationType
extends Object
implements Comparable, Type

Represents a method type to distinguish between ordinary method names and those which adhere to the Java Bean naming conventions.

The default order for comparing is: ordinary Java method names, mutator, accessor/tester. This can be changed via setOrder(java.lang.String).

Version:
$Revision: 1.2 $
Author:
Marco Hunsicker

Field Summary
static DeclarationType CLASS
          Represents a class declaration.
static int CLASS_INT
          The bit value for classes.
static DeclarationType CTOR
          Represents a constructor declaration.
static int CTOR_INT
          The bit value for constructors.
static DeclarationType INIT
          Represents an instance initializer.
static int INIT_INT
          The bit value for instance initializers.
static DeclarationType INTERFACE
          Represents an interface declaration.
static int INTERFACE_INT
          The bit value for interfaces.
static DeclarationType METHOD
          Represents a method declaration.
static int METHOD_INT
          The bit value for methods.
static int STATIC_VAR_INIT_INT
          The bit value for static variables/initializers.
static DeclarationType STATIC_VARIABLE_INIT
          Represents a static variable declaration or initializer.
static DeclarationType VARIABLE
          Represents an instance variable declaration.
static int VARIABLE_INT
          The bit value for instance variables.
 
Method Summary
 int compareTo(Object other)
          Compares this object with the specified object for order.
 String getDisplayName()
          DOCUMENT ME!
 String getName()
          Returns the name of this type.
static String getOrder()
          Returns a string representation of the current sort order.
static void setOrder(String str)
          Sets the order to use as the natural order.
 String toString()
          Returns a string representation of this method type.
static DeclarationType valueOf(String name)
          Returns the declaration type of the given abreviation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_INT

public static final int CLASS_INT
The bit value for classes.

CTOR_INT

public static final int CTOR_INT
The bit value for constructors.

INIT_INT

public static final int INIT_INT
The bit value for instance initializers.

INTERFACE_INT

public static final int INTERFACE_INT
The bit value for interfaces.

METHOD_INT

public static final int METHOD_INT
The bit value for methods.

VARIABLE_INT

public static final int VARIABLE_INT
The bit value for instance variables.

STATIC_VAR_INIT_INT

public static final int STATIC_VAR_INIT_INT
The bit value for static variables/initializers.

CLASS

public static final DeclarationType CLASS
Represents a class declaration.

INTERFACE

public static final DeclarationType INTERFACE
Represents an interface declaration.

VARIABLE

public static final DeclarationType VARIABLE
Represents an instance variable declaration.

INIT

public static final DeclarationType INIT
Represents an instance initializer.

CTOR

public static final DeclarationType CTOR
Represents a constructor declaration.

METHOD

public static final DeclarationType METHOD
Represents a method declaration.

STATIC_VARIABLE_INIT

public static final DeclarationType STATIC_VARIABLE_INIT
Represents a static variable declaration or initializer.
Method Detail

getName

public String getName()
Returns the name of this type.
Returns:
type name.

setOrder

public static void setOrder(String str)
Sets the order to use as the natural order.
Parameters:
str - a string representing the new order. The string must consist of exactly four different, comma delimited strings which represents a method type.
Throws:
IllegalArgumentException - if the given string is invalid.

getOrder

public static String getOrder()
Returns a string representation of the current sort order. To encode the different declaration types, use
 Variable,Initializer,Constructor,Method,Interface,Class
 
or any combination thereof.
Returns:
the string representation of the order.

getDisplayName

public String getDisplayName()
DOCUMENT ME!
Returns:
DOCUMENT ME!

compareTo

public int compareTo(Object other)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Specified by:
compareTo in interface Comparable
Parameters:
other - the object to be compared.
Returns:
DOCUMENT ME!
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this object.

toString

public String toString()
Returns a string representation of this method type.
Overrides:
toString in class Object
Returns:
a string representation of this type.

valueOf

public static DeclarationType valueOf(String name)
Returns the declaration type of the given abreviation.
Parameters:
name - a declaration identifier.
Returns:
the declaration type of the given name.
Throws:
IllegalArgumentException - if no valid declaration identifier was given.

Jalopy 1.0b10

Submit a bug or feature.

For further information and documentation, visit the official Jalopy website.
This page generated: November 14 2002