本文整理了Java中com.github.javaparser.ast.Node.accept()
方法的一些代码示例,展示了Node.accept()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.accept()
方法的具体详情如下:
包路径:com.github.javaparser.ast.Node
类名称:Node
方法名:accept
暂无
代码示例来源:origin: org.jooby/jooby-spec
public List<Entry<Object, Node>> accept(final Node node, final Context ctx) {
node.accept(this, ctx);
return nodes;
}
代码示例来源:origin: com.github.javaparser/java-symbol-solver-core
/**
* Should return more like a TypeApplication: a TypeDeclaration and possible typeParametersValues or array
* modifiers.
*
* @return
*/
private ResolvedType getTypeConcrete(Node node, boolean solveLambdas) {
if (node == null) throw new IllegalArgumentException();
return node.accept(typeExtractor, solveLambdas);
}
代码示例来源:origin: javaparser/javasymbolsolver
/**
* Should return more like a TypeApplication: a TypeDeclaration and possible typeParametersValues or array
* modifiers.
*
* @return
*/
private ResolvedType getTypeConcrete(Node node, boolean solveLambdas) {
if (node == null) throw new IllegalArgumentException();
return node.accept(typeExtractor, solveLambdas);
}
代码示例来源:origin: com.github.javaparser/javaparser-symbol-solver-core
/**
* Should return more like a TypeApplication: a TypeDeclaration and possible typeParametersValues or array
* modifiers.
*/
private ResolvedType getTypeConcrete(Node node, boolean solveLambdas) {
if (node == null) throw new IllegalArgumentException();
return node.accept(typeExtractor, solveLambdas);
}
代码示例来源:origin: org.wisdom-framework/wisdom-source-model
/**
* Extract the String value of the <code>node</code>.
* It removes the {@literal "}
*
* @param node The java node which value to convert into string
* @return string version of the node value.
*/
public static String asString(Node node){
return node.accept(new StringExtractor(), "");
}
代码示例来源:origin: org.jooby/jooby-spec
public Set<String> accept(final Node node) {
packages.add("java.lang");
if (node != null) {
root(node).accept(this, null);
}
return packages;
}
代码示例来源:origin: org.jooby/jooby-spec
public LocalStack accept(final Node node, final Context ctx) {
this.node = node;
try {
root(node).accept(this, ctx);
} catch (WorkDone ex) {
}
return vars;
}
代码示例来源:origin: org.jooby/jooby-spec
private LambdaExpr handler(final Expression expr, final Context ctx) {
Node node = vars.getOrDefault(expr.toStringWithoutComments(), expr);
return node.accept(new GenericVisitorAdapter<LambdaExpr, Context>() {
@Override
public LambdaExpr visit(final LambdaExpr n, final Context ctx) {
return n;
}
}, ctx);
}
代码示例来源:origin: org.jooby/jooby-spec
public Map<String, Object> accept(final Node node, final Context ctx) {
root(node).accept(this, ctx);
return values;
}
代码示例来源:origin: org.jooby/jooby-spec
protected void visitNode(final Node n, final Context ctx) {
if (this.node == n) {
throw new WorkDone();
}
if (visited.add(n) && n instanceof BodyDeclaration) {
LocalVariableCollector collector = new LocalVariableCollector(vars, visited);
n.accept(collector, ctx);
this.vars = collector.vars;
}
visited.add(n);
}
代码示例来源:origin: org.jooby/jooby-spec
public Map<String, Object> accept(final Node node, final String method, final Context ctx) {
try {
node.accept(this, ctx);
if (!doc.containsKey("@statusCodes")) {
Map<Object, Object> codes = new LinkedHashMap<>();
Status status = Status.OK;
if ("DELETE".equals(method)) {
status = Status.NO_CONTENT;
}
codes.put(status.value(), status.reason());
doc.put("@statusCodes", codes);
}
} catch (Exception x) {
log.debug("Doc collector resulted in exception", x);
}
return doc;
}
代码示例来源:origin: org.jooby/jooby-spec
public List<RouteParam> accept(final Node node, final Context ctx) {
if (node instanceof LambdaExpr) {
((LambdaExpr) node).getParameters().forEach(p -> {
names.add(p.getId().toStringWithoutComments());
});
}
node.accept(this, ctx);
return params;
}
代码示例来源:origin: org.jooby/jooby-spec
public RouteResponse accept(final Node node, final Context ctx, final Type retType,
final String doc, final Map<Integer, String> codes) {
this.type = retType;
boolean lambda = node instanceof LambdaExpr;
if (lambda) {
((LambdaExpr) node).getParameters()
.forEach(p -> args.add(p.getId().toStringWithoutComments()));
}
if (this.type == null) {
node.accept(this, ctx);
if (type == null && lambda) {
LambdaExpr expr = (LambdaExpr) node;
if (expr.getChildrenNodes().size() == 1) {
type = expr.getChildrenNodes().get(0).accept(new TypeCollector(), ctx);
}
}
}
return new RouteResponseImpl(this.type == null ? Object.class : this.type, doc, codes);
}
代码示例来源:origin: org.apache.uima/uimaj-v3migration-jcas
updatedNode.accept(this, null);
} else {
super.visit(n, null);
内容来源于网络,如有侵权,请联系作者删除!