openjava.mop
Class Toolbox

java.lang.Object
  |
  +--openjava.mop.Toolbox

public abstract class Toolbox
extends java.lang.Object

The class Toolbox is an utility class.

 

Since:
%SOFTWARE% 1.0
See Also:
Object

Constructor Summary
Toolbox()
           
 
Method Summary
static OJClass[] append(OJClass[] a, OJClass[] b)
           
static OJConstructor[] append(OJConstructor[] a, OJConstructor[] b)
           
static OJField[] append(OJField[] a, OJField[] b)
           
static OJMethod[] append(OJMethod[] a, OJMethod[] b)
           
static OJClass[] arrayForNames(Environment env, java.lang.String[] names)
           
static OJClass forNameAnyway(Environment env, java.lang.String name)
           
static ParameterList generateParameters(OJClass[] parameterTypes)
           
static ParameterList generateParameters(OJClass[] parameterTypes, java.lang.String[] parameterNames)
           
static boolean isAcceptable(OJClass[] accepter, OJClass[] acceptee)
           
static boolean isAdaptableTo(OJClass[] adapter, OJClass[] adaptee)
           
static boolean isSame(OJClass[] accepter, OJClass[] acceptee)
           
static java.lang.String nameForJavaClassName(java.lang.String jcname)
           
static java.lang.String nameToJavaClassName(java.lang.String ojcname)
           
static OJClass[] overridesOn(OJClass[] declareds, OJClass[] bases)
          Generates an array of classes containing the declared classes and the based classes except the declared one.
static OJField[] overridesOn(OJField[] declareds, OJField[] bases)
          Generates an array of fields containing the declared fields and the based fields except the declared one.
static OJMethod[] overridesOn(OJMethod[] declareds, OJMethod[] bases)
          Generates an array of methods containing the declared methods and the based methods except the declared one.
static OJConstructor pickupAcceptableConstructor(OJConstructor[] src_constrs, OJClass[] param_types)
          Pick up a constructor with the signature acceptable the specified signature in the source array of constructors.
static OJConstructor[] pickupAcceptableConstructors(OJConstructor[] src_constrs, OJClass[] param_types)
          Generates an array of constructors containing the constructors with the specified parameter types in the source array of constructors.
static OJMethod pickupAcceptableMethod(OJMethod[] src_methods, java.lang.String name, OJClass[] param_types)
          Pick up a method with the signature acceptable the specified signature in the source array of methods.
static OJMethod[] pickupAcceptableMethods(OJMethod[] src_methods, java.lang.String name, OJClass[] param_types)
          Generates an array of methods containing the methods with the signature acceptable the specified signature in the source array of methods.
static OJMethod[] pickupAcceptableMethodsByParameterTypes(OJMethod[] src_methods, OJClass[] param_types)
          Generates an array of methods containing the methods with the parameter types acceptable specified parameter types in the source array of methods.
static OJConstructor pickupConstructor(OJConstructor[] src_constrs, OJClass[] param_types)
          Pick up a constructor with the specified signature in the source array of constructors.
static OJField pickupField(OJField[] src_fields, java.lang.String name)
          Pick up a field with the specified name in the source array of fields.
static OJMethod pickupMethod(OJMethod[] src_methods, java.lang.String name, OJClass[] param_types)
          Pick up a method with the specified signature in the source array of methods.
static OJMethod pickupMethodByParameterTypes(OJMethod[] src_methods, OJClass[] param_types)
          Picks up a method with the specified parameter types in the source array of methods.
static OJMethod[] pickupMethodsByName(OJMethod[] src_methods, java.lang.String name)
          Generates an array of methods containing the methods with the specified name in the source array of methods.
static OJConstructor pickupMostSpecified(OJConstructor[] constrs)
           
static OJMethod pickupMostSpecified(OJMethod[] methods)
           
static OJClass[] removeTheDefaults(OJClass[] src_classes)
          Generates an array of classes containing the source classes except ones with private access modifier.
static OJConstructor[] removeTheDefaults(OJConstructor[] src_constrs)
          Generates an array of constructors containing the source constructors except ones with private access modifier.
static OJField[] removeTheDefaults(OJField[] src_fields)
          Generates an array of fields containing the source fields except ones with private access modifier.
static OJMethod[] removeTheDefaults(OJMethod[] src_methods)
          Generates an array of methods containing the source methods except ones with private access modifier.
static OJClass[] removeTheNonPublics(OJClass[] src_classes)
          Generates an array of classes containing the source classes except ones with non-public access modifier; one of private, protected or package level access modifiers.
static OJConstructor[] removeTheNonPublics(OJConstructor[] src_constrs)
          Generates an array of constructors containing the source constructors except ones with non-public access modifier; one of private, protected or package level access modifiers.
static OJField[] removeTheNonPublics(OJField[] src_fields)
          Generates an array of fields containing the source fields except ones with non-public access modifier; one of private, protected or package level access modifiers.
static OJMethod[] removeTheNonPublics(OJMethod[] src_methods)
          Generates an array of methods containing the source methods except ones with non-public access modifier; one of private, protected or package level access modifiers.
static OJClass[] removeThePrivates(OJClass[] src_classes)
          Generates an array of classes containing the source classes except ones with private access modifier.
static OJConstructor[] removeThePrivates(OJConstructor[] src_constrs)
          Generates an array of constructors containing the source constructors except ones with private access modifier.
static OJField[] removeThePrivates(OJField[] src_fields)
          Generates an array of fields containing the source fields except ones with private access modifier.
static OJMethod[] removeThePrivates(OJMethod[] src_methods)
          Generates an array of methods containing the source methods except ones with private access modifier.
static TypeName[] TNsForOJClasses(OJClass[] classes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Toolbox

public Toolbox()
Method Detail

overridesOn

public static final OJClass[] overridesOn(OJClass[] declareds,
                                          OJClass[] bases)
Generates an array of classes containing the declared classes and the based classes except the declared one.
Parameters:
declareds - declared classes to override
bases - based classes.
Returns:
classes which contains the declared classes and the based classes except the declared one.
See Also:
OJClass

overridesOn

public static final OJField[] overridesOn(OJField[] declareds,
                                          OJField[] bases)
Generates an array of fields containing the declared fields and the based fields except the declared one.
Parameters:
declareds - declared fields to override
bases - based fields.
Returns:
fields which contains the declared fields and the based fields except the declared one.
See Also:
OJField

overridesOn

public static final OJMethod[] overridesOn(OJMethod[] declareds,
                                           OJMethod[] bases)
Generates an array of methods containing the declared methods and the based methods except the declared one.
Parameters:
declareds - declared methods to override
bases - based methods.
Returns:
methods which contains the declared methods and the based methods except the declared one.
See Also:
OJMethod

removeThePrivates

public static final OJClass[] removeThePrivates(OJClass[] src_classes)
Generates an array of classes containing the source classes except ones with private access modifier.
Parameters:
src_classes - source classes.
Returns:
classes except ones with private access modifier.
See Also:
OJModifier

removeThePrivates

public static final OJField[] removeThePrivates(OJField[] src_fields)
Generates an array of fields containing the source fields except ones with private access modifier.
Parameters:
src_fields - source fields.
Returns:
fields except ones with private access modifier.
See Also:
OJModifier

removeThePrivates

public static final OJMethod[] removeThePrivates(OJMethod[] src_methods)
Generates an array of methods containing the source methods except ones with private access modifier.
Parameters:
src_methods - source methods.
Returns:
methods except ones with private access modifier.
See Also:
OJModifier

removeThePrivates

public static final OJConstructor[] removeThePrivates(OJConstructor[] src_constrs)
Generates an array of constructors containing the source constructors except ones with private access modifier.
Parameters:
src_constrs - source constructors.
Returns:
constructors except ones with private access modifier.
See Also:
OJModifier

removeTheDefaults

public static final OJClass[] removeTheDefaults(OJClass[] src_classes)
Generates an array of classes containing the source classes except ones with private access modifier.
Parameters:
src_classes - source classes.
Returns:
classes except ones with private access modifier.
See Also:
OJModifier

removeTheDefaults

public static final OJField[] removeTheDefaults(OJField[] src_fields)
Generates an array of fields containing the source fields except ones with private access modifier.
Parameters:
src_fields - source fields.
Returns:
fields except ones with private access modifier.
See Also:
OJModifier

removeTheDefaults

public static final OJMethod[] removeTheDefaults(OJMethod[] src_methods)
Generates an array of methods containing the source methods except ones with private access modifier.
Parameters:
src_methods - source methods.
Returns:
methods except ones with private access modifier.
See Also:
OJModifier

removeTheDefaults

public static final OJConstructor[] removeTheDefaults(OJConstructor[] src_constrs)
Generates an array of constructors containing the source constructors except ones with private access modifier.
Parameters:
src_constrs - source constructors.
Returns:
constructors except ones with private access modifier.
See Also:
OJModifier

removeTheNonPublics

public static final OJClass[] removeTheNonPublics(OJClass[] src_classes)
Generates an array of classes containing the source classes except ones with non-public access modifier; one of private, protected or package level access modifiers.
Parameters:
src_classes - source classes.
Returns:
classes except ones with non-public access modifier.
See Also:
OJModifier

removeTheNonPublics

public static final OJField[] removeTheNonPublics(OJField[] src_fields)
Generates an array of fields containing the source fields except ones with non-public access modifier; one of private, protected or package level access modifiers.
Parameters:
src_fields - source fields.
Returns:
fields except ones with non-public access modifier.
See Also:
OJModifier

removeTheNonPublics

public static final OJMethod[] removeTheNonPublics(OJMethod[] src_methods)
Generates an array of methods containing the source methods except ones with non-public access modifier; one of private, protected or package level access modifiers.
Parameters:
src_methods - source methods.
Returns:
methods except ones with non-public access modifier.
See Also:
OJModifier

removeTheNonPublics

public static final OJConstructor[] removeTheNonPublics(OJConstructor[] src_constrs)
Generates an array of constructors containing the source constructors except ones with non-public access modifier; one of private, protected or package level access modifiers.
Parameters:
src_constrs - source constructors.
Returns:
constructors except ones with non-public access modifier.
See Also:
OJModifier

pickupField

public static final OJField pickupField(OJField[] src_fields,
                                        java.lang.String name)
Pick up a field with the specified name in the source array of fields.
Parameters:
src_constrs - source fields.
name - a name to specify.
Returns:
a field with the specified name.
See Also:
OJClass

pickupMethod

public static final OJMethod pickupMethod(OJMethod[] src_methods,
                                          java.lang.String name,
                                          OJClass[] param_types)
Pick up a method with the specified signature in the source array of methods.
Parameters:
src_methods - source methods.
name - a name to specify.
param_types - parameter types to specify.
Returns:
a method with the specified signature. This returns null if it doesn't exist.
See Also:
OJClass

pickupAcceptableMethod

public static final OJMethod pickupAcceptableMethod(OJMethod[] src_methods,
                                                    java.lang.String name,
                                                    OJClass[] param_types)
Pick up a method with the signature acceptable the specified signature in the source array of methods.
Parameters:
src_constrs - source methods.
name - a name to specify.
param_types - parameter types to specify.
Returns:
a method with the specified signature. This returns null if it doesn't exist.
See Also:
OJClass

pickupAcceptableMethods

public static final OJMethod[] pickupAcceptableMethods(OJMethod[] src_methods,
                                                       java.lang.String name,
                                                       OJClass[] param_types)
Generates an array of methods containing the methods with the signature acceptable the specified signature in the source array of methods.
Parameters:
src_methods - source methods.
name - a name to specify.
param_types - parameter types to specify.
Returns:
methods with the specified signature.
See Also:
OJClass

pickupConstructor

public static final OJConstructor pickupConstructor(OJConstructor[] src_constrs,
                                                    OJClass[] param_types)
Pick up a constructor with the specified signature in the source array of constructors.
Parameters:
src_constrs - source constructors.
name - a name to specify.
param_types - parameter types to specify.
Returns:
a Constructor with the specified signature. This returns null if it doesn't exist.
See Also:
OJClass

pickupAcceptableConstructor

public static final OJConstructor pickupAcceptableConstructor(OJConstructor[] src_constrs,
                                                              OJClass[] param_types)
Pick up a constructor with the signature acceptable the specified signature in the source array of constructors.
Parameters:
src_constrs - source constructors.
name - a name to specify.
param_types - parameter types to specify.
Returns:
a constructor with the specified signature. This returns null if it doesn't exist.
See Also:
OJClass

pickupAcceptableConstructors

public static final OJConstructor[] pickupAcceptableConstructors(OJConstructor[] src_constrs,
                                                                 OJClass[] param_types)
Generates an array of constructors containing the constructors with the specified parameter types in the source array of constructors.
Parameters:
src_constrs - source constructors.
param_types - parameter types to specify.
Returns:
constructors acceptable the specified parameter types.
See Also:
OJClass

pickupMethodsByName

public static final OJMethod[] pickupMethodsByName(OJMethod[] src_methods,
                                                   java.lang.String name)
Generates an array of methods containing the methods with the specified name in the source array of methods.
Parameters:
src_methods - source methods.
name - a name to specify.
Returns:
methods with the specified name.
See Also:
OJClass

pickupMethodByParameterTypes

public static final OJMethod pickupMethodByParameterTypes(OJMethod[] src_methods,
                                                          OJClass[] param_types)
Picks up a method with the specified parameter types in the source array of methods.
Parameters:
src_methods - source methods.
param_types - parameter types to specify.
Returns:
a method with the specified parameter types.
See Also:
OJClass

pickupAcceptableMethodsByParameterTypes

public static final OJMethod[] pickupAcceptableMethodsByParameterTypes(OJMethod[] src_methods,
                                                                       OJClass[] param_types)
Generates an array of methods containing the methods with the parameter types acceptable specified parameter types in the source array of methods.
Parameters:
src_methods - source methods.
param_types - parameter types to specify.
Returns:
methods acceptable the specified parameter types.
See Also:
OJClass

isSame

public static final boolean isSame(OJClass[] accepter,
                                   OJClass[] acceptee)

isAcceptable

public static final boolean isAcceptable(OJClass[] accepter,
                                         OJClass[] acceptee)

isAdaptableTo

public static final boolean isAdaptableTo(OJClass[] adapter,
                                          OJClass[] adaptee)

pickupMostSpecified

public static final OJConstructor pickupMostSpecified(OJConstructor[] constrs)

pickupMostSpecified

public static final OJMethod pickupMostSpecified(OJMethod[] methods)

append

public static final OJClass[] append(OJClass[] a,
                                     OJClass[] b)

append

public static final OJField[] append(OJField[] a,
                                     OJField[] b)

append

public static final OJMethod[] append(OJMethod[] a,
                                      OJMethod[] b)

append

public static final OJConstructor[] append(OJConstructor[] a,
                                           OJConstructor[] b)

nameForJavaClassName

public static final java.lang.String nameForJavaClassName(java.lang.String jcname)

nameToJavaClassName

public static final java.lang.String nameToJavaClassName(java.lang.String ojcname)

forNameAnyway

public static final OJClass forNameAnyway(Environment env,
                                          java.lang.String name)

arrayForNames

public static final OJClass[] arrayForNames(Environment env,
                                            java.lang.String[] names)

TNsForOJClasses

public static final TypeName[] TNsForOJClasses(OJClass[] classes)

generateParameters

public static final ParameterList generateParameters(OJClass[] parameterTypes)

generateParameters

public static final ParameterList generateParameters(OJClass[] parameterTypes,
                                                     java.lang.String[] parameterNames)