|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tentackle.annotations.AnalyzeInfo
public class AnalyzeInfo
Holds information gathered by the Analyze annotation.
The AnalyzeProcessor creates an info file in an apt run and wurblets pick up this information to generate code.
| Nested Class Summary | |
|---|---|
static class |
AnalyzeInfo.Parameter
Abstraction of a method parameter. |
| Field Summary | |
|---|---|
static String |
INFO_FILE_EXTENSION
all info files end with .info |
static String |
INFO_FILE_VERSION
Fileformat version |
static String |
TYPE_CLASS
Information type for a class. |
static String |
TYPE_METHOD
Information type for a method. |
| Constructor Summary | |
|---|---|
AnalyzeInfo(ProcessingEnvironment processingEnv,
ExecutableElement methodElement)
Creates an AnalyzeInfo from a method element. |
|
AnalyzeInfo(String type)
Creates an AnalyzeInfo for a given type. |
|
| Method Summary | |
|---|---|
void |
addParameter(AnalyzeInfo.Parameter parameter)
Adds a formal parameter |
String |
cleanTypeString(String type)
Simplifies some classnames by removing package names. |
String |
getClassName()
Gets the name of the class this analyze info is part of. |
String |
getMethodName()
Gets the method name the annotation belongs to. |
Modifier[] |
getModifiers()
Gets the modifiers for the method |
String |
getModifiersAsString()
Gets the method's modifiers as a string |
AnalyzeInfo.Parameter[] |
getParameters()
Gets the formal parameters of the method. |
String |
getReturnType()
Gets the return type of the method |
String |
getSuperClassName()
Gets the name of the superclass this analyze info is part of. |
String |
getType()
Gets the type of this analyze info. |
boolean |
isModifierSet(Modifier modifier)
Checks whether given modifier is set for the method |
static boolean |
isModifierSet(Modifier modifier,
Modifier[] modifierList)
Checks if a modifier is in the set of modifiers |
boolean |
isReturningAppDbCursor()
Checks whether the method is returning an AppDbCursor. |
boolean |
isReturningAppDbObject()
Checks whether the method is returning an AppDbObject. |
boolean |
isReturningAppDbObjectCollection()
Checks whether the method is returning a collection of AppDbObjects. |
boolean |
isReturningDbCursor()
Checks whether the method is returning a DbCursors. |
boolean |
isReturningDbObject()
Checks whether the method is returning a DbObject. |
boolean |
isReturningDbObjectCollection()
Checks whether the method is returning a collection of DbObjects. |
boolean |
isVarArgsMethod()
Returns whether the method has varargs. |
static AnalyzeInfo |
readInfo(File infoFile)
Reads info from an file. |
static AnalyzeInfo |
readInfo(LineNumberReader reader)
Reads info from an line reader. |
void |
setClassName(String className)
Sets the classname and the packagename from a given classname. |
void |
setMethodName(String methodName)
Sets the method name the annotation belongs to. |
void |
setModifiers(Modifier[] modifiers)
Sets the modifiers for the method |
void |
setReturningAppDbCursor(boolean returningAppDbCursor)
Sets whether the method is returning an AppDbCursor. |
void |
setReturningAppDbObject(boolean returningAppDbObject)
Sets whether the method is returning an AppDbObject. |
void |
setReturningAppDbObjectCollection(boolean returningAppDbObjectCollection)
Sets whether the method is returning a collection of AppDbObjects. |
void |
setReturningDbCursor(boolean returningDbCursor)
Sets whether the method is returning a DbCursor. |
void |
setReturningDbObject(boolean returningDbObject)
Sets whether the method is returning a DbObject. |
void |
setReturningDbObjectCollection(boolean returningDbObjectCollection)
Sets whether the method is returning a collection of DbObjects. |
void |
setReturnType(String returnType)
Sets the return type of the method |
void |
setSuperClassName(String superClassName)
Sets the classname of the superclass. |
void |
setVarArgsMethod(boolean varArgsMethod)
Sets whether the method has varargs. |
String |
toString()
Gets the declaration string |
void |
write(PrintWriter writer)
Writes this object to an info file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String INFO_FILE_VERSION
public static final String INFO_FILE_EXTENSION
public static final String TYPE_METHOD
public static final String TYPE_CLASS
| Constructor Detail |
|---|
public AnalyzeInfo(String type)
throws IOException
type - one of TYPE_...
IOException - if unsupported TYPE_...
public AnalyzeInfo(ProcessingEnvironment processingEnv,
ExecutableElement methodElement)
throws IOException
processingEnv - the annotation processor's environmentmethodElement - the ExecutableElement to create an info from
IOException - if some I/O error occurs| Method Detail |
|---|
public String getType()
public String getClassName()
public void setClassName(String className)
className - the full class namepublic String getSuperClassName()
public void setSuperClassName(String superClassName)
superClassName - the full class namepublic String getMethodName()
public void setMethodName(String methodName)
methodName - the method namepublic String getReturnType()
public void setReturnType(String returnType)
returnType - the return typepublic AnalyzeInfo.Parameter[] getParameters()
public void addParameter(AnalyzeInfo.Parameter parameter)
parameter - the formal parameter to addpublic boolean isVarArgsMethod()
public void setVarArgsMethod(boolean varArgsMethod)
varArgsMethod - true if varargs methodpublic Modifier[] getModifiers()
public String getModifiersAsString()
public boolean isModifierSet(Modifier modifier)
modifier - the modifier to test
public void setModifiers(Modifier[] modifiers)
modifiers - for the methodpublic boolean isReturningDbObject()
DbObject.
public void setReturningDbObject(boolean returningDbObject)
DbObject.
returningDbObject - true if method returns a DbObject.public boolean isReturningDbObjectCollection()
DbObjects.
public void setReturningDbObjectCollection(boolean returningDbObjectCollection)
DbObjects.
returningDbObjectCollection - true if method returns a collection of DbObjects.public boolean isReturningDbCursor()
DbCursors.
public void setReturningDbCursor(boolean returningDbCursor)
DbCursor.
returningDbCursor - true if method returns a collection of DbCursor.public boolean isReturningAppDbObject()
AppDbObject.
public void setReturningAppDbObject(boolean returningAppDbObject)
AppDbObject.
returningAppDbObject - true if method returns an AppDbObject.public boolean isReturningAppDbObjectCollection()
AppDbObjects.
public void setReturningAppDbObjectCollection(boolean returningAppDbObjectCollection)
AppDbObjects.
returningAppDbObjectCollection - true if method returns a collection of AppDbObjects.public boolean isReturningAppDbCursor()
AppDbCursor.
public void setReturningAppDbCursor(boolean returningAppDbCursor)
AppDbCursor.
returningAppDbCursor - true if method returns an AppDbCursor.public String toString()
toString in class Object
public void write(PrintWriter writer)
throws IOException
writer - is the PrintWriter object
IOException - if write failed
public static AnalyzeInfo readInfo(File infoFile)
throws FileNotFoundException,
IOException
infoFile - the file to read from
FileNotFoundException
IOException
public static AnalyzeInfo readInfo(LineNumberReader reader)
throws IOException
reader - is the LineNumberReader
IOException
public static boolean isModifierSet(Modifier modifier,
Modifier[] modifierList)
modifier - the modifier to checkmodifierList - the list of modifiers
public String cleanTypeString(String type)
type - the full type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||