本文整理汇总了Java中com.github.javaparser.ast.body.MultiTypeParameter类的典型用法代码示例。如果您正苦于以下问题:Java MultiTypeParameter类的具体用法?Java MultiTypeParameter怎么用?Java MultiTypeParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MultiTypeParameter类属于com.github.javaparser.ast.body包,在下文中一共展示了MultiTypeParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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));
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}