public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static String |
constructDottedName(DetailAST aAST)
Builds the dotted name String representation of the object contained
within an AST.
|
static boolean |
equalTypes(DetailAST aTypeAST1,
DetailAST aTypeAST2)
Tests whether two type AST nodes have the same type.
|
static boolean |
hasExtends(DetailAST aAST,
String aClassOrInterface)
Determines whether an AST node declares an extension of a class or
interface.
|
static boolean |
hasImplements(DetailAST aAST,
String aInterface)
Determines whether an AST node declares an implementation of an
interface.
|
static boolean |
hasPublicConstructor(DetailAST aAST,
int aParameterCount)
Determines whether an AST defines a class with a public constructor
with a given number of parameters.
|
static boolean |
hasPublicMethod(DetailAST aAST,
String aName)
Determines whether an AST node has a definition of a public method.
|
static boolean |
hasPublicMethod(DetailAST aAST,
String aName,
boolean aIsVoid)
Determines whether an AST node has a definition of a public method.
|
static boolean |
hasPublicMethod(DetailAST aAST,
String aName,
boolean aIsVoid,
int aParameterCount)
Determines whether an AST node has a definition of a public method.
|
static boolean |
hasThrows(DetailAST aAST,
String aException)
Determines whether an AST node declares a throw of an Exception.
|
static boolean |
implementsEntityBean(DetailAST aAST)
Determines whether an AST node is in the definition of a
class that implements javax.ejb.EntityBean.
|
static boolean |
implementsSessionBean(DetailAST aAST)
Determines whether an AST node is in the definition of a
class that implements javax.ejb.SessionBean.
|
static boolean |
isAbstract(DetailAST aAST)
Determines whether an AST defines an abstract element.
|
static boolean |
isFinal(DetailAST aAST)
Determines whether an AST defines a final element.
|
static boolean |
isInEJB(DetailAST aAST)
Determines whether an AST node is in the definition of an
EJB class.
|
static boolean |
isPublic(DetailAST aAST)
Determines whether an AST defines a public element.
|
static boolean |
isPublicMethod(DetailAST aAST,
String aName)
Determines whether an AST node defines a public method.
|
static boolean |
isPublicMethod(DetailAST aAST,
String aName,
boolean aIsVoid)
Determines whether an AST node defines a public method.
|
static boolean |
isPublicMethod(DetailAST aAST,
String aName,
boolean aIsVoid,
int aParameterCount)
Determines whether an AST node defines a public method.
|
static boolean |
isStatic(DetailAST aAST)
Determines whether an AST defines a static element.
|
static boolean |
isVoid(DetailAST aAST)
Determines whether an AST defines a void method.
|
static boolean |
sameParameters(DetailAST aMethodAST1,
DetailAST aMethodAST2)
Tests whether two method definition ASTs have the same parameter lists
according to type.
|
public static boolean hasPublicMethod(DetailAST aAST, String aName)
aAST
- the node to check. Normally aAST is a CLASS_DEF.aName
- the name of the method.public static boolean hasPublicMethod(DetailAST aAST, String aName, boolean aIsVoid)
aAST
- the node to check. Normally aAST is a CLASS_DEF.aName
- the name of the method.aIsVoid
- designates whether the method is void.public static boolean hasPublicMethod(DetailAST aAST, String aName, boolean aIsVoid, int aParameterCount)
aAST
- the node to check. Normally aAST is a CLASS_DEF.aName
- the name of the method.aIsVoid
- designates whether the method is void.aParameterCount
- the number of method parameters.public static boolean hasPublicConstructor(DetailAST aAST, int aParameterCount)
aAST
- the AST to check.aParameterCount
- the number of parameterspublic static boolean implementsEntityBean(DetailAST aAST)
aAST
- the AST to check.public static boolean implementsSessionBean(DetailAST aAST)
aAST
- the AST to check.public static boolean isInEJB(DetailAST aAST)
aAST
- the AST to check.public static boolean isAbstract(DetailAST aAST)
aAST
- the AST to check.public static boolean isFinal(DetailAST aAST)
aAST
- the AST to check.public static boolean isPublic(DetailAST aAST)
aAST
- the AST to check.public static boolean isStatic(DetailAST aAST)
aAST
- the AST to check.public static boolean isVoid(DetailAST aAST)
aAST
- the AST to check.public static boolean hasImplements(DetailAST aAST, String aInterface)
aAST
- the AST to check.aInterface
- the interface to check.public static boolean hasExtends(DetailAST aAST, String aClassOrInterface)
aAST
- the AST to check.aClassOrInterface
- the class or interface to check.public static boolean hasThrows(DetailAST aAST, String aException)
aAST
- the AST to check.aException
- the name of the Exception to check.public static boolean isPublicMethod(DetailAST aAST, String aName, boolean aIsVoid, int aParameterCount)
aAST
- the node to check. Normally aAST is a METHOD_DEF.aName
- the name of the method.aIsVoid
- designates whether the method is void.aParameterCount
- the number of method parameters.public static boolean isPublicMethod(DetailAST aAST, String aName, boolean aIsVoid)
aAST
- the node to check. Normally aAST is a METHOD_DEF.aName
- the name of the method.aIsVoid
- designates whether the method is void.public static boolean isPublicMethod(DetailAST aAST, String aName)
aAST
- the node to check. Normally aAST is a METHOD_DEF.aName
- the name of the method.public static String constructDottedName(DetailAST aAST)
aAST
- the AST containing the entire hierarcy of the objectpublic static boolean sameParameters(DetailAST aMethodAST1, DetailAST aMethodAST2)
aMethodAST1
- the first method AST to test.aMethodAST2
- the second method AST to test.