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


Java BooleanLiteralExpr类代码示例

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


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

示例1: renderManyToOneAnnotations

import com.github.javaparser.ast.expr.BooleanLiteralExpr; //导入依赖的package包/类
private void renderManyToOneAnnotations(MethodDeclaration getter) {
	/*
	 * We need JoinColumn and ManyToOne
	 */
	NormalAnnotationExpr m2o = createOrFindAnnotation(getter, "javax.persistence.ManyToOne");
	MemberValuePair fetch = findAnnotationPair(m2o, "fetch");
	if(null == fetch) {
		importIf("javax.persistence.FetchType");
		m2o.addPair("fetch", "FetchType.LAZY");
	}

	MemberValuePair p = findAnnotationPair(m2o, "optional");
	if(null == p) {
		m2o.addPair("optional", Boolean.toString(m_column.isNullable()));
	} else {
		p.setValue(new BooleanLiteralExpr(m_column.isNullable()));
	}

	NormalAnnotationExpr na = createOrFindAnnotation(getter, "javax.persistence.JoinColumn");
	p = findAnnotationPair(na, "name");
	if(null == p) {
		na.addPair("name", "\"" + m_column.getName() + "\"");
	} else {
		p.setValue(new StringLiteralExpr(m_column.getName()));
	}
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:27,代码来源:ColumnWrapper.java

示例2: extractType

import com.github.javaparser.ast.expr.BooleanLiteralExpr; //导入依赖的package包/类
protected IsType extractType(Expression val) {
  if (val instanceof LiteralExpr) {
    if (val instanceof IntegerLiteralExpr) {
      return new ImmutableType("", "int");
    } else if (val instanceof LongLiteralExpr) {
      return new ImmutableType("", "long");
    } else if (val instanceof DoubleLiteralExpr) {
      return new ImmutableType("", "double");
    } else if (val instanceof CharLiteralExpr) {
      return new ImmutableType("", "char");
    } else if (val instanceof BooleanLiteralExpr) {
      return new ImmutableType("", "boolean");
    } else if (val instanceof StringLiteralExpr) {
      return new ImmutableType("java.lang", "String");
    }
    // TODO: arrays, ui containers, annotated elements, constructors, etc...
  }
  return new ImmutableType("java.lang", "Object");
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:20,代码来源:DataTypeOptions.java

示例3: visit

import com.github.javaparser.ast.expr.BooleanLiteralExpr; //导入依赖的package包/类
@Override
public JCTree visit(final BooleanLiteralExpr n, final Object arg) {
    //ARG0: Object value
    // The type if literals are tested with instance of
    // inside Literal
    Boolean arg0 = new Boolean(n.getValue());

    return new AJCLiteral(make.Literal(arg0), ((n.getComment() != null) ? n.getComment().getContent() : null));
}
 
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:10,代码来源:JavaParser2JCTree.java

示例4: visit

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

	if (n1.getValue() != n2.getValue()) {
		return false;
	}

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

示例5: visit

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

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

示例6: visit

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

示例7: visit

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

示例8: visit

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

示例9: PrimitiveDefaultValue

import com.github.javaparser.ast.expr.BooleanLiteralExpr; //导入依赖的package包/类
public PrimitiveDefaultValue(PrimitiveType type) {
  super("", type.getType().name());
  this.type = type;
  switch (type.getType()) {
    case Boolean:
      this.viewValue = "CHECKBOX";
      this.domainValue = createDomainValueExpression(
          new BooleanLiteralExpr(true),
          new BooleanLiteralExpr(false)
      );
      break;
    case Int:
      this.viewValue = "TEXT";
      this.domainValue = createDomainValueExpression(
          new IntegerLiteralExpr("Integer.MIN_VALUE"),
          new IntegerLiteralExpr("Integer.MAX_VALUE")
      );
      break;
    case Float:
      this.viewValue = "TEXT";
      this.domainValue = createDomainValueExpression(
          new DoubleLiteralExpr("-Float.MAX_VALUE"),
          new DoubleLiteralExpr("Float.MAX_VALUE")
      );
      break;
    case Double:
      this.viewValue = "TEXT";
      this.domainValue = createDomainValueExpression(
          new DoubleLiteralExpr("-Double.MAX_VALUE"),
          new DoubleLiteralExpr("Double.MAX_VALUE")
      );
      break;
    case Char:
      this.viewValue = "TEXT";
      this.domainValue = createDomainValueExpression(
          new CharLiteralExpr(Character.toString(Character.MIN_VALUE)),
          new CharLiteralExpr(Character.toString(Character.MAX_VALUE))
      );
      break;
    default:
      throw new UnsupportedOperationException("Type " + type.getType() + " is not supported.");
  }
}
 
开发者ID:WPIRoboticsProjects,项目名称:GRIP,代码行数:44,代码来源:PrimitiveDefaultValue.java

示例10: visit

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

示例11: visit

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

示例12: visit

import com.github.javaparser.ast.expr.BooleanLiteralExpr; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void visit(@Nullable MethodDeclaration methodDec,
		@Nullable XmlTestCase testCase) {
	if (null == methodDec || null == testCase)
		throw GlobalUtils
				.createNotInitializedException("classorinterfacedeclaration");
	else {
		if (methodDec.getName().equals("runTest")) {
			List<Expression> groups = new ArrayList<Expression>();
			groups.add(new StringLiteralExpr(testCase
					.getTestCaseFilePathName()));

			List<MemberValuePair> testAnnoParams = new ArrayList<MemberValuePair>();
			testAnnoParams.add(new MemberValuePair("groups",
					new ArrayInitializerExpr(groups)));
			testAnnoParams.add(new MemberValuePair("dataProvider",
					new StringLiteralExpr("dp")));

			List<CaseDependency> caseDeps = testCase
					.getDependOnTestCases();

			if (null != caseDeps) {
				List<Expression> dependsOnGroups = new ArrayList<Expression>();
				boolean alwaysRun = true;// NOPMD
				for (CaseDependency cDep : caseDeps) {
					dependsOnGroups.add(new StringLiteralExpr(cDep
							.getDependOnTestCaseID()));
					if (cDep.getDependencyType() == EnumCaseDependencyType.TESTCASESTEPDEPENDENCY) {
						alwaysRun = false;// NOPMD
					}
				}
				testAnnoParams.add(new MemberValuePair(
						"dependsOnGroups", new ArrayInitializerExpr(
								dependsOnGroups)));
				testAnnoParams.add(new MemberValuePair("alwaysRun",
						new BooleanLiteralExpr(alwaysRun)));
			}
			NormalAnnotationExpr testAnno = new NormalAnnotationExpr(
					ASTHelper.createNameExpr("Test"), testAnnoParams);

			methodDec.getAnnotations().add(testAnno);
		}
	}
}
 
开发者ID:bigtester,项目名称:automation-test-engine,代码行数:48,代码来源:CaseRunnerGenerator.java

示例13: visit

import com.github.javaparser.ast.expr.BooleanLiteralExpr; //导入依赖的package包/类
@Override
public Object visit(final BooleanLiteralExpr n, final Context arg) {
  return n.getValue();
}
 
开发者ID:jooby-project,项目名称:jooby,代码行数:5,代码来源:LiteralCollector.java

示例14: visit

import com.github.javaparser.ast.expr.BooleanLiteralExpr; //导入依赖的package包/类
@Override
public void visit(final BooleanLiteralExpr n, final Context ctx) {
  visitNode(n, ctx);
  super.visit(n, ctx);

}
 
开发者ID:jooby-project,项目名称:jooby,代码行数:7,代码来源:LocalVariableCollector.java

示例15: visit

import com.github.javaparser.ast.expr.BooleanLiteralExpr; //导入依赖的package包/类
@Override
public Type visit(final BooleanLiteralExpr n, final Context arg) {
  return boolean.class;
}
 
开发者ID:jooby-project,项目名称:jooby,代码行数:5,代码来源:TypeCollector.java


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