本文整理汇总了Java中org.pentaho.di.core.Condition.isNegated方法的典型用法代码示例。如果您正苦于以下问题:Java Condition.isNegated方法的具体用法?Java Condition.isNegated怎么用?Java Condition.isNegated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.Condition
的用法示例。
在下文中一共展示了Condition.isNegated方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertConditionToSql
import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
protected String convertConditionToSql(Condition condition) throws KettleValueException {
if (condition.isAtomic()) {
return convertAtomicConditionToSql(condition);
}
StringBuilder sql = new StringBuilder();
if (condition.isNegated()) {
sql.append("NOT(");
}
for (int i=0;i<condition.nrConditions();i++) {
Condition c = condition.getCondition(i);
if (i>0) {
sql.append(" ").append(c.getOperatorDesc());
}
sql.append("(");
sql.append(convertConditionToSql(c));
sql.append(")");
}
if (condition.isNegated()) {
sql.append(")");
}
return sql.toString();
}
示例2: convertConditionToJson
import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
protected String convertConditionToJson(Condition condition) throws KettleValueException {
if (condition.isAtomic()) {
return convertAtomicConditionToJson(condition);
}
StringBuilder sql = new StringBuilder();
if (condition.isNegated()) {
throw new KettleValueException("Negated conditions can't be converted to JSON");
}
for (int i=0;i<condition.nrConditions();i++) {
Condition c = condition.getCondition(i);
if (i>0) {
sql.append(", ");
}
sql.append(convertConditionToJson(c));
}
return sql.toString();
}
示例3: drawNegated
import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
private void drawNegated(GC gc, int x, int y, Condition condition)
{
Color color = gc.getForeground();
if (hover_not) gc.setBackground(gray);
gc.fillRectangle(Real2Screen(size_not));
gc.drawRectangle(Real2Screen(size_not));
if (condition.isNegated())
{
if (hover_not) gc.setForeground(green);
gc.drawText(STRING_NOT, size_not.x+5+offsetx, size_not.y+2+offsety, SWT.DRAW_TRANSPARENT);
gc.drawText(STRING_NOT, size_not.x+6+offsetx, size_not.y+2+offsety, SWT.DRAW_TRANSPARENT);
if (hover_not) gc.setForeground(color);
}
else
{
if (hover_not)
{
gc.setForeground(red);
gc.drawText(STRING_NOT, size_not.x+5+offsetx, size_not.y+2+offsety, SWT.DRAW_TRANSPARENT);
gc.drawText(STRING_NOT, size_not.x+6+offsetx, size_not.y+2+offsety, SWT.DRAW_TRANSPARENT);
gc.setForeground(color);
}
}
if (hover_not) gc.setBackground(bg);
}
示例4: drawNegated
import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
private void drawNegated( GC gc, int x, int y, Condition condition ) {
Color color = gc.getForeground();
if ( hover_not ) {
gc.setBackground( gray );
}
gc.fillRectangle( Real2Screen( size_not ) );
gc.drawRectangle( Real2Screen( size_not ) );
if ( condition.isNegated() ) {
if ( hover_not ) {
gc.setForeground( green );
}
gc.drawText( STRING_NOT, size_not.x + 5 + offsetx, size_not.y + 2 + offsety, SWT.DRAW_TRANSPARENT );
gc.drawText( STRING_NOT, size_not.x + 6 + offsetx, size_not.y + 2 + offsety, SWT.DRAW_TRANSPARENT );
if ( hover_not ) {
gc.setForeground( color );
}
} else {
if ( hover_not ) {
gc.setForeground( red );
gc.drawText( STRING_NOT, size_not.x + 5 + offsetx, size_not.y + 2 + offsety, SWT.DRAW_TRANSPARENT );
gc.drawText( STRING_NOT, size_not.x + 6 + offsetx, size_not.y + 2 + offsety, SWT.DRAW_TRANSPARENT );
gc.setForeground( color );
}
}
if ( hover_not ) {
gc.setBackground( bg );
}
}