当前位置: 首页>>代码示例>>Java>>正文


Java MarkerAnnotationExpr类代码示例

本文整理汇总了Java中com.github.javaparser.ast.expr.MarkerAnnotationExpr的典型用法代码示例。如果您正苦于以下问题:Java MarkerAnnotationExpr类的具体用法?Java MarkerAnnotationExpr怎么用?Java MarkerAnnotationExpr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MarkerAnnotationExpr类属于com.github.javaparser.ast.expr包,在下文中一共展示了MarkerAnnotationExpr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createOrFindMarkerAnnotation

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
protected MarkerAnnotationExpr createOrFindMarkerAnnotation(BodyDeclaration<?> getter, String fullAnnotationName) {
	String name = AbstractGenerator.finalName(fullAnnotationName);
	importIf(fullAnnotationName);
	//getUnit().addImport(fullAnnotationName);

	for(AnnotationExpr annotationExpr : getter.getAnnotations()) {
		String annName = annotationExpr.getName().asString();
		if(annName.equals(fullAnnotationName) || name.equals(annName)) {
			return (MarkerAnnotationExpr) annotationExpr;
		}
	}

	String pkg = AbstractGenerator.packageName(fullAnnotationName);
	NodeList<MemberValuePair> nodes = NodeList.nodeList();
	//Name nm = new Name(new Name(pkg), name);
	MarkerAnnotationExpr ax = new MarkerAnnotationExpr(new Name(name));
	getter.addAnnotation(ax);
	return ax;
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:20,代码来源:ClassWrapper.java

示例2: parseResource

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public static Option<ResourceDocumentation> parseResource(CompilationUnit root) {
    return fold(root.getChildrenNodes(), ClassOrInterfaceDeclaration.class, none(), (maybeDoc, decl) ->
      maybeDoc.orElse(() ->
        walk(decl, SingleMemberAnnotationExpr.class).exists(hasName("path")) ?
        some(walk(decl, MethodDeclaration.class).foldLeft((rDoc, mDelc) ->
            walk(mDelc, SingleMemberAnnotationExpr.class).exists(hasName("path")) || walk(mDelc, MarkerAnnotationExpr.class).exists(or(hasName("get"), hasName("post"))) ?
            rDoc.append(
              new MethodDocumentation(
                ofType(mDelc.getChildrenNodes(), SingleMemberAnnotationExpr.class).filter(hasName("path")).headOption().map(a -> rDoc.path + normalizeUrl(a.getMemberValue().toString())).orSome(rDoc.path),
                ofType(mDelc.getChildrenNodes(), MarkerAnnotationExpr.class).filter(or(hasName("get"), hasName("post"))).headOption().map(a -> a.getName().getName()).orSome("GET"),
                ofType(mDelc.getChildrenNodes(), SingleMemberAnnotationExpr.class).filter(hasName("rolesallowed")).headOption().map(a -> arrayList(a.getMemberValue().toString().split(","))).orSome(nil()).map(role->StringUtils.remove(role,"\"")),
                mDelc.getComment() != null ? mDelc.getComment().getContent() : "",
                iterableList(mDelc.getParameters()).map(Node::toString),
                nil())) :
            rDoc,
          new ResourceDocumentation(
            ofType(decl.getChildrenNodes(), SingleMemberAnnotationExpr.class).filter(hasName("path")).headOption().map(a -> a.getMemberValue().toString()).map(Strings::normalizeUrl).orSome("/"),
            ofType(decl.getChildrenNodes(), SingleMemberAnnotationExpr.class).filter(hasName("rolesallowed")).headOption().map(a -> arrayList(a.getMemberValue().toString().split(","))).orSome(nil()),
            decl.getComment() == null ? "" : decl.getComment().getContent(),
            nil()))) :
        none()));

}
 
开发者ID:kantega,项目名称:respiro,代码行数:24,代码来源:ResourceParser.java

示例3: visit

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public void visit(final MarkerAnnotationExpr n, final Object arg) {
    printer.printLn("MarkerAnnotationExpr");
    printJavaComment(n.getComment(), arg);
    printer.print("@");
    n.getName().accept(this, arg);
}
 
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:8,代码来源:ASTDumpVisitor.java

示例4: visit

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
  public JCTree visit(final MarkerAnnotationExpr n, final Object arg) {
       /* TODO - Currently not supporting annotations
JCTree result = n.getName().accept(this, arg);
return new AJCMarkerAnnotation( make.MarkerAnnotation( ), ( (n.getComment()!=null)?n.getComment().getContent():null ) );
       */
      System.err.println("Assigning null at:" + Thread.currentThread().getStackTrace()[1].getLineNumber());
      return null;
  }
 
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:10,代码来源:JavaParser2JCTree.java

示例5: doMerge

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public MarkerAnnotationExpr doMerge(MarkerAnnotationExpr first, MarkerAnnotationExpr second) {
  MarkerAnnotationExpr mae = new MarkerAnnotationExpr();

  mae.setName(mergeSingle(first.getName(),second.getName()));

  return mae;
}
 
开发者ID:beihaifeiwu,项目名称:dolphin,代码行数:9,代码来源:MarkerAnnotationExprMerger.java

示例6: parsePlugin

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public static Option<String> parsePlugin(CompilationUnit root) {
    return fold(root.getChildrenNodes(), ClassOrInterfaceDeclaration.class, none(), (maybeDoc, decl) ->
      maybeDoc.orElse(() ->
        walk(decl, MarkerAnnotationExpr.class).exists(hasName("plugin")) ?
        Option.fromNull(decl.getComment()).map(Comment::getContent) :
        none()
      ));
}
 
开发者ID:kantega,项目名称:respiro,代码行数:9,代码来源:ResourceParser.java

示例7: visit

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override public Boolean visit(final MarkerAnnotationExpr n1, final Node arg) {
	final MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg;

	if (!nodeEquals(n1.getName(), n2.getName())) {
		return false;
	}

	return true;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:10,代码来源:EqualsVisitor.java

示例8: visit

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public Node visit(MarkerAnnotationExpr _n, Object _arg) {
	NameExpr name = cloneNodes(_n.getName(), _arg);
	Comment comment = cloneNodes(_n.getComment(), _arg);

	MarkerAnnotationExpr r = new MarkerAnnotationExpr(
			_n.getRange(),
			name
	);
	r.setComment(comment);
	return r;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:13,代码来源:CloneVisitor.java

示例9: addMarkerAnnotation

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
/**
 * Annotates this with a marker annotation
 * 
 * @param name the name of the annotation
 * @return this
 */
@SuppressWarnings("unchecked")
public default T addMarkerAnnotation(String name) {
    MarkerAnnotationExpr markerAnnotationExpr = new MarkerAnnotationExpr(
            name(name));
    getAnnotations().add(markerAnnotationExpr);
    markerAnnotationExpr.setParentNode((Node) this);
    return (T) this;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:15,代码来源:NodeWithAnnotations.java

示例10: createOrFindMarkerAnnotation

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
protected MarkerAnnotationExpr createOrFindMarkerAnnotation(BodyDeclaration<?> getter, String fullAnnotationName) {
	return m_classWrapper.createOrFindMarkerAnnotation(getter, fullAnnotationName);
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:4,代码来源:ColumnWrapper.java

示例11: visit

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public void visit(MarkerAnnotationExpr n, Script arg) {
}
 
开发者ID:Nosorog,项目名称:nosorog-core,代码行数:4,代码来源:NoOpVisitor.java

示例12: doIsEquals

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public boolean doIsEquals(MarkerAnnotationExpr first, MarkerAnnotationExpr second) {

  return first.getName().equals(second.getName());
}
 
开发者ID:beihaifeiwu,项目名称:dolphin,代码行数:6,代码来源:MarkerAnnotationExprMerger.java

示例13: visit

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override public Node visit(final MarkerAnnotationExpr n, final A arg) {
	n.setName((NameExpr) n.getName().accept(this, arg));
	return n;
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:5,代码来源:ModifierVisitorAdapter.java

示例14: visit

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override public void visit(final MarkerAnnotationExpr n, final A arg) {
	visitComment(n.getComment(), arg);
	n.getName().accept(this, arg);
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:5,代码来源:VoidVisitorAdapter.java

示例15: visit

import com.github.javaparser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override public Node visit(final MarkerAnnotationExpr n, final A arg) {
	visitComment(n, arg);
	n.setName((NameExpr) n.getName().accept(this, arg));
	return n;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:6,代码来源:ModifierVisitorAdapter.java


注:本文中的com.github.javaparser.ast.expr.MarkerAnnotationExpr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。