本文整理汇总了Java中com.github.javaparser.ast.body.MultiTypeParameter类的典型用法代码示例。如果您正苦于以下问题:Java MultiTypeParameter类的具体用法?Java MultiTypeParameter怎么用?Java MultiTypeParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MultiTypeParameter类属于com.github.javaparser.ast.body包,在下文中一共展示了MultiTypeParameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override
public void visit(MultiTypeParameter n, Object arg) {
printer.printLn("MultiTypeParameter");
printAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
Iterator<Type> types = n.getTypes().iterator();
types.next().accept(this, arg);
while (types.hasNext()) {
printer.print(" | ");
types.next().accept(this, arg);
}
printer.print(" ");
n.getId().accept(this, arg);
}
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:17,代码来源:ASTDumpVisitor.java
示例2: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override
public JCTree visit(final MultiTypeParameter n, final Object arg) {
//ARG0: JCModifiers mods
JCModifiers arg0;
long jcmodifier = setJCTreeModifiers(n.getModifiers(), 0);
arg0 = new AJCModifiers(make.Modifiers(jcmodifier), null);
/* TODO - Not supported yet
if (n.getAnnotations() != null) {
for (final AnnotationExpr a : n.getAnnotations()) {
JCTree result = a.accept(this, arg);
}
}
*/
//ARG1: Name name
Name arg1 = names.fromString(n.getId().getName());
//ARG2: JCExpression vartype
JCExpression arg2;
if (n.getTypes().size() > 1) {
List<JCExpression> typelist = List.<JCExpression>nil();
for (final com.github.javaparser.ast.type.Type type : n.getTypes()) {
typelist = typelist.append((JCExpression) type.accept(this, arg));
}
arg2 = new AJCTypeUnion(make.TypeUnion(typelist), null);
} else {
// Get the single element
arg2 = (JCExpression) n.getTypes().get(0).accept(this, arg);
}
//ARG3: JCExpression init
JCExpression arg3 = null;
return new AJCVariableDecl(make.VarDef(arg0, arg1, arg2, arg3), ((n.getComment() != null) ? n.getComment().getContent() : null));
}
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:38,代码来源:JavaParser2JCTree.java
示例3: doMerge
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override
public MultiTypeParameter doMerge(MultiTypeParameter first, MultiTypeParameter second) {
MultiTypeParameter mtp = new MultiTypeParameter();
mtp.setModifiers(mergeModifiers(first.getModifiers(), second.getModifiers()));
mtp.setId(first.getId());
mtp.setAnnotations(mergeCollections(first.getAnnotations(), second.getAnnotations()));
mtp.setTypes(first.getTypes());
return mtp;
}
开发者ID:beihaifeiwu,项目名称:dolphin,代码行数:13,代码来源:MultiTypeParameterMerger.java
示例4: doIsEquals
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean doIsEquals(MultiTypeParameter first, MultiTypeParameter second) {
if(!getMerger(VariableDeclaratorId.class).isEquals(first.getId(),second.getId())) return false;
List<Type> firstTypes = first.getTypes();
List<Type> secondTypes = second.getTypes();
if(firstTypes == null) return secondTypes == null;
if(secondTypes == null) return false;
if(firstTypes.size() != secondTypes.size()) return false;
for(Type ft : firstTypes){
boolean found = false;
AbstractMerger merger = getMerger(ft.getClass());
for(Type st : secondTypes){
if(merger.isEquals(ft, st)){
found = true; break;
}
}
if(!found) return false;
}
return true;
}
开发者ID:beihaifeiwu,项目名称:dolphin,代码行数:28,代码来源:MultiTypeParameterMerger.java
示例5: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public Boolean visit(MultiTypeParameter n1, Node arg) {
MultiTypeParameter n2 = (MultiTypeParameter) arg;
if (!nodeEquals(n1.getType(), n2.getType())) {
return Boolean.FALSE;
}
return visit((BaseParameter) n1, arg);
}
开发者ID:plum-umd,项目名称:java-sketch,代码行数:8,代码来源:EqualsVisitor.java
示例6: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override
public Node visit(MultiTypeParameter _n, Object _arg) {
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
UnionType type = cloneNodes(_n.getType(), _arg);
VariableDeclaratorId id = cloneNodes(_n.getId(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
MultiTypeParameter r = new MultiTypeParameter(
_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
_n.getModifiers(), annotations, type, id
);
r.setComment(comment);
return r;
}
开发者ID:plum-umd,项目名称:java-sketch,代码行数:15,代码来源:CloneVisitor.java
示例7: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public void visit(MultiTypeParameter n, Object arg) {
printAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
Type type = n.getType();
if (type != null) {
type.accept(this, arg);
}
printer.print(" ");
n.getId().accept(this, arg);
}
开发者ID:plum-umd,项目名称:java-sketch,代码行数:13,代码来源:DumpVisitor.java
示例8: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public void visit(final MultiTypeParameter n, final A arg) {
visitComment(n.getComment(), arg);
if (n.getAnnotations() != null) {
for (final AnnotationExpr a : n.getAnnotations()) {
a.accept(this, arg);
}
}
if (n.getType() != null) {
n.getType().accept(this, arg);
}
n.getId().accept(this, arg);
}
开发者ID:plum-umd,项目名称:java-sketch,代码行数:13,代码来源:VoidVisitorAdapter.java
示例9: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public void visit(final MultiTypeParameter n, final A arg) {
jw.write(n);
visitComment(n.getComment(), arg);
if (n.getAnnotations() != null) {
for (final AnnotationExpr a : n.getAnnotations()) {
a.accept(this, arg);
}
}
if (n.getType() != null) {
n.getType().accept(this, arg);
}
n.getId().accept(this, arg);
}
开发者ID:plum-umd,项目名称:java-sketch,代码行数:14,代码来源:JsonVisitorAdapter.java
示例10: CatchClause
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
public CatchClause(final int beginLine, final int beginColumn, final int endLine, final int endColumn,
final int exceptModifier, final List<AnnotationExpr> exceptAnnotations, final List<Type> exceptTypes,
final VariableDeclaratorId exceptId, final BlockStmt catchBlock) {
super(beginLine, beginColumn, endLine, endColumn);
setExcept(new MultiTypeParameter(beginLine, beginColumn, endLine, endColumn, exceptModifier, exceptAnnotations, exceptTypes, exceptId));
setCatchBlock(catchBlock);
}
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:8,代码来源:CatchClause.java
示例11: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public Boolean visit(MultiTypeParameter n1, Node arg) {
MultiTypeParameter n2 = (MultiTypeParameter) arg;
if (n1.getTypes().size() != n2.getTypes().size()) {
return Boolean.FALSE;
}
Iterator<Type> n1types = n1.getTypes().iterator();
Iterator<Type> n2types = n2.getTypes().iterator();
while (n1types.hasNext() && n2types.hasNext()) {
if (!nodeEquals(n1types.next(), n2types.next())) {
return Boolean.FALSE;
}
}
return visit((BaseParameter) n1, arg);
}
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:15,代码来源:EqualsVisitor.java
示例12: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override
public Node visit(MultiTypeParameter _n, Object _arg) {
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<Type> types = visit(_n.getTypes(), _arg);
VariableDeclaratorId id = cloneNodes(_n.getId(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
MultiTypeParameter r = new MultiTypeParameter(
_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
_n.getModifiers(), annotations, types, id
);
r.setComment(comment);
return r;
}
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:15,代码来源:CloneVisitor.java
示例13: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public void visit(MultiTypeParameter n, Object arg) {
printAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
Iterator<Type> types = n.getTypes().iterator();
types.next().accept(this, arg);
while (types.hasNext()) {
printer.print(" | ");
types.next().accept(this, arg);
}
printer.print(" ");
n.getId().accept(this, arg);
}
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:15,代码来源:DumpVisitor.java
示例14: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public void visit(final MultiTypeParameter n, final A arg) {
visitComment(n.getComment(), arg);
if (n.getAnnotations() != null) {
for (final AnnotationExpr a : n.getAnnotations()) {
a.accept(this, arg);
}
}
for (final Type type : n.getTypes()) {
type.accept(this, arg);
}
n.getId().accept(this, arg);
}
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:13,代码来源:VoidVisitorAdapter.java
示例15: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public Node visit(MultiTypeParameter n, A arg) {
visit((BaseParameter) n, arg);
List<Type> types = new LinkedList<Type>();
for (Type type : n.getTypes()) {
types.add((Type) type.accept(this, arg));
}
n.setTypes(types);
return n;
}
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:10,代码来源:ModifierVisitorAdapter.java
示例16: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override
public Node visit(
MultiTypeParameter n, Map<Node, Node> arg
) {
if (arg.containsKey(n)) {
return arg.get(n);
}
return super.visit(n, arg);
}
开发者ID:WeTheInternet,项目名称:xapi,代码行数:10,代码来源:ConcreteModifierVisitor.java
示例17: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override
public void visit(MultiTypeParameter n, Script arg) {
}
开发者ID:Nosorog,项目名称:nosorog-core,代码行数:4,代码来源:NoOpVisitor.java
示例18: visit
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
@Override public Node visit(MultiTypeParameter n, A arg) {
visit((BaseParameter) n, arg);
n.setType((UnionType)n.getType().accept(this, arg));
return n;
}
开发者ID:plum-umd,项目名称:java-sketch,代码行数:6,代码来源:ModifierVisitorAdapter.java
示例19: getExcept
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
public MultiTypeParameter getExcept() {
return except;
}
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:4,代码来源:CatchClause.java
示例20: setExcept
import com.github.javaparser.ast.body.MultiTypeParameter; //导入依赖的package包/类
public void setExcept(final MultiTypeParameter except) {
this.except = except;
setAsParentNodeOf(this.except);
}
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:5,代码来源:CatchClause.java
注:本文中的com.github.javaparser.ast.body.MultiTypeParameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论