本文整理汇总了Java中japa.parser.ast.expr.SingleMemberAnnotationExpr.getMemberValue方法的典型用法代码示例。如果您正苦于以下问题:Java SingleMemberAnnotationExpr.getMemberValue方法的具体用法?Java SingleMemberAnnotationExpr.getMemberValue怎么用?Java SingleMemberAnnotationExpr.getMemberValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类japa.parser.ast.expr.SingleMemberAnnotationExpr
的用法示例。
在下文中一共展示了SingleMemberAnnotationExpr.getMemberValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import japa.parser.ast.expr.SingleMemberAnnotationExpr; //导入方法依赖的package包/类
@Override
public void visit(SingleMemberAnnotationExpr expression, Object arg)
{ // annotation de type @SuppressWarnings("javadoc")
NameExpr name = expression.getName();
if(name.getName().equalsIgnoreCase("SuppressWarnings"))
{ Expression expr = expression.getMemberValue();
if(expr instanceof StringLiteralExpr)
{ StringLiteralExpr sle = (StringLiteralExpr) expr;
if(sle.getValue().equalsIgnoreCase("javadoc"))
{ int line = expression.getBeginLine();
printErr("Erreur ligne "+line+" : utilisation de l'annotation SuppressWarnings sur 'javadoc'. Il faut supprimer cette annotation et compléter la Javadoc.");
errorCount++;
}
}
}
//NOTE ne traite pas le cas où on a plusieurs membres, e.g. @SuppressWarnings({"javadoc","xxxx"})
}
示例2: visit
import japa.parser.ast.expr.SingleMemberAnnotationExpr; //导入方法依赖的package包/类
@Override
public void visit(SingleMemberAnnotationExpr expression, Object arg)
{ // annotation de type @SuppressWarnings("javadoc")
NameExpr name = expression.getName();
if(name.getName().equalsIgnoreCase("SuppressWarnings"))
{ Expression expr = expression.getMemberValue();
if(expr instanceof StringLiteralExpr)
{ StringLiteralExpr sle = (StringLiteralExpr) expr;
if(sle.getValue().equalsIgnoreCase("javadoc"))
{ int line = expression.getBeginLine();
printErr("Erreur ligne "+line+" : utilisation de l'annotation SuppressWarnings sur 'javadoc'. Il faut supprimer cette annotation et compléter la Javadoc.");
errorCount++;
}
}
}
//ne traite pas le cas où on a plusieurs membres, e.g. @SuppressWarnings({"javadoc","xxxx"})
}
示例3: visit
import japa.parser.ast.expr.SingleMemberAnnotationExpr; //导入方法依赖的package包/类
@Override
public void visit(SingleMemberAnnotationExpr expression, Object arg)
{ // annotation de type @SuppressWarnings("javadoc")
NameExpr name = expression.getName();
if(name.getName().equalsIgnoreCase("SuppressWarnings"))
{ Expression expr = expression.getMemberValue();
if(expr instanceof StringLiteralExpr)
{ StringLiteralExpr sle = (StringLiteralExpr) expr;
if(sle.getValue().equalsIgnoreCase("javadoc"))
{ int line = expression.getBeginLine();
printErr("Erreur ligne "+line+" : utilisation de l'annotation SuppressWarnings sur 'javadoc'. Il faut supprimer cette annotation et compléter la Javadoc.");
errorCount++;
}
}
}
//
}
示例4: isClaraHandler
import japa.parser.ast.expr.SingleMemberAnnotationExpr; //导入方法依赖的package包/类
private static boolean isClaraHandler(MethodDeclaration method, String id,
String className) {
if (method.getAnnotations()==null) {
return false;
}
for (AnnotationExpr ann : method.getAnnotations()) {
if ("UiHandler".equals(ann.getName().getName())) {
if (ann instanceof SingleMemberAnnotationExpr) {
SingleMemberAnnotationExpr smae = (SingleMemberAnnotationExpr)ann;
if (smae.getMemberValue() instanceof StringLiteralExpr) {
String v = ((StringLiteralExpr)smae.getMemberValue()).getValue();
if (id.equals(v)) {
return hasOneParamWithType(method, className);
}
}
}
}
}
return false;
}
示例5: isClaraField
import japa.parser.ast.expr.SingleMemberAnnotationExpr; //导入方法依赖的package包/类
private static boolean isClaraField(FieldDeclaration field, String id,
String className) {
if (field.getAnnotations()==null) {
return false;
}
for (AnnotationExpr ann : field.getAnnotations()) {
if ("UiField".equals(ann.getName().getName())) {
if (ann instanceof SingleMemberAnnotationExpr) {
SingleMemberAnnotationExpr smae = (SingleMemberAnnotationExpr)ann;
if (smae.getMemberValue() instanceof StringLiteralExpr) {
String v = ((StringLiteralExpr)smae.getMemberValue()).getValue();
if (id.equals(v)) {
return true;
}
}
}
}
}
return false;
}
示例6: getNestedClassNames
import japa.parser.ast.expr.SingleMemberAnnotationExpr; //导入方法依赖的package包/类
private static String[ ] getNestedClassNames( TypeDeclaration decl )
{
SingleMemberAnnotationExpr fullNameAnnot = ( SingleMemberAnnotationExpr ) decl.getAnnotations( ).get( 0 );
StringLiteralExpr fullNameExpr = ( StringLiteralExpr ) fullNameAnnot.getMemberValue( );
String fullName = fullNameExpr.getValue( );
int lastDot = fullName.lastIndexOf( '.' );
return fullName.substring( lastDot + 1 ).split( "\\$" );
}
示例7: findJavaFile
import japa.parser.ast.expr.SingleMemberAnnotationExpr; //导入方法依赖的package包/类
private static File findJavaFile( TypeDeclaration builderParentDecl )
{
SingleMemberAnnotationExpr fullNameAnnot = ( SingleMemberAnnotationExpr ) builderParentDecl.getAnnotations( ).get( 0 );
StringLiteralExpr fullNameExpr = ( StringLiteralExpr ) fullNameAnnot.getMemberValue( );
String fullName = fullNameExpr.getValue( );
int lastDot = fullName.lastIndexOf( '.' );
String path = fullName.substring( 0 , lastDot ).replace( '.' , File.separatorChar );
String[ ] classNames = fullName.substring( lastDot + 1 ).split( "\\$" );
String filePath = path + File.separator + classNames[ 0 ] + ".java";
return FileFinder.findFile( filePath , new File( "applet/src" ) , 2 );
}